From 4ace21b90351491f974198035a1a8ea85937c7d0 Mon Sep 17 00:00:00 2001 From: "JJ-Cro (Codex)" Date: Mon, 2 Nov 2026 09:02:42 +0100 Subject: [PATCH 1/9] feat(v4.8.5): add fixed-rate borrow and corporate action endpoints - Add fixed-rate borrow penalty interest queries and order cancellation. - Add public corporate action queries for option stock splits and dividends. - Add documented request and response types and keyless endpoint tests. - Bump the package patch version from 4.8.4 to 4.8.5. --- package-lock.json | 4 +- package.json | 2 +- src/rest-client-v5.ts | 37 ++++ src/types/request/v5-market.ts | 8 + src/types/request/v5-spot-leverage-token.ts | 11 + src/types/response/v5-market.ts | 24 +++ src/types/response/v5-spot-leverage-token.ts | 10 + test/v5/market-spot-margin.test.ts | 200 +++++++++++++++++++ 8 files changed, 293 insertions(+), 3 deletions(-) create mode 100644 test/v5/market-spot-margin.test.ts diff --git a/package-lock.json b/package-lock.json index a9e76876..7a19c170 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bybit-api", - "version": "4.8.4", + "version": "4.8.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bybit-api", - "version": "4.8.4", + "version": "4.8.5", "license": "MIT", "dependencies": { "@types/ws": "8.18.1", diff --git a/package.json b/package.json index 0874b489..71b6283c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-api", - "version": "4.8.4", + "version": "4.8.5", "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index 09177550..14d0de05 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -91,6 +91,7 @@ import { CancelAllRFQResultV5, CancelBorrowOrderFixedParamsV5, CancelEventQuoteParamsV5, + CancelFixedRateBorrowOrderParamsV5, CancelOrderParamsV5, CancelRFQParamsV5, CancelRFQQuoteItemV5, @@ -126,6 +127,7 @@ import { ConvertHistoryRecordV5, ConvertQuoteV5, ConvertStatusV5, + CorporateActionV5, CreateBorrowOrderFixedParamsV5, CreateBorrowOrderFixedV5, CreateP2PAdParamsV5, @@ -202,6 +204,7 @@ import { FixedLoanAvailableInventoryV5, FixedRateAvailableInventoryV5, FixedRateBorrowContractInfoV5, + FixedRateBorrowInterestAccruedV5, FixedRateBorrowOrderInfoV5, FixedRateBorrowParamsV5, FixedRateBorrowQuoteV5, @@ -279,6 +282,7 @@ import { GetCollateralCoinsParamsV5, GetCompletedLoanOrderHistoryParamsV5, GetConvertHistoryParamsV5, + GetCorporateActionsParamsV5, GetDeliveryPriceParamsV5, GetDeliveryRecordParamsV5, GetDepositRecordParamsV5, @@ -309,6 +313,7 @@ import { GetFixedLoanAvailableInventoryParamsV5, GetFixedRateAvailableInventoryParamsV5, GetFixedRateBorrowContractInfoParamsV5, + GetFixedRateBorrowInterestAccruedParamsV5, GetFixedRateBorrowOrderInfoParamsV5, GetFixedRateBorrowOrderQuoteParamsV5, GetFixedTermEarnOrderListParamsV5, @@ -1281,6 +1286,15 @@ export class RestClientV5 extends BaseRestClient { return this.get('/v5/market/option-base-coins', params); } + getCorporateActions(params?: GetCorporateActionsParamsV5): Promise< + APIResponseV3WithTime<{ + list: CorporateActionV5[]; + nextPageCursor: string; + }> + > { + return this.get('/v5/market/corporate-action', params); + } + /** * ****** Trade APIs @@ -3750,6 +3764,29 @@ export class RestClientV5 extends BaseRestClient { return this.postPrivate('/v5/spot-margin-trade/fixedborrow-renew', params); } + getFixedRateBorrowInterestAccrued( + params?: GetFixedRateBorrowInterestAccruedParamsV5, + ): Promise< + APIResponseV3WithTime<{ + list: FixedRateBorrowInterestAccruedV5[]; + nextPageCursor: string; + }> + > { + return this.getPrivate( + '/v5/spot-margin-trade/fixedborrow-interest-accrued', + params, + ); + } + + cancelFixedRateBorrowOrder( + params: CancelFixedRateBorrowOrderParamsV5, + ): Promise> { + return this.postPrivate( + '/v5/spot-margin-trade/fixedborrow-order-cancel', + params, + ); + } + getFlexibleAvailableInventory( params: GetFlexibleAvailableInventoryParamsV5, ): Promise> { diff --git a/src/types/request/v5-market.ts b/src/types/request/v5-market.ts index 0f032069..749636f2 100644 --- a/src/types/request/v5-market.ts +++ b/src/types/request/v5-market.ts @@ -204,3 +204,11 @@ export interface GetOptionBaseCoinsParamsV5 { */ underlyingType?: string; } + +export interface GetCorporateActionsParamsV5 { + category?: 'option'; + baseCoin?: string; + actionType?: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; + limit?: number; + cursor?: string; +} diff --git a/src/types/request/v5-spot-leverage-token.ts b/src/types/request/v5-spot-leverage-token.ts index f9de1dca..07f07aae 100644 --- a/src/types/request/v5-spot-leverage-token.ts +++ b/src/types/request/v5-spot-leverage-token.ts @@ -121,6 +121,17 @@ export interface RenewFixedRateBorrowParamsV5 { qty?: string; } +export interface GetFixedRateBorrowInterestAccruedParamsV5 { + orderId?: string; + orderCurrency?: string; + limit?: string; + cursor?: string; +} + +export interface CancelFixedRateBorrowOrderParamsV5 { + orderId: string; +} + export interface GetFlexibleAvailableInventoryParamsV5 { currency: string; } diff --git a/src/types/response/v5-market.ts b/src/types/response/v5-market.ts index 774c638c..4d51790e 100644 --- a/src/types/response/v5-market.ts +++ b/src/types/response/v5-market.ts @@ -538,3 +538,27 @@ export interface OptionBaseCoinV5 { export interface OptionBaseCoinsResultV5 { list: OptionBaseCoinV5[]; } + +export interface CorporateActionV5 { + category?: 'option'; + symbol: string; + baseCoin: string; + actionType: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; + status: string; + effectiveTime: number; + details: { + splitFactor?: string; + splitType?: 'FORWARD' | 'REVERSE'; + dividendAmountPerShare?: string; + dividendCurrency?: string; + installmentCount?: number; + installmentAmountPerShare?: string; + installmentCoin?: string; + firstSettlementTimeUtc?: number; + installments?: { + installmentNo: number; + settlementTimeUtc: number; + status: string; + }[]; + }; +} diff --git a/src/types/response/v5-spot-leverage-token.ts b/src/types/response/v5-spot-leverage-token.ts index 9012db64..811dade6 100644 --- a/src/types/response/v5-spot-leverage-token.ts +++ b/src/types/response/v5-spot-leverage-token.ts @@ -213,6 +213,16 @@ export interface FixedRateBorrowQuoteV5 { qty: string; } +export interface FixedRateBorrowInterestAccruedV5 { + refId: string; + currency: string; + orderId: string; + loanAmt: string; + interest: string; + interestRate: string; + ts: string; +} + export interface FlexibleAvailableInventoryV5 { currency: string; availableInventory: string; diff --git a/test/v5/market-spot-margin.test.ts b/test/v5/market-spot-margin.test.ts new file mode 100644 index 00000000..e82d5d32 --- /dev/null +++ b/test/v5/market-spot-margin.test.ts @@ -0,0 +1,200 @@ +import { AxiosAdapter } from 'axios'; + +import { RestClientV5 } from '../../src'; + +describe('Corporate actions and fixed-rate borrow endpoints', () => { + let api: RestClientV5; + let adapter: jest.MockedFunction; + let result: object; + + beforeEach(() => { + result = {}; + adapter = jest.fn(async (config) => ({ + config, + data: { + retCode: 0, + retMsg: 'OK', + result, + retExtInfo: {}, + time: 1792117143000, + }, + headers: {}, + status: 200, + statusText: 'OK', + })); + api = new RestClientV5( + { + testnet: true, + key: 'test-key-placeholder', + secret: 'test-secret-placeholder', + }, + { adapter }, + ); + }); + + it('queries corporate actions without credentials or filters', async () => { + result = { list: [], nextPageCursor: '' }; + const publicApi = new RestClientV5({ testnet: true }, { adapter }); + const response = await publicApi.getCorporateActions(); + + expect(response.result).toEqual(result); + expect(adapter).toHaveBeenCalledTimes(1); + expect(adapter.mock.calls[0][0]).toMatchObject({ + method: 'get', + url: 'https://api-testnet.bybit.com/v5/market/corporate-action', + }); + expect(adapter.mock.calls[0][0].headers['X-BAPI-SIGN']).toBeUndefined(); + }); + + it.each([ + { actionType: 'ForwardSplit' as const, splitType: 'FORWARD' }, + { actionType: 'ReverseSplit' as const, splitType: 'REVERSE' }, + ])( + 'passes $actionType filters and pagination and preserves split details', + async ({ actionType, splitType }) => { + result = { + list: [ + { + category: 'option', + symbol: 'AAPLUSDT', + baseCoin: 'AAPL', + actionType, + status: 'Completed', + effectiveTime: 1788278400000, + details: { splitFactor: '4', splitType }, + }, + ], + nextPageCursor: 'next-page', + }; + const params = { + category: 'option' as const, + baseCoin: 'AAPL', + actionType, + limit: 1, + cursor: 'previous-page', + }; + const response = await api.getCorporateActions(params); + + expect(adapter.mock.calls[0][0].params).toEqual(params); + expect(response.result).toEqual(result); + expect(response.result.list[0].details.splitFactor).toBe('4'); + }, + ); + + it('preserves dividend installment details and numeric timestamps', async () => { + result = { + list: [ + { + symbol: 'AAPLUSDT', + baseCoin: 'AAPL', + actionType: 'Dividend', + status: 'Announced', + effectiveTime: 1788278400000, + details: { + dividendAmountPerShare: '0.25', + dividendCurrency: 'USD', + installmentCount: 4, + installmentAmountPerShare: '5.00000', + installmentCoin: 'USDT', + firstSettlementTimeUtc: 1788134400000, + installments: [ + { + installmentNo: 1, + settlementTimeUtc: 1788134400000, + status: 'SUCCESS', + }, + ], + }, + }, + ], + nextPageCursor: '', + }; + const response = await api.getCorporateActions({ actionType: 'Dividend' }); + + expect(response.result).toEqual(result); + expect(response.result.list[0].details.installments?.[0]).toEqual({ + installmentNo: 1, + settlementTimeUtc: 1788134400000, + status: 'SUCCESS', + }); + }); + + it('queries penalty interest without filters using a signed GET', async () => { + result = { list: [], nextPageCursor: '' }; + const response = await api.getFixedRateBorrowInterestAccrued(); + + expect(response.result).toEqual(result); + expect(adapter.mock.calls[0][0]).toMatchObject({ + method: 'get', + url: 'https://api-testnet.bybit.com/v5/spot-margin-trade/fixedborrow-interest-accrued', + }); + expect(adapter.mock.calls[0][0].headers['X-BAPI-SIGN']).toEqual( + expect.any(String), + ); + }); + + it('serializes penalty interest filters and cursor and preserves decimal strings', async () => { + result = { + list: [ + { + refId: '26', + currency: 'USDT', + orderId: 'FIXED_BORROW_example', + loanAmt: '6.019203532535780822', + interest: '0.000206137107278623', + interestRate: '0.30', + ts: '1792117143000', + }, + ], + nextPageCursor: 'next-page', + }; + const response = await api.getFixedRateBorrowInterestAccrued({ + orderId: 'FIXED_BORROW_example', + orderCurrency: 'USDT', + limit: '10', + cursor: 'cursor+=/', + }); + + const request = adapter.mock.calls[0][0]; + const url = new URL(request.url!); + expect(Object.fromEntries(url.searchParams)).toEqual({ + orderId: 'FIXED_BORROW_example', + orderCurrency: 'USDT', + limit: '10', + cursor: 'cursor+=/', + }); + expect(response.result).toEqual(result); + expect(response.result.list[0].interest).toBe('0.000206137107278623'); + }); + + it('sends a signed cancellation POST and returns the empty result', async () => { + const response = await api.cancelFixedRateBorrowOrder({ + orderId: 'FIXED_BORROW_example', + }); + + const request = adapter.mock.calls[0][0]; + expect(request).toMatchObject({ + method: 'post', + url: 'https://api-testnet.bybit.com/v5/spot-margin-trade/fixedborrow-order-cancel', + }); + expect(JSON.parse(request.data)).toEqual({ + orderId: 'FIXED_BORROW_example', + }); + expect(request.headers['X-BAPI-SIGN']).toEqual(expect.any(String)); + expect(response.retCode).toBe(0); + expect(response.result).toEqual({}); + expect(adapter).toHaveBeenCalledTimes(1); + }); + + it('requires credentials for both private endpoints', async () => { + const publicApi = new RestClientV5({ testnet: true }, { adapter }); + + await expect(publicApi.getFixedRateBorrowInterestAccrued()).rejects.toThrow( + 'Private endpoints require api and private keys set', + ); + await expect( + publicApi.cancelFixedRateBorrowOrder({ orderId: 'FIXED_BORROW_example' }), + ).rejects.toThrow('Private endpoints require api and private keys set'); + expect(adapter).not.toHaveBeenCalled(); + }); +}); From 1b84978f47b1cf9ddc07a48dc15856299614a1d8 Mon Sep 17 00:00:00 2001 From: JJ-Cro sync bot Date: Mon, 2 Nov 2026 11:33:28 +0100 Subject: [PATCH 2/9] chore: regenerate endpoint docs and examples --- docs/endpointFunctionList.md | 855 ++++---- llms.txt | 3877 +++++++++++++++++----------------- 2 files changed, 2409 insertions(+), 2323 deletions(-) diff --git a/docs/endpointFunctionList.md b/docs/endpointFunctionList.md index 9c25affb..bbbc47e8 100644 --- a/docs/endpointFunctionList.md +++ b/docs/endpointFunctionList.md @@ -49,432 +49,435 @@ This table includes all endpoints from the official Exchange API docs and corres | Function | AUTH | HTTP Method | Endpoint | | -------- | :------: | :------: | -------- | -| [getSystemStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L730) | :closed_lock_with_key: | GET | `/v5/system/status` | -| [getServerTime()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L747) | | GET | `/v5/market/time` | -| [requestDemoTradingFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L759) | :closed_lock_with_key: | POST | `/v5/account/demo-apply-money` | -| [createDemoAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L772) | :closed_lock_with_key: | POST | `/v5/user/create-demo-member` | -| [getSpreadInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L785) | | GET | `/v5/spread/instrument` | -| [getSpreadOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L797) | | GET | `/v5/spread/orderbook` | -| [getSpreadTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L807) | | GET | `/v5/spread/tickers` | -| [getSpreadRecentTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L818) | | GET | `/v5/spread/recent-trade` | -| [getSpreadMaxQty()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L830) | :closed_lock_with_key: | GET | `/v5/spread/max-qty` | -| [submitSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L839) | :closed_lock_with_key: | POST | `/v5/spread/order/create` | -| [amendSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L852) | :closed_lock_with_key: | POST | `/v5/spread/order/amend` | -| [cancelSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L864) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel` | -| [cancelAllSpreadOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L882) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel-all` | -| [getSpreadOpenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L901) | :closed_lock_with_key: | GET | `/v5/spread/order/realtime` | -| [getSpreadOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L918) | :closed_lock_with_key: | GET | `/v5/spread/order/history` | -| [getSpreadTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L934) | :closed_lock_with_key: | GET | `/v5/spread/execution/list` | -| [getKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L954) | | GET | `/v5/market/kline` | -| [getMarkPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L971) | | GET | `/v5/market/mark-price-kline` | -| [getIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L986) | | GET | `/v5/market/index-price-kline` | -| [getPremiumIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1001) | | GET | `/v5/market/premium-index-price-kline` | -| [getInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1017) | | GET | `/v5/market/instruments-info` | -| [getInstrumentSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1031) | | GET | `/v5/market/instrument-summary` | -| [getOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1042) | | GET | `/v5/market/orderbook` | -| [getFullDepthOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1048) | | GET | `/v5/market/full_orderbook` | -| [getRPIOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1062) | | GET | `/v5/market/rpi_orderbook` | -| [getTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1068) | | GET | `/v5/market/tickers` | -| [getFundingRateHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1106) | | GET | `/v5/market/funding/history` | -| [getPublicTradingHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1121) | | GET | `/v5/market/recent-trade` | -| [getOpenInterest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1134) | | GET | `/v5/market/open-interest` | -| [getHistoricalVolatility()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1144) | | GET | `/v5/market/historical-volatility` | -| [getInsurance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1155) | | GET | `/v5/market/insurance` | -| [getRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1166) | | GET | `/v5/market/risk-limit` | -| [getOptionDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1181) | | GET | `/v5/market/delivery-price` | -| [getDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1194) | | GET | `/v5/market/delivery-price` | -| [getNewDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1210) | | GET | `/v5/market/new-delivery-price` | -| [getLongShortRatio()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1226) | | GET | `/v5/market/account-ratio` | -| [getIndexPriceComponents()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1236) | | GET | `/v5/market/index-price-components` | -| [getOrderPriceLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1242) | | GET | `/v5/market/price-limit` | -| [getADLAlert()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1256) | | GET | `/v5/market/adlAlert` | -| [getFeeGroupStructure()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1269) | | GET | `/v5/market/fee-group-info` | -| [getOptionBaseCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1278) | | GET | `/v5/market/option-base-coins` | -| [submitOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1290) | :closed_lock_with_key: | POST | `/v5/order/create` | -| [amendOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1296) | :closed_lock_with_key: | POST | `/v5/order/amend` | -| [cancelOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1302) | :closed_lock_with_key: | POST | `/v5/order/cancel` | -| [getActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1311) | :closed_lock_with_key: | GET | `/v5/order/realtime` | -| [cancelAllOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1317) | :closed_lock_with_key: | POST | `/v5/order/cancel-all` | -| [getHistoricOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1330) | :closed_lock_with_key: | GET | `/v5/order/history` | -| [getExecutionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1342) | :closed_lock_with_key: | GET | `/v5/execution/list` | -| [batchSubmitOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1360) | :closed_lock_with_key: | POST | `/v5/order/create-batch` | -| [batchAmendOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1385) | :closed_lock_with_key: | POST | `/v5/order/amend-batch` | -| [batchCancelOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1410) | :closed_lock_with_key: | POST | `/v5/order/cancel-batch` | -| [getSpotBorrowCheck()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1432) | :closed_lock_with_key: | GET | `/v5/order/spot-borrow-check` | -| [setDisconnectCancelAllWindow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1453) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | -| [setDisconnectCancelAllWindowV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1471) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | -| [preCheckOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1486) | :closed_lock_with_key: | POST | `/v5/order/pre-check` | -| [createStrategyOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1503) | :closed_lock_with_key: | POST | `/v5/strategy/create` | -| [getStrategyList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1514) | :closed_lock_with_key: | GET | `/v5/strategy/list` | -| [getStrategyOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1525) | :closed_lock_with_key: | GET | `/v5/strategy/order-list` | -| [stopStrategy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1536) | :closed_lock_with_key: | POST | `/v5/strategy/stop` | -| [getPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1561) | :closed_lock_with_key: | GET | `/v5/position/list` | -| [getFuturesLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1573) | :closed_lock_with_key: | GET | `/v5/position/symbol-info` | -| [setLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1588) | :closed_lock_with_key: | POST | `/v5/position/set-leverage` | -| [switchIsolatedMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1601) | :closed_lock_with_key: | POST | `/v5/position/switch-isolated` | -| [setTPSLMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1615) | :closed_lock_with_key: | POST | `/v5/position/set-tpsl-mode` | -| [switchPositionMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1630) | :closed_lock_with_key: | POST | `/v5/position/switch-mode` | -| [setRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1644) | :closed_lock_with_key: | POST | `/v5/position/set-risk-limit` | -| [setTradingStop()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1659) | :closed_lock_with_key: | POST | `/v5/position/trading-stop` | -| [setAutoAddMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1670) | :closed_lock_with_key: | POST | `/v5/position/set-auto-add-margin` | -| [addOrReduceMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1682) | :closed_lock_with_key: | POST | `/v5/position/add-margin` | -| [getClosedPnL()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1694) | :closed_lock_with_key: | GET | `/v5/position/closed-pnl` | -| [getClosedOptionsPositions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1708) | :closed_lock_with_key: | GET | `/v5/position/get-closed-positions` | -| [movePosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1733) | :closed_lock_with_key: | POST | `/v5/position/move-positions` | -| [getMovePositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1744) | :closed_lock_with_key: | GET | `/v5/position/move-history` | -| [confirmNewRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1763) | :closed_lock_with_key: | POST | `/v5/position/confirm-pending-mmr` | -| [getPreUpgradeOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1783) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/order/history` | -| [getPreUpgradeTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1798) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/execution/list` | -| [getPreUpgradeClosedPnl()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1809) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/position/closed-pnl` | -| [getPreUpgradeTransactions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1823) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/account/transaction-log` | -| [getPreUpgradeOptionDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1840) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/delivery-record` | -| [getPreUpgradeUSDCSessionSettlements()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1854) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/settlement-record` | -| [getWalletBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1875) | :closed_lock_with_key: | GET | `/v5/account/wallet-balance` | -| [getTransferableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1886) | :closed_lock_with_key: | GET | `/v5/account/withdrawal` | -| [getAccountInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1903) | :closed_lock_with_key: | GET | `/v5/account/instruments-info` | -| [upgradeToUnifiedAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1914) | :closed_lock_with_key: | POST | `/v5/account/upgrade-to-uta` | -| [getBorrowHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1925) | :closed_lock_with_key: | GET | `/v5/account/borrow-history` | -| [repayLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1946) | :closed_lock_with_key: | POST | `/v5/account/quick-repayment` | -| [manualRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1971) | :closed_lock_with_key: | POST | `/v5/account/repay` | -| [setCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1980) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch` | -| [batchSetCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1986) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch-batch` | -| [getCollateralInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1996) | :closed_lock_with_key: | GET | `/v5/account/collateral-info` | -| [getCoinGreeks()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2005) | :closed_lock_with_key: | GET | `/v5/asset/coin-greeks` | -| [getFeeRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2018) | :closed_lock_with_key: | GET | `/v5/account/fee-rate` | -| [getAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2027) | :closed_lock_with_key: | GET | `/v5/account/info` | -| [getDCPInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2040) | :closed_lock_with_key: | GET | `/v5/account/query-dcp-info` | -| [getTransactionLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2047) | :closed_lock_with_key: | GET | `/v5/account/transaction-log` | -| [getClassicTransactionLogs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2058) | :closed_lock_with_key: | GET | `/v5/account/contract-transaction-log` | -| [getSMPGroup()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2069) | :closed_lock_with_key: | GET | `/v5/account/smp-group` | -| [setMarginMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2082) | :closed_lock_with_key: | POST | `/v5/account/set-margin-mode` | -| [setSpotHedging()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2099) | :closed_lock_with_key: | POST | `/v5/account/set-hedging-mode` | -| [setLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2112) | :closed_lock_with_key: | POST | `/v5/account/set-limit-px-action` | -| [getLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2123) | :closed_lock_with_key: | GET | `/v5/account/user-setting-config` | -| [setDeltaNeutralMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2131) | :closed_lock_with_key: | POST | `/v5/account/set-delta-mode` | -| [setMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2140) | :closed_lock_with_key: | POST | `/v5/account/mmp-modify` | -| [resetMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2147) | :closed_lock_with_key: | POST | `/v5/account/mmp-reset` | -| [getMMPState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2154) | :closed_lock_with_key: | GET | `/v5/account/mmp-state` | -| [getOptionAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2164) | :closed_lock_with_key: | GET | `/v5/account/option-asset-info` | -| [getPayInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2174) | :closed_lock_with_key: | GET | `/v5/account/pay-info` | -| [getTradeInfoForAnalysis()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2184) | :closed_lock_with_key: | GET | `/v5/account/trade-info-for-analysis` | -| [getAssetOverview()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2204) | :closed_lock_with_key: | GET | `/v5/asset/asset-overview` | -| [getPortfolioMarginInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2214) | :closed_lock_with_key: | GET | `/v5/asset/portfolio-margin` | -| [getTotalMembersAssets()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2224) | :closed_lock_with_key: | GET | `/v5/asset/total-members-assets` | -| [getFundingAccountTransactionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2236) | :closed_lock_with_key: | GET | `/v5/asset/fundinghistory` | -| [getDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2252) | :closed_lock_with_key: | GET | `/v5/asset/delivery-record` | -| [getSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2263) | :closed_lock_with_key: | GET | `/v5/asset/settlement-record` | -| [getCoinExchangeRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2276) | :closed_lock_with_key: | GET | `/v5/asset/exchange/order-record` | -| [getCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2291) | :closed_lock_with_key: | GET | `/v5/asset/coin/query-info` | -| [getSubUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2305) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-sub-member-list` | -| [getAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2320) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-asset-info` | -| [getAllCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2331) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | -| [getCoinBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2345) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coin-balance` | -| [getWithdrawableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2359) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/withdrawable-amount` | -| [getTransferableCoinList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2368) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-transfer-coin-list` | -| [createInternalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2384) | :closed_lock_with_key: | POST | `/v5/asset/transfer/inter-transfer` | -| [getInternalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2403) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-inter-transfer-list` | -| [enableUniversalTransferForSubUIDs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2423) | :closed_lock_with_key: | POST | `/v5/asset/transfer/save-transfer-sub-member` | -| [createUniversalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2434) | :closed_lock_with_key: | POST | `/v5/asset/transfer/universal-transfer` | -| [getUniversalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2446) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-universal-transfer-list` | -| [getAllowedDepositCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2459) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-allowed-list` | -| [setDepositAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2474) | :closed_lock_with_key: | POST | `/v5/asset/deposit/deposit-to-account` | -| [getDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2490) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-record` | -| [getSubAccountDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2505) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-record` | -| [getInternalDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2521) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-internal-record` | -| [getMasterDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2533) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-address` | -| [getSubDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2551) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | -| [querySubMemberAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2576) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | -| [getWithdrawalRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2596) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-record` | -| [getWithdrawalAddressList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2608) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-address` | -| [getExchangeEntities()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2622) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/vasp/list` | -| [submitDepositOriginatorInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2632) | :closed_lock_with_key: | POST | `/v5/asset/travel-rule/deposit/submit` | -| [submitWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2647) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/create` | -| [cancelWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2658) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/cancel` | -| [getConvertCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2667) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-coin-list` | -| [requestConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2678) | :closed_lock_with_key: | POST | `/v5/asset/exchange/quote-apply` | -| [confirmConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2687) | :closed_lock_with_key: | POST | `/v5/asset/exchange/convert-execute` | -| [getConvertStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2699) | :closed_lock_with_key: | GET | `/v5/asset/exchange/convert-result-query` | -| [getConvertHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2718) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-convert-history` | -| [getSmallBalanceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2735) | :closed_lock_with_key: | GET | `/v5/asset/covert/small-balance-list` | -| [getFiatTradingPairList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2749) | :closed_lock_with_key: | GET | `/v5/fiat/query-coin-list` | -| [createSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2767) | :closed_lock_with_key: | POST | `/v5/user/create-sub-member` | -| [createSubUIDAPIKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2779) | :closed_lock_with_key: | POST | `/v5/user/create-sub-api` | -| [getSubUIDList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2788) | :closed_lock_with_key: | GET | `/v5/user/query-sub-members` | -| [getSubUIDListUnlimited()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2797) | :closed_lock_with_key: | GET | `/v5/user/submembers` | -| [setSubUIDFrozenState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2815) | :closed_lock_with_key: | POST | `/v5/user/frozen-sub-member` | -| [getQueryApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2830) | :closed_lock_with_key: | GET | `/v5/user/query-api` | -| [getSubAccountAllApiKeys()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2837) | :closed_lock_with_key: | GET | `/v5/user/sub-apikeys` | -| [getUIDWalletType()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2846) | :closed_lock_with_key: | GET | `/v5/user/get-member-type` | -| [updateMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2865) | :closed_lock_with_key: | POST | `/v5/user/update-api` | -| [updateSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2879) | :closed_lock_with_key: | POST | `/v5/user/update-sub-api` | -| [deleteSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2892) | :closed_lock_with_key: | POST | `/v5/user/del-submember` | -| [deleteMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2907) | :closed_lock_with_key: | POST | `/v5/user/delete-api` | -| [deleteSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2921) | :closed_lock_with_key: | POST | `/v5/user/delete-sub-api` | -| [createTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2936) | :closed_lock_with_key: | POST | `/v5/fht/compliance/tax/private/batch_create` | -| [getTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2948) | :closed_lock_with_key: | GET | `/v5/fht/compliance/tax/private/batch_query` | -| [getAffiliateUserList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2971) | :closed_lock_with_key: | GET | `/v5/affiliate/aff-user-list` | -| [getAffiliateSubAffiliateList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2989) | :closed_lock_with_key: | GET | `/v5/affiliate/affiliate-sub-list` | -| [getAffiliateUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3005) | :closed_lock_with_key: | GET | `/v5/user/aff-customer-info` | -| [getFriendReferrals()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3017) | :closed_lock_with_key: | GET | `/v5/user/invitation/referrals` | -| [getReferralCode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3026) | :closed_lock_with_key: | GET | `/v5/user/invitation/code` | -| [getReferralCommissionRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3038) | :closed_lock_with_key: | POST | `/v5/referral/commission/records` | -| [getReferralCampaignRewards()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3051) | :closed_lock_with_key: | POST | `/v5/referral/campaign/rewards` | -| [getReferralUserIdentityProfile()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3066) | :closed_lock_with_key: | POST | `/v5/referral/user/identity-profile` | -| [getReferralUserInvitations()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3079) | :closed_lock_with_key: | POST | `/v5/referral/user/invitations` | -| [signAgreement()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3097) | :closed_lock_with_key: | POST | `/v5/user/agreement` | -| [getAlphaTradeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3114) | :closed_lock_with_key: | POST | `/v5/alpha/trade/quote` | -| [executeAlphaTradePurchase()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3125) | :closed_lock_with_key: | POST | `/v5/alpha/trade/purchase` | -| [executeAlphaTradeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3136) | :closed_lock_with_key: | POST | `/v5/alpha/trade/redeem` | -| [getAlphaPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3146) | :closed_lock_with_key: | POST | `/v5/alpha/trade/pay-token-list` | -| [getAlphaTradeOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3156) | :closed_lock_with_key: | POST | `/v5/alpha/trade/order-list` | -| [getAlphaBizTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3166) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-list` | -| [getAlphaBizTokenPriceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3176) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-price-list` | -| [getAlphaBizTokenDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3186) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-details` | -| [getAlphaAssetList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3196) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-list` | -| [getAlphaAssetDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3204) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-detail` | -| [getAlphaPredictionEngineStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3220) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/engine-status` | -| [getAlphaPredictionPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3230) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/pay-token-list` | -| [getAlphaPredictionEventDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3240) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/event-detail` | -| [getAlphaPredictionOrderEstimate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3250) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-estimate` | -| [executeAlphaPredictionBuy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3260) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/buy` | -| [executeAlphaPredictionSell()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3270) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sell` | -| [getAlphaPredictionOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3280) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-list` | -| [getAlphaPredictionOrderBook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3290) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-book` | -| [getAlphaPredictionTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3300) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/token-price` | -| [getAlphaPredictionPriceHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3310) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/price-history` | -| [getAlphaPredictionPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3320) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-list` | -| [getAlphaPredictionPositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3330) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-history` | -| [getAlphaPredictionPortfolioSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3340) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/portfolio-summary` | -| [getAlphaPredictionSideMarketList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3350) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/side-market-list` | -| [getAlphaPredictionSportsMatchList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3360) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/match-list` | -| [getAlphaPredictionSportsTimelineStages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3370) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/sports/timeline-stages` | -| [getAlphaPredictionSportsGroupStageDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3383) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/group-stage-detail` | -| [getAlphaLPPoolList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3402) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-list` | -| [getAlphaLPPoolInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3412) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-info` | -| [executeAlphaLPStake()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3422) | :closed_lock_with_key: | POST | `/v5/alpha/lp/stake` | -| [executeAlphaLPRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3432) | :closed_lock_with_key: | POST | `/v5/alpha/lp/redeem` | -| [getAlphaLPOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3442) | :closed_lock_with_key: | POST | `/v5/alpha/lp/order-list` | -| [getAlphaLPPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3452) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-list` | -| [getAlphaLPPayTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3462) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-price` | -| [getAlphaLPPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3472) | :closed_lock_with_key: | POST | `/v5/alpha/lp/position-list` | -| [getVIPMarginData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3492) | | GET | `/v5/spot-margin-trade/data` | -| [getHistoricalInterestRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3503) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/interest-rate-history` | -| [getSpotMarginCurrencyData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3528) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/currency-data` | -| [toggleSpotMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3540) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/switch-mode` | -| [setSpotMarginLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3551) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | -| [setSpotMarginLeverageV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3559) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | -| [getSpotMarginState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3570) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/state` | -| [manualBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3577) | :closed_lock_with_key: | POST | `/v5/account/borrow` | -| [getMaxBorrowableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3592) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/max-borrowable` | -| [getPositionTiers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3601) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/position-tiers` | -| [getCoinState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3612) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/coinstate` | -| [getAvailableAmountToRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3623) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/repayment-available-amount` | -| [manualRepayWithoutConversion()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3642) | :closed_lock_with_key: | POST | `/v5/account/no-convert-repay` | -| [getAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3655) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-auto-repay-mode` | -| [setAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3671) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-auto-repay-mode` | -| [getSpotMarginLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3683) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/liability` | -| [submitFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3692) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow` | -| [getFixedRateBorrowOrderInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3701) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-info` | -| [getFixedRateBorrowContractInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3718) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-contract-info` | -| [getFixedRateBorrowOrderQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3735) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-quote` | -| [renewFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3747) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-renew` | -| [getFlexibleAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3753) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/flexible-available-inventory` | -| [getFixedRateAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3762) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixed-available-inventory` | -| [getSpotMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3780) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/pledge-token` | -| [getSpotMarginBorrowableCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3797) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/borrow-token` | -| [getSpotMarginInterestAndQuota()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3814) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/loan-info` | -| [getSpotMarginLoanAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3832) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/account` | -| [spotMarginBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3856) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/loan` | -| [spotMarginRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3867) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/repay` | -| [getSpotMarginBorrowOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3882) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/orders` | -| [getSpotMarginRepaymentOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3911) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/repay-history` | -| [toggleSpotCrossMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3940) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/switch` | -| [getCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3960) | | GET | `/v5/crypto-loan/collateral-data` | -| [getBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3977) | | GET | `/v5/crypto-loan/loanable-data` | -| [getAccountBorrowCollateralLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3995) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrowable-collateralisable-number` | -| [borrowCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4015) | :closed_lock_with_key: | POST | `/v5/crypto-loan/borrow` | -| [repayCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4036) | :closed_lock_with_key: | POST | `/v5/crypto-loan/repay` | -| [getUnpaidLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4052) | :closed_lock_with_key: | GET | `/v5/crypto-loan/ongoing-orders` | -| [getRepaymentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4073) | :closed_lock_with_key: | GET | `/v5/crypto-loan/repayment-history` | -| [getCompletedLoanOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4093) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrow-history` | -| [getMaxAllowedReductionCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4112) | :closed_lock_with_key: | GET | `/v5/crypto-loan/max-collateral-amount` | -| [adjustCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4131) | :closed_lock_with_key: | POST | `/v5/crypto-loan/adjust-ltv` | -| [getLoanLTVAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4155) | :closed_lock_with_key: | GET | `/v5/crypto-loan/adjustment-history` | -| [getLoanBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4176) | | GET | `/v5/crypto-loan-common/loanable-data` | -| [getLoanCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4188) | | GET | `/v5/crypto-loan-common/collateral-data` | -| [getMaxCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4198) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/max-collateral-amount` | -| [getMaxLoanAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4217) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/max-loan` | -| [updateCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4227) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/adjust-ltv` | -| [getCollateralAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4238) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/adjustment-history` | -| [getCryptoLoanPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4253) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/position` | -| [borrowFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4270) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/borrow` | -| [repayFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4281) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay` | -| [repayCollateralFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4291) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | -| [getOngoingFlexibleLoans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4305) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/ongoing-coin` | -| [getBorrowHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4317) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/borrow-history` | -| [getRepaymentHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4330) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/repayment-history` | -| [getFlexibleLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4344) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/available-inventory` | -| [getSupplyOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4364) | | GET | `/v5/crypto-loan-fixed/supply-order-quote` | -| [getBorrowOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4377) | | GET | `/v5/crypto-loan-fixed/borrow-order-quote` | -| [createBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4390) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow` | -| [createSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4403) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply` | -| [cancelBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4413) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow-order-cancel` | -| [cancelSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4427) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply-order-cancel` | -| [getBorrowContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4440) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-contract-info` | -| [getSupplyContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4458) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-contract-info` | -| [getBorrowOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4476) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-order-info` | -| [getSupplyOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4489) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-order-info` | -| [repayFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4503) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/fully-repay` | -| [repayCollateralFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4514) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | -| [getRepaymentHistoryFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4527) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/repayment-history` | -| [renewBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4544) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/renew` | -| [getRenewOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4557) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/renew-info` | -| [getFixedLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4566) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/available-inventory` | -| [getInstitutionalLendingProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4581) | | GET | `/v5/ins-loan/product-infos` | -| [getInstitutionalLendingCoinDeltaAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4593) | :closed_lock_with_key: | GET | `/v5/ins-loan/coin-delta-amount` | -| [getInstitutionalLendingDelayLiquidationStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4602) | :closed_lock_with_key: | GET | `/v5/ins-loan/delay-liq-status` | -| [getInstitutionalLendingMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4612) | | GET | `/v5/ins-loan/ensure-tokens` | -| [getInstitutionalLendingMarginCoinInfoWithConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4621) | | GET | `/v5/ins-loan/ensure-tokens-convert` | -| [getInstitutionalLendingLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4630) | :closed_lock_with_key: | GET | `/v5/ins-loan/loan-order` | -| [getInstitutionalLendingRepayOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4642) | :closed_lock_with_key: | GET | `/v5/ins-loan/repaid-history` | -| [getInstitutionalLendingLTV()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4654) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv` | -| [getInstitutionalLendingLTVWithLadderConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4663) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv-convert` | -| [bindOrUnbindUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4678) | :closed_lock_with_key: | POST | `/v5/ins-loan/association-uid` | -| [repayInstitutionalLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4698) | :closed_lock_with_key: | POST | `/v5/ins-loan/repay-loan` | -| [getExchangeBrokerEarnings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4719) | :closed_lock_with_key: | GET | `/v5/broker/earnings-info` | -| [getExchangeBrokerAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4732) | :closed_lock_with_key: | GET | `/v5/broker/account-info` | -| [getBrokerSubAccountDeposits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4748) | :closed_lock_with_key: | GET | `/v5/broker/asset/query-sub-member-deposit-record` | -| [getBrokerVoucherSpec()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4763) | :closed_lock_with_key: | POST | `/v5/broker/award/info` | -| [issueBrokerVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4775) | :closed_lock_with_key: | POST | `/v5/broker/award/distribute-award` | -| [getBrokerIssuedVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4787) | :closed_lock_with_key: | POST | `/v5/broker/award/distribution-record` | -| [setBrokerRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4804) | :closed_lock_with_key: | POST | `/v5/broker/apilimit/set` | -| [getBrokerRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4823) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-cap` | -| [getAllBrokerRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4841) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-all` | -| [getEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4861) | | GET | `/v5/earn/product` | -| [getFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4872) | :closed_lock_with_key: | GET | `/v5/earn/flexible-saving/auto-savings` | -| [setFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4883) | :closed_lock_with_key: | POST | `/v5/earn/flexible-saving/auto-savings` | -| [getEarnCouponList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4893) | :closed_lock_with_key: | GET | `/v5/earn/coupons` | -| [getRWAProductList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4903) | | GET | `/v5/earn/rwa/product` | -| [placeRWAOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4913) | :closed_lock_with_key: | POST | `/v5/earn/rwa/place-order` | -| [getRWAPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4922) | :closed_lock_with_key: | GET | `/v5/earn/rwa/position` | -| [getRWAOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4931) | :closed_lock_with_key: | GET | `/v5/earn/rwa/order` | -| [getRWANavChart()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4941) | | GET | `/v5/earn/rwa/nav-chart` | -| [getHoldToEarnAirdropProducts()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4952) | | GET | `/v5/earn/hold-to-earn/product` | -| [getAdvanceEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4963) | | GET | `/v5/earn/advance/product` | -| [getLiquidityMiningProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4974) | | GET | `/v5/earn/liquidity-mining/product` | -| [reinvestLiquidityMining()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4987) | :closed_lock_with_key: | POST | `/v5/earn/liquidity-mining/reinvest` | -| [getFixedTermEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4998) | | GET | `/v5/earn/fixed-term/product` | -| [getAdvanceEarnProductExtraInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5010) | | GET | `/v5/earn/advance/product-extra-info` | -| [submitAdvanceEarnPlaceOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5021) | :closed_lock_with_key: | POST | `/v5/earn/advance/place-order` | -| [getAdvanceEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5032) | :closed_lock_with_key: | GET | `/v5/earn/advance/position` | -| [getAdvanceEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5043) | :closed_lock_with_key: | GET | `/v5/earn/advance/order` | -| [submitFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5054) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/place-order` | -| [redeemFixedTermEarn()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5065) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/redeem` | -| [getFixedTermEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5076) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/position` | -| [getFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5087) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/order` | -| [setFixedTermEarnAutoInvest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5098) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/position/auto-invest` | -| [submitStakeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5114) | :closed_lock_with_key: | POST | `/v5/earn/place-order` | -| [getEarnOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5133) | :closed_lock_with_key: | GET | `/v5/earn/order` | -| [getEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5151) | :closed_lock_with_key: | GET | `/v5/earn/position` | -| [modifyEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5164) | :closed_lock_with_key: | POST | `/v5/earn/position/modify` | -| [getEarnYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5177) | :closed_lock_with_key: | GET | `/v5/earn/yield` | -| [getHoldToEarnAirdropYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5191) | :closed_lock_with_key: | GET | `/v5/earn/hold-to-earn/yield-history` | -| [getEarnHourlyYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5202) | :closed_lock_with_key: | GET | `/v5/earn/hourly-yield` | -| [getEarnAprHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5216) | | GET | `/v5/earn/apr-history` | -| [getEarnTokenProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5226) | | GET | `/v5/earn/token/product` | -| [submitEarnTokenOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5235) | :closed_lock_with_key: | POST | `/v5/earn/token/place-order` | -| [getEarnTokenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5244) | :closed_lock_with_key: | GET | `/v5/earn/token/order` | -| [getEarnTokenPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5256) | :closed_lock_with_key: | GET | `/v5/earn/token/position` | -| [getEarnTokenDailyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5265) | :closed_lock_with_key: | GET | `/v5/earn/token/yield` | -| [getEarnTokenHourlyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5277) | :closed_lock_with_key: | GET | `/v5/earn/token/hourly-yield` | -| [getEarnTokenHistoryApr()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5289) | | GET | `/v5/earn/token/history-apr` | -| [getPwmInvestmentPlanList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5304) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/list` | -| [getPwmInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5313) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/detail` | -| [getPwmPendingInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5322) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/new-plan` | -| [claimPwmWithdrawableFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5331) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/claim` | -| [getPwmInvestmentPlanAssetTrend()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5340) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/asset-trend` | -| [getPwmFundHistoricalNav()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5349) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/fund-nav` | -| [subscribePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5358) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/subscribe` | -| [investMorePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5367) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/invest-more` | -| [redeemPwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5376) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/redeem` | -| [getPwmInvestmentPlanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5385) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/order` | -| [getPwmSubscribableProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5394) | | GET | `/v5/earn/pwm/customize-plan/product` | -| [createPwmCustomizeInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5403) | :closed_lock_with_key: | POST | `/v5/earn/pwm/customize-plan/create` | -| [getPwmAllFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5418) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-funds` | -| [settlePwmFundProfit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5427) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/settle-profit` | -| [createPwmFund()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5436) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-fund` | -| [createPwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5445) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-investment-plan` | -| [getPwmAssetManagerInvestmentPlans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5459) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/get-investment-plan` | -| [managePwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5471) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-investment-plan` | -| [getPwmAllFundOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5485) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-order` | -| [managePwmFundOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5494) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-order` | -| [createPwmFundSubAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5503) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-sub-account` | -| [pwmFundTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5515) | :closed_lock_with_key: | POST | `/v5/earn/pwm/fund-transfer` | -| [getPwmFundTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5524) | :closed_lock_with_key: | GET | `/v5/earn/pwm/query-fund-transfer-result` | -| [queryCardAssetRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5539) | :closed_lock_with_key: | POST | `/v5/card/transaction/query-asset-records` | -| [queryCardPointsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5548) | :closed_lock_with_key: | POST | `/v5/card/reward/points/balance` | -| [queryCardPointsRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5555) | :closed_lock_with_key: | POST | `/v5/card/reward/points/records` | -| [queryCardPointsTier()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5564) | :closed_lock_with_key: | POST | `/v5/card/reward/points/tier` | -| [queryCardMallItemList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5571) | :closed_lock_with_key: | POST | `/v5/card/reward/mall/item/list` | -| [queryCardPointCashbackDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5580) | :closed_lock_with_key: | POST | `/v5/card/reward/point/cashback/detail` | -| [createRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5596) | :closed_lock_with_key: | POST | `/v5/rfq/create-rfq` | -| [getRFQConfig()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5607) | :closed_lock_with_key: | GET | `/v5/rfq/config` | -| [cancelRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5616) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-rfq` | -| [cancelAllRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5626) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-rfq` | -| [createRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5635) | :closed_lock_with_key: | POST | `/v5/rfq/create-quote` | -| [executeRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5646) | :closed_lock_with_key: | POST | `/v5/rfq/execute-quote` | -| [cancelRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5657) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-quote` | -| [cancelAllRFQQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5667) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-quotes` | -| [getRFQRealtimeInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5681) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-realtime` | -| [getRFQHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5693) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-list` | -| [getRFQRealtimeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5707) | :closed_lock_with_key: | GET | `/v5/rfq/quote-realtime` | -| [getRFQHistoryQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5722) | :closed_lock_with_key: | GET | `/v5/rfq/quote-list` | -| [getRFQTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5735) | :closed_lock_with_key: | GET | `/v5/rfq/trade-list` | -| [getRFQPublicTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5748) | :closed_lock_with_key: | GET | `/v5/rfq/public-trades` | -| [acceptNonLPQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5764) | :closed_lock_with_key: | POST | `/v5/rfq/accept-other-quote` | -| [getRFQDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5770) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-detail-list` | -| [getP2PAccountCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5795) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | -| [getP2POnlineAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5812) | :closed_lock_with_key: | POST | `/v5/p2p/item/online` | -| [createP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5821) | :closed_lock_with_key: | POST | `/v5/p2p/item/create` | -| [cancelP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5830) | :closed_lock_with_key: | POST | `/v5/p2p/item/cancel` | -| [updateP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5844) | :closed_lock_with_key: | POST | `/v5/p2p/item/update` | -| [getP2PPersonalAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5854) | :closed_lock_with_key: | POST | `/v5/p2p/item/personal/list` | -| [getP2PAdDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5863) | :closed_lock_with_key: | POST | `/v5/p2p/item/info` | -| [getP2POrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5878) | :closed_lock_with_key: | POST | `/v5/p2p/order/simplifyList` | -| [getP2POrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5888) | :closed_lock_with_key: | POST | `/v5/p2p/order/info` | -| [getP2PPendingOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5897) | :closed_lock_with_key: | POST | `/v5/p2p/order/pending/simplifyList` | -| [markP2POrderAsPaid()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5906) | :closed_lock_with_key: | POST | `/v5/p2p/order/pay` | -| [releaseP2POrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5915) | :closed_lock_with_key: | POST | `/v5/p2p/order/finish` | -| [reviewP2PSellerCancelOrderApply()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5927) | :closed_lock_with_key: | POST | `/v5/p2p/order/buyer/examine/sellerCancelOrderApply` | -| [sendP2POrderMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5939) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/send` | -| [getP2PChatSessions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5954) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/list_v1` | -| [getP2PChatSessionId()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5964) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/getSessionId` | -| [sendP2PChatMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6000) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/send_v1` | -| [getP2PChatMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6012) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/listpage_v1` | -| [getP2POrderMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6021) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/listpage` | -| [getP2PUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6035) | :closed_lock_with_key: | POST | `/v5/p2p/user/personal/info` | -| [getP2PCounterpartyUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6042) | :closed_lock_with_key: | POST | `/v5/p2p/user/order/personal/info` | -| [getP2PUserPayments()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6051) | :closed_lock_with_key: | POST | `/v5/p2p/user/payment/list` | -| [setApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6071) | :closed_lock_with_key: | POST | `/v5/apilimit/set` | -| [queryApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6100) | :closed_lock_with_key: | GET | `/v5/apilimit/query` | -| [getRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6119) | :closed_lock_with_key: | GET | `/v5/apilimit/query-cap` | -| [getAllRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6138) | :closed_lock_with_key: | GET | `/v5/apilimit/query-all` | -| [getLaunchpoolProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6161) | | GET | `/v5/spot-x/launchpool/project/list` | -| [getLaunchpoolUserActivityLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6167) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/activity-log` | -| [getLaunchpoolCurrentStaking()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6173) | :closed_lock_with_key: | GET | `/v5/spot-x/launchpool/user/current-staking` | -| [getLaunchpoolUserHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6179) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/history` | -| [getPuzzleProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6185) | | GET | `/v5/spot-x/puzzle/project/list` | -| [getTokenSplashProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6191) | | GET | `/v5/spot-x/token-splash/project/list` | -| [getTokenSplashUserActivityParams()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6197) | :closed_lock_with_key: | GET | `/v5/spot-x/token-splash/user/activity-params` | -| [getEventInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6220) | | GET | `/v5/event/instruments-info` | -| [getEventOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6231) | | GET | `/v5/event/orderbook` | -| [getEventOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6242) | :closed_lock_with_key: | GET | `/v5/event/order-list` | -| [getEventActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6253) | :closed_lock_with_key: | GET | `/v5/event/order-realtime` | -| [getEventPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6264) | :closed_lock_with_key: | GET | `/v5/event/positions` | -| [getEventTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6275) | :closed_lock_with_key: | GET | `/v5/event/trades` | -| [getEventSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6286) | :closed_lock_with_key: | GET | `/v5/event/settlements` | -| [submitEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6297) | :closed_lock_with_key: | POST | `/v5/event/quotes` | -| [cancelEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6308) | :closed_lock_with_key: | POST | `/v5/event/cancel` | +| [getSystemStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L735) | :closed_lock_with_key: | GET | `/v5/system/status` | +| [getServerTime()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L752) | | GET | `/v5/market/time` | +| [requestDemoTradingFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L764) | :closed_lock_with_key: | POST | `/v5/account/demo-apply-money` | +| [createDemoAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L777) | :closed_lock_with_key: | POST | `/v5/user/create-demo-member` | +| [getSpreadInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L790) | | GET | `/v5/spread/instrument` | +| [getSpreadOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L802) | | GET | `/v5/spread/orderbook` | +| [getSpreadTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L812) | | GET | `/v5/spread/tickers` | +| [getSpreadRecentTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L823) | | GET | `/v5/spread/recent-trade` | +| [getSpreadMaxQty()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L835) | :closed_lock_with_key: | GET | `/v5/spread/max-qty` | +| [submitSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L844) | :closed_lock_with_key: | POST | `/v5/spread/order/create` | +| [amendSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L857) | :closed_lock_with_key: | POST | `/v5/spread/order/amend` | +| [cancelSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L869) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel` | +| [cancelAllSpreadOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L887) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel-all` | +| [getSpreadOpenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L906) | :closed_lock_with_key: | GET | `/v5/spread/order/realtime` | +| [getSpreadOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L923) | :closed_lock_with_key: | GET | `/v5/spread/order/history` | +| [getSpreadTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L939) | :closed_lock_with_key: | GET | `/v5/spread/execution/list` | +| [getKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L959) | | GET | `/v5/market/kline` | +| [getMarkPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L976) | | GET | `/v5/market/mark-price-kline` | +| [getIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L991) | | GET | `/v5/market/index-price-kline` | +| [getPremiumIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1006) | | GET | `/v5/market/premium-index-price-kline` | +| [getInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1022) | | GET | `/v5/market/instruments-info` | +| [getInstrumentSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1036) | | GET | `/v5/market/instrument-summary` | +| [getOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1047) | | GET | `/v5/market/orderbook` | +| [getFullDepthOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1053) | | GET | `/v5/market/full_orderbook` | +| [getRPIOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1067) | | GET | `/v5/market/rpi_orderbook` | +| [getTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1073) | | GET | `/v5/market/tickers` | +| [getFundingRateHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1111) | | GET | `/v5/market/funding/history` | +| [getPublicTradingHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1126) | | GET | `/v5/market/recent-trade` | +| [getOpenInterest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1139) | | GET | `/v5/market/open-interest` | +| [getHistoricalVolatility()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1149) | | GET | `/v5/market/historical-volatility` | +| [getInsurance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1160) | | GET | `/v5/market/insurance` | +| [getRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1171) | | GET | `/v5/market/risk-limit` | +| [getOptionDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1186) | | GET | `/v5/market/delivery-price` | +| [getDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1199) | | GET | `/v5/market/delivery-price` | +| [getNewDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1215) | | GET | `/v5/market/new-delivery-price` | +| [getLongShortRatio()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1231) | | GET | `/v5/market/account-ratio` | +| [getIndexPriceComponents()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1241) | | GET | `/v5/market/index-price-components` | +| [getOrderPriceLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1247) | | GET | `/v5/market/price-limit` | +| [getADLAlert()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1261) | | GET | `/v5/market/adlAlert` | +| [getFeeGroupStructure()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1274) | | GET | `/v5/market/fee-group-info` | +| [getOptionBaseCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1283) | | GET | `/v5/market/option-base-coins` | +| [getCorporateActions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1289) | | GET | `/v5/market/corporate-action` | +| [submitOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1304) | :closed_lock_with_key: | POST | `/v5/order/create` | +| [amendOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1310) | :closed_lock_with_key: | POST | `/v5/order/amend` | +| [cancelOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1316) | :closed_lock_with_key: | POST | `/v5/order/cancel` | +| [getActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1325) | :closed_lock_with_key: | GET | `/v5/order/realtime` | +| [cancelAllOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1331) | :closed_lock_with_key: | POST | `/v5/order/cancel-all` | +| [getHistoricOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1344) | :closed_lock_with_key: | GET | `/v5/order/history` | +| [getExecutionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1356) | :closed_lock_with_key: | GET | `/v5/execution/list` | +| [batchSubmitOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1374) | :closed_lock_with_key: | POST | `/v5/order/create-batch` | +| [batchAmendOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1399) | :closed_lock_with_key: | POST | `/v5/order/amend-batch` | +| [batchCancelOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1424) | :closed_lock_with_key: | POST | `/v5/order/cancel-batch` | +| [getSpotBorrowCheck()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1446) | :closed_lock_with_key: | GET | `/v5/order/spot-borrow-check` | +| [setDisconnectCancelAllWindow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1467) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | +| [setDisconnectCancelAllWindowV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1485) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | +| [preCheckOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1500) | :closed_lock_with_key: | POST | `/v5/order/pre-check` | +| [createStrategyOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1517) | :closed_lock_with_key: | POST | `/v5/strategy/create` | +| [getStrategyList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1528) | :closed_lock_with_key: | GET | `/v5/strategy/list` | +| [getStrategyOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1539) | :closed_lock_with_key: | GET | `/v5/strategy/order-list` | +| [stopStrategy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1550) | :closed_lock_with_key: | POST | `/v5/strategy/stop` | +| [getPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1575) | :closed_lock_with_key: | GET | `/v5/position/list` | +| [getFuturesLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1587) | :closed_lock_with_key: | GET | `/v5/position/symbol-info` | +| [setLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1602) | :closed_lock_with_key: | POST | `/v5/position/set-leverage` | +| [switchIsolatedMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1615) | :closed_lock_with_key: | POST | `/v5/position/switch-isolated` | +| [setTPSLMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1629) | :closed_lock_with_key: | POST | `/v5/position/set-tpsl-mode` | +| [switchPositionMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1644) | :closed_lock_with_key: | POST | `/v5/position/switch-mode` | +| [setRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1658) | :closed_lock_with_key: | POST | `/v5/position/set-risk-limit` | +| [setTradingStop()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1673) | :closed_lock_with_key: | POST | `/v5/position/trading-stop` | +| [setAutoAddMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1684) | :closed_lock_with_key: | POST | `/v5/position/set-auto-add-margin` | +| [addOrReduceMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1696) | :closed_lock_with_key: | POST | `/v5/position/add-margin` | +| [getClosedPnL()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1708) | :closed_lock_with_key: | GET | `/v5/position/closed-pnl` | +| [getClosedOptionsPositions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1722) | :closed_lock_with_key: | GET | `/v5/position/get-closed-positions` | +| [movePosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1747) | :closed_lock_with_key: | POST | `/v5/position/move-positions` | +| [getMovePositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1758) | :closed_lock_with_key: | GET | `/v5/position/move-history` | +| [confirmNewRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1777) | :closed_lock_with_key: | POST | `/v5/position/confirm-pending-mmr` | +| [getPreUpgradeOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1797) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/order/history` | +| [getPreUpgradeTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1812) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/execution/list` | +| [getPreUpgradeClosedPnl()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1823) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/position/closed-pnl` | +| [getPreUpgradeTransactions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1837) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/account/transaction-log` | +| [getPreUpgradeOptionDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1854) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/delivery-record` | +| [getPreUpgradeUSDCSessionSettlements()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1868) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/settlement-record` | +| [getWalletBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1889) | :closed_lock_with_key: | GET | `/v5/account/wallet-balance` | +| [getTransferableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1900) | :closed_lock_with_key: | GET | `/v5/account/withdrawal` | +| [getAccountInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1917) | :closed_lock_with_key: | GET | `/v5/account/instruments-info` | +| [upgradeToUnifiedAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1928) | :closed_lock_with_key: | POST | `/v5/account/upgrade-to-uta` | +| [getBorrowHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1939) | :closed_lock_with_key: | GET | `/v5/account/borrow-history` | +| [repayLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1960) | :closed_lock_with_key: | POST | `/v5/account/quick-repayment` | +| [manualRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1985) | :closed_lock_with_key: | POST | `/v5/account/repay` | +| [setCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1994) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch` | +| [batchSetCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2000) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch-batch` | +| [getCollateralInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2010) | :closed_lock_with_key: | GET | `/v5/account/collateral-info` | +| [getCoinGreeks()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2019) | :closed_lock_with_key: | GET | `/v5/asset/coin-greeks` | +| [getFeeRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2032) | :closed_lock_with_key: | GET | `/v5/account/fee-rate` | +| [getAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2041) | :closed_lock_with_key: | GET | `/v5/account/info` | +| [getDCPInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2054) | :closed_lock_with_key: | GET | `/v5/account/query-dcp-info` | +| [getTransactionLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2061) | :closed_lock_with_key: | GET | `/v5/account/transaction-log` | +| [getClassicTransactionLogs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2072) | :closed_lock_with_key: | GET | `/v5/account/contract-transaction-log` | +| [getSMPGroup()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2083) | :closed_lock_with_key: | GET | `/v5/account/smp-group` | +| [setMarginMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2096) | :closed_lock_with_key: | POST | `/v5/account/set-margin-mode` | +| [setSpotHedging()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2113) | :closed_lock_with_key: | POST | `/v5/account/set-hedging-mode` | +| [setLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2126) | :closed_lock_with_key: | POST | `/v5/account/set-limit-px-action` | +| [getLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2137) | :closed_lock_with_key: | GET | `/v5/account/user-setting-config` | +| [setDeltaNeutralMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2145) | :closed_lock_with_key: | POST | `/v5/account/set-delta-mode` | +| [setMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2154) | :closed_lock_with_key: | POST | `/v5/account/mmp-modify` | +| [resetMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2161) | :closed_lock_with_key: | POST | `/v5/account/mmp-reset` | +| [getMMPState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2168) | :closed_lock_with_key: | GET | `/v5/account/mmp-state` | +| [getOptionAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2178) | :closed_lock_with_key: | GET | `/v5/account/option-asset-info` | +| [getPayInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2188) | :closed_lock_with_key: | GET | `/v5/account/pay-info` | +| [getTradeInfoForAnalysis()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2198) | :closed_lock_with_key: | GET | `/v5/account/trade-info-for-analysis` | +| [getAssetOverview()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2218) | :closed_lock_with_key: | GET | `/v5/asset/asset-overview` | +| [getPortfolioMarginInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2228) | :closed_lock_with_key: | GET | `/v5/asset/portfolio-margin` | +| [getTotalMembersAssets()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2238) | :closed_lock_with_key: | GET | `/v5/asset/total-members-assets` | +| [getFundingAccountTransactionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2250) | :closed_lock_with_key: | GET | `/v5/asset/fundinghistory` | +| [getDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2266) | :closed_lock_with_key: | GET | `/v5/asset/delivery-record` | +| [getSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2277) | :closed_lock_with_key: | GET | `/v5/asset/settlement-record` | +| [getCoinExchangeRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2290) | :closed_lock_with_key: | GET | `/v5/asset/exchange/order-record` | +| [getCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2305) | :closed_lock_with_key: | GET | `/v5/asset/coin/query-info` | +| [getSubUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2319) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-sub-member-list` | +| [getAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2334) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-asset-info` | +| [getAllCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2345) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | +| [getCoinBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2359) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coin-balance` | +| [getWithdrawableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2373) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/withdrawable-amount` | +| [getTransferableCoinList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2382) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-transfer-coin-list` | +| [createInternalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2398) | :closed_lock_with_key: | POST | `/v5/asset/transfer/inter-transfer` | +| [getInternalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2417) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-inter-transfer-list` | +| [enableUniversalTransferForSubUIDs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2437) | :closed_lock_with_key: | POST | `/v5/asset/transfer/save-transfer-sub-member` | +| [createUniversalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2448) | :closed_lock_with_key: | POST | `/v5/asset/transfer/universal-transfer` | +| [getUniversalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2460) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-universal-transfer-list` | +| [getAllowedDepositCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2473) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-allowed-list` | +| [setDepositAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2488) | :closed_lock_with_key: | POST | `/v5/asset/deposit/deposit-to-account` | +| [getDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2504) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-record` | +| [getSubAccountDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2519) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-record` | +| [getInternalDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2535) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-internal-record` | +| [getMasterDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2547) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-address` | +| [getSubDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2565) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | +| [querySubMemberAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2590) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | +| [getWithdrawalRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2610) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-record` | +| [getWithdrawalAddressList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2622) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-address` | +| [getExchangeEntities()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2636) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/vasp/list` | +| [submitDepositOriginatorInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2646) | :closed_lock_with_key: | POST | `/v5/asset/travel-rule/deposit/submit` | +| [submitWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2661) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/create` | +| [cancelWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2672) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/cancel` | +| [getConvertCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2681) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-coin-list` | +| [requestConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2692) | :closed_lock_with_key: | POST | `/v5/asset/exchange/quote-apply` | +| [confirmConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2701) | :closed_lock_with_key: | POST | `/v5/asset/exchange/convert-execute` | +| [getConvertStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2713) | :closed_lock_with_key: | GET | `/v5/asset/exchange/convert-result-query` | +| [getConvertHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2732) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-convert-history` | +| [getSmallBalanceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2749) | :closed_lock_with_key: | GET | `/v5/asset/covert/small-balance-list` | +| [getFiatTradingPairList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2763) | :closed_lock_with_key: | GET | `/v5/fiat/query-coin-list` | +| [createSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2781) | :closed_lock_with_key: | POST | `/v5/user/create-sub-member` | +| [createSubUIDAPIKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2793) | :closed_lock_with_key: | POST | `/v5/user/create-sub-api` | +| [getSubUIDList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2802) | :closed_lock_with_key: | GET | `/v5/user/query-sub-members` | +| [getSubUIDListUnlimited()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2811) | :closed_lock_with_key: | GET | `/v5/user/submembers` | +| [setSubUIDFrozenState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2829) | :closed_lock_with_key: | POST | `/v5/user/frozen-sub-member` | +| [getQueryApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2844) | :closed_lock_with_key: | GET | `/v5/user/query-api` | +| [getSubAccountAllApiKeys()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2851) | :closed_lock_with_key: | GET | `/v5/user/sub-apikeys` | +| [getUIDWalletType()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2860) | :closed_lock_with_key: | GET | `/v5/user/get-member-type` | +| [updateMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2879) | :closed_lock_with_key: | POST | `/v5/user/update-api` | +| [updateSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2893) | :closed_lock_with_key: | POST | `/v5/user/update-sub-api` | +| [deleteSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2906) | :closed_lock_with_key: | POST | `/v5/user/del-submember` | +| [deleteMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2921) | :closed_lock_with_key: | POST | `/v5/user/delete-api` | +| [deleteSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2935) | :closed_lock_with_key: | POST | `/v5/user/delete-sub-api` | +| [createTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2950) | :closed_lock_with_key: | POST | `/v5/fht/compliance/tax/private/batch_create` | +| [getTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2962) | :closed_lock_with_key: | GET | `/v5/fht/compliance/tax/private/batch_query` | +| [getAffiliateUserList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2985) | :closed_lock_with_key: | GET | `/v5/affiliate/aff-user-list` | +| [getAffiliateSubAffiliateList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3003) | :closed_lock_with_key: | GET | `/v5/affiliate/affiliate-sub-list` | +| [getAffiliateUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3019) | :closed_lock_with_key: | GET | `/v5/user/aff-customer-info` | +| [getFriendReferrals()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3031) | :closed_lock_with_key: | GET | `/v5/user/invitation/referrals` | +| [getReferralCode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3040) | :closed_lock_with_key: | GET | `/v5/user/invitation/code` | +| [getReferralCommissionRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3052) | :closed_lock_with_key: | POST | `/v5/referral/commission/records` | +| [getReferralCampaignRewards()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3065) | :closed_lock_with_key: | POST | `/v5/referral/campaign/rewards` | +| [getReferralUserIdentityProfile()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3080) | :closed_lock_with_key: | POST | `/v5/referral/user/identity-profile` | +| [getReferralUserInvitations()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3093) | :closed_lock_with_key: | POST | `/v5/referral/user/invitations` | +| [signAgreement()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3111) | :closed_lock_with_key: | POST | `/v5/user/agreement` | +| [getAlphaTradeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3128) | :closed_lock_with_key: | POST | `/v5/alpha/trade/quote` | +| [executeAlphaTradePurchase()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3139) | :closed_lock_with_key: | POST | `/v5/alpha/trade/purchase` | +| [executeAlphaTradeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3150) | :closed_lock_with_key: | POST | `/v5/alpha/trade/redeem` | +| [getAlphaPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3160) | :closed_lock_with_key: | POST | `/v5/alpha/trade/pay-token-list` | +| [getAlphaTradeOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3170) | :closed_lock_with_key: | POST | `/v5/alpha/trade/order-list` | +| [getAlphaBizTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3180) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-list` | +| [getAlphaBizTokenPriceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3190) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-price-list` | +| [getAlphaBizTokenDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3200) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-details` | +| [getAlphaAssetList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3210) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-list` | +| [getAlphaAssetDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3218) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-detail` | +| [getAlphaPredictionEngineStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3234) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/engine-status` | +| [getAlphaPredictionPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3244) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/pay-token-list` | +| [getAlphaPredictionEventDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3254) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/event-detail` | +| [getAlphaPredictionOrderEstimate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3264) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-estimate` | +| [executeAlphaPredictionBuy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3274) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/buy` | +| [executeAlphaPredictionSell()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3284) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sell` | +| [getAlphaPredictionOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3294) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-list` | +| [getAlphaPredictionOrderBook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3304) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-book` | +| [getAlphaPredictionTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3314) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/token-price` | +| [getAlphaPredictionPriceHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3324) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/price-history` | +| [getAlphaPredictionPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3334) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-list` | +| [getAlphaPredictionPositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3344) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-history` | +| [getAlphaPredictionPortfolioSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3354) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/portfolio-summary` | +| [getAlphaPredictionSideMarketList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3364) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/side-market-list` | +| [getAlphaPredictionSportsMatchList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3374) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/match-list` | +| [getAlphaPredictionSportsTimelineStages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3384) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/sports/timeline-stages` | +| [getAlphaPredictionSportsGroupStageDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3397) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/group-stage-detail` | +| [getAlphaLPPoolList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3416) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-list` | +| [getAlphaLPPoolInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3426) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-info` | +| [executeAlphaLPStake()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3436) | :closed_lock_with_key: | POST | `/v5/alpha/lp/stake` | +| [executeAlphaLPRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3446) | :closed_lock_with_key: | POST | `/v5/alpha/lp/redeem` | +| [getAlphaLPOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3456) | :closed_lock_with_key: | POST | `/v5/alpha/lp/order-list` | +| [getAlphaLPPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3466) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-list` | +| [getAlphaLPPayTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3476) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-price` | +| [getAlphaLPPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3486) | :closed_lock_with_key: | POST | `/v5/alpha/lp/position-list` | +| [getVIPMarginData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3506) | | GET | `/v5/spot-margin-trade/data` | +| [getHistoricalInterestRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3517) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/interest-rate-history` | +| [getSpotMarginCurrencyData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3542) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/currency-data` | +| [toggleSpotMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3554) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/switch-mode` | +| [setSpotMarginLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3565) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | +| [setSpotMarginLeverageV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3573) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | +| [getSpotMarginState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3584) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/state` | +| [manualBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3591) | :closed_lock_with_key: | POST | `/v5/account/borrow` | +| [getMaxBorrowableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3606) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/max-borrowable` | +| [getPositionTiers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3615) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/position-tiers` | +| [getCoinState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3626) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/coinstate` | +| [getAvailableAmountToRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3637) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/repayment-available-amount` | +| [manualRepayWithoutConversion()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3656) | :closed_lock_with_key: | POST | `/v5/account/no-convert-repay` | +| [getAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3669) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-auto-repay-mode` | +| [setAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3685) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-auto-repay-mode` | +| [getSpotMarginLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3697) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/liability` | +| [submitFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3706) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow` | +| [getFixedRateBorrowOrderInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3715) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-info` | +| [getFixedRateBorrowContractInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3732) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-contract-info` | +| [getFixedRateBorrowOrderQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3749) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-quote` | +| [renewFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3761) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-renew` | +| [getFixedRateBorrowInterestAccrued()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3767) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-interest-accrued` | +| [cancelFixedRateBorrowOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3781) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-order-cancel` | +| [getFlexibleAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3790) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/flexible-available-inventory` | +| [getFixedRateAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3799) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixed-available-inventory` | +| [getSpotMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3817) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/pledge-token` | +| [getSpotMarginBorrowableCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3834) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/borrow-token` | +| [getSpotMarginInterestAndQuota()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3851) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/loan-info` | +| [getSpotMarginLoanAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3869) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/account` | +| [spotMarginBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3893) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/loan` | +| [spotMarginRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3904) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/repay` | +| [getSpotMarginBorrowOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3919) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/orders` | +| [getSpotMarginRepaymentOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3948) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/repay-history` | +| [toggleSpotCrossMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3977) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/switch` | +| [getCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3997) | | GET | `/v5/crypto-loan/collateral-data` | +| [getBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4014) | | GET | `/v5/crypto-loan/loanable-data` | +| [getAccountBorrowCollateralLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4032) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrowable-collateralisable-number` | +| [borrowCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4052) | :closed_lock_with_key: | POST | `/v5/crypto-loan/borrow` | +| [repayCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4073) | :closed_lock_with_key: | POST | `/v5/crypto-loan/repay` | +| [getUnpaidLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4089) | :closed_lock_with_key: | GET | `/v5/crypto-loan/ongoing-orders` | +| [getRepaymentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4110) | :closed_lock_with_key: | GET | `/v5/crypto-loan/repayment-history` | +| [getCompletedLoanOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4130) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrow-history` | +| [getMaxAllowedReductionCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4149) | :closed_lock_with_key: | GET | `/v5/crypto-loan/max-collateral-amount` | +| [adjustCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4168) | :closed_lock_with_key: | POST | `/v5/crypto-loan/adjust-ltv` | +| [getLoanLTVAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4192) | :closed_lock_with_key: | GET | `/v5/crypto-loan/adjustment-history` | +| [getLoanBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4213) | | GET | `/v5/crypto-loan-common/loanable-data` | +| [getLoanCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4225) | | GET | `/v5/crypto-loan-common/collateral-data` | +| [getMaxCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4235) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/max-collateral-amount` | +| [getMaxLoanAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4254) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/max-loan` | +| [updateCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4264) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/adjust-ltv` | +| [getCollateralAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4275) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/adjustment-history` | +| [getCryptoLoanPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4290) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/position` | +| [borrowFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4307) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/borrow` | +| [repayFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4318) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay` | +| [repayCollateralFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4328) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | +| [getOngoingFlexibleLoans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4342) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/ongoing-coin` | +| [getBorrowHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4354) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/borrow-history` | +| [getRepaymentHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4367) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/repayment-history` | +| [getFlexibleLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4381) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/available-inventory` | +| [getSupplyOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4401) | | GET | `/v5/crypto-loan-fixed/supply-order-quote` | +| [getBorrowOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4414) | | GET | `/v5/crypto-loan-fixed/borrow-order-quote` | +| [createBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4427) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow` | +| [createSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4440) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply` | +| [cancelBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4450) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow-order-cancel` | +| [cancelSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4464) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply-order-cancel` | +| [getBorrowContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4477) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-contract-info` | +| [getSupplyContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4495) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-contract-info` | +| [getBorrowOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4513) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-order-info` | +| [getSupplyOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4526) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-order-info` | +| [repayFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4540) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/fully-repay` | +| [repayCollateralFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4551) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | +| [getRepaymentHistoryFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4564) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/repayment-history` | +| [renewBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4581) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/renew` | +| [getRenewOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4594) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/renew-info` | +| [getFixedLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4603) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/available-inventory` | +| [getInstitutionalLendingProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4618) | | GET | `/v5/ins-loan/product-infos` | +| [getInstitutionalLendingCoinDeltaAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4630) | :closed_lock_with_key: | GET | `/v5/ins-loan/coin-delta-amount` | +| [getInstitutionalLendingDelayLiquidationStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4639) | :closed_lock_with_key: | GET | `/v5/ins-loan/delay-liq-status` | +| [getInstitutionalLendingMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4649) | | GET | `/v5/ins-loan/ensure-tokens` | +| [getInstitutionalLendingMarginCoinInfoWithConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4658) | | GET | `/v5/ins-loan/ensure-tokens-convert` | +| [getInstitutionalLendingLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4667) | :closed_lock_with_key: | GET | `/v5/ins-loan/loan-order` | +| [getInstitutionalLendingRepayOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4679) | :closed_lock_with_key: | GET | `/v5/ins-loan/repaid-history` | +| [getInstitutionalLendingLTV()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4691) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv` | +| [getInstitutionalLendingLTVWithLadderConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4700) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv-convert` | +| [bindOrUnbindUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4715) | :closed_lock_with_key: | POST | `/v5/ins-loan/association-uid` | +| [repayInstitutionalLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4735) | :closed_lock_with_key: | POST | `/v5/ins-loan/repay-loan` | +| [getExchangeBrokerEarnings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4756) | :closed_lock_with_key: | GET | `/v5/broker/earnings-info` | +| [getExchangeBrokerAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4769) | :closed_lock_with_key: | GET | `/v5/broker/account-info` | +| [getBrokerSubAccountDeposits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4785) | :closed_lock_with_key: | GET | `/v5/broker/asset/query-sub-member-deposit-record` | +| [getBrokerVoucherSpec()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4800) | :closed_lock_with_key: | POST | `/v5/broker/award/info` | +| [issueBrokerVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4812) | :closed_lock_with_key: | POST | `/v5/broker/award/distribute-award` | +| [getBrokerIssuedVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4824) | :closed_lock_with_key: | POST | `/v5/broker/award/distribution-record` | +| [setBrokerRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4841) | :closed_lock_with_key: | POST | `/v5/broker/apilimit/set` | +| [getBrokerRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4860) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-cap` | +| [getAllBrokerRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4878) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-all` | +| [getEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4898) | | GET | `/v5/earn/product` | +| [getFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4909) | :closed_lock_with_key: | GET | `/v5/earn/flexible-saving/auto-savings` | +| [setFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4920) | :closed_lock_with_key: | POST | `/v5/earn/flexible-saving/auto-savings` | +| [getEarnCouponList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4930) | :closed_lock_with_key: | GET | `/v5/earn/coupons` | +| [getRWAProductList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4940) | | GET | `/v5/earn/rwa/product` | +| [placeRWAOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4950) | :closed_lock_with_key: | POST | `/v5/earn/rwa/place-order` | +| [getRWAPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4959) | :closed_lock_with_key: | GET | `/v5/earn/rwa/position` | +| [getRWAOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4968) | :closed_lock_with_key: | GET | `/v5/earn/rwa/order` | +| [getRWANavChart()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4978) | | GET | `/v5/earn/rwa/nav-chart` | +| [getHoldToEarnAirdropProducts()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4989) | | GET | `/v5/earn/hold-to-earn/product` | +| [getAdvanceEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5000) | | GET | `/v5/earn/advance/product` | +| [getLiquidityMiningProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5011) | | GET | `/v5/earn/liquidity-mining/product` | +| [reinvestLiquidityMining()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5024) | :closed_lock_with_key: | POST | `/v5/earn/liquidity-mining/reinvest` | +| [getFixedTermEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5035) | | GET | `/v5/earn/fixed-term/product` | +| [getAdvanceEarnProductExtraInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5047) | | GET | `/v5/earn/advance/product-extra-info` | +| [submitAdvanceEarnPlaceOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5058) | :closed_lock_with_key: | POST | `/v5/earn/advance/place-order` | +| [getAdvanceEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5069) | :closed_lock_with_key: | GET | `/v5/earn/advance/position` | +| [getAdvanceEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5080) | :closed_lock_with_key: | GET | `/v5/earn/advance/order` | +| [submitFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5091) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/place-order` | +| [redeemFixedTermEarn()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5102) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/redeem` | +| [getFixedTermEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5113) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/position` | +| [getFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5124) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/order` | +| [setFixedTermEarnAutoInvest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5135) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/position/auto-invest` | +| [submitStakeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5151) | :closed_lock_with_key: | POST | `/v5/earn/place-order` | +| [getEarnOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5170) | :closed_lock_with_key: | GET | `/v5/earn/order` | +| [getEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5188) | :closed_lock_with_key: | GET | `/v5/earn/position` | +| [modifyEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5201) | :closed_lock_with_key: | POST | `/v5/earn/position/modify` | +| [getEarnYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5214) | :closed_lock_with_key: | GET | `/v5/earn/yield` | +| [getHoldToEarnAirdropYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5228) | :closed_lock_with_key: | GET | `/v5/earn/hold-to-earn/yield-history` | +| [getEarnHourlyYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5239) | :closed_lock_with_key: | GET | `/v5/earn/hourly-yield` | +| [getEarnAprHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5253) | | GET | `/v5/earn/apr-history` | +| [getEarnTokenProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5263) | | GET | `/v5/earn/token/product` | +| [submitEarnTokenOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5272) | :closed_lock_with_key: | POST | `/v5/earn/token/place-order` | +| [getEarnTokenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5281) | :closed_lock_with_key: | GET | `/v5/earn/token/order` | +| [getEarnTokenPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5293) | :closed_lock_with_key: | GET | `/v5/earn/token/position` | +| [getEarnTokenDailyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5302) | :closed_lock_with_key: | GET | `/v5/earn/token/yield` | +| [getEarnTokenHourlyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5314) | :closed_lock_with_key: | GET | `/v5/earn/token/hourly-yield` | +| [getEarnTokenHistoryApr()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5326) | | GET | `/v5/earn/token/history-apr` | +| [getPwmInvestmentPlanList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5341) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/list` | +| [getPwmInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5350) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/detail` | +| [getPwmPendingInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5359) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/new-plan` | +| [claimPwmWithdrawableFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5368) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/claim` | +| [getPwmInvestmentPlanAssetTrend()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5377) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/asset-trend` | +| [getPwmFundHistoricalNav()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5386) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/fund-nav` | +| [subscribePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5395) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/subscribe` | +| [investMorePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5404) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/invest-more` | +| [redeemPwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5413) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/redeem` | +| [getPwmInvestmentPlanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5422) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/order` | +| [getPwmSubscribableProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5431) | | GET | `/v5/earn/pwm/customize-plan/product` | +| [createPwmCustomizeInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5440) | :closed_lock_with_key: | POST | `/v5/earn/pwm/customize-plan/create` | +| [getPwmAllFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5455) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-funds` | +| [settlePwmFundProfit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5464) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/settle-profit` | +| [createPwmFund()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5473) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-fund` | +| [createPwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5482) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-investment-plan` | +| [getPwmAssetManagerInvestmentPlans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5496) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/get-investment-plan` | +| [managePwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5508) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-investment-plan` | +| [getPwmAllFundOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5522) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-order` | +| [managePwmFundOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5531) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-order` | +| [createPwmFundSubAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5540) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-sub-account` | +| [pwmFundTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5552) | :closed_lock_with_key: | POST | `/v5/earn/pwm/fund-transfer` | +| [getPwmFundTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5561) | :closed_lock_with_key: | GET | `/v5/earn/pwm/query-fund-transfer-result` | +| [queryCardAssetRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5576) | :closed_lock_with_key: | POST | `/v5/card/transaction/query-asset-records` | +| [queryCardPointsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5585) | :closed_lock_with_key: | POST | `/v5/card/reward/points/balance` | +| [queryCardPointsRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5592) | :closed_lock_with_key: | POST | `/v5/card/reward/points/records` | +| [queryCardPointsTier()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5601) | :closed_lock_with_key: | POST | `/v5/card/reward/points/tier` | +| [queryCardMallItemList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5608) | :closed_lock_with_key: | POST | `/v5/card/reward/mall/item/list` | +| [queryCardPointCashbackDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5617) | :closed_lock_with_key: | POST | `/v5/card/reward/point/cashback/detail` | +| [createRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5633) | :closed_lock_with_key: | POST | `/v5/rfq/create-rfq` | +| [getRFQConfig()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5644) | :closed_lock_with_key: | GET | `/v5/rfq/config` | +| [cancelRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5653) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-rfq` | +| [cancelAllRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5663) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-rfq` | +| [createRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5672) | :closed_lock_with_key: | POST | `/v5/rfq/create-quote` | +| [executeRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5683) | :closed_lock_with_key: | POST | `/v5/rfq/execute-quote` | +| [cancelRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5694) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-quote` | +| [cancelAllRFQQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5704) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-quotes` | +| [getRFQRealtimeInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5718) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-realtime` | +| [getRFQHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5730) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-list` | +| [getRFQRealtimeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5744) | :closed_lock_with_key: | GET | `/v5/rfq/quote-realtime` | +| [getRFQHistoryQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5759) | :closed_lock_with_key: | GET | `/v5/rfq/quote-list` | +| [getRFQTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5772) | :closed_lock_with_key: | GET | `/v5/rfq/trade-list` | +| [getRFQPublicTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5785) | :closed_lock_with_key: | GET | `/v5/rfq/public-trades` | +| [acceptNonLPQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5801) | :closed_lock_with_key: | POST | `/v5/rfq/accept-other-quote` | +| [getRFQDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5807) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-detail-list` | +| [getP2PAccountCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5832) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | +| [getP2POnlineAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5849) | :closed_lock_with_key: | POST | `/v5/p2p/item/online` | +| [createP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5858) | :closed_lock_with_key: | POST | `/v5/p2p/item/create` | +| [cancelP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5867) | :closed_lock_with_key: | POST | `/v5/p2p/item/cancel` | +| [updateP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5881) | :closed_lock_with_key: | POST | `/v5/p2p/item/update` | +| [getP2PPersonalAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5891) | :closed_lock_with_key: | POST | `/v5/p2p/item/personal/list` | +| [getP2PAdDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5900) | :closed_lock_with_key: | POST | `/v5/p2p/item/info` | +| [getP2POrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5915) | :closed_lock_with_key: | POST | `/v5/p2p/order/simplifyList` | +| [getP2POrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5925) | :closed_lock_with_key: | POST | `/v5/p2p/order/info` | +| [getP2PPendingOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5934) | :closed_lock_with_key: | POST | `/v5/p2p/order/pending/simplifyList` | +| [markP2POrderAsPaid()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5943) | :closed_lock_with_key: | POST | `/v5/p2p/order/pay` | +| [releaseP2POrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5952) | :closed_lock_with_key: | POST | `/v5/p2p/order/finish` | +| [reviewP2PSellerCancelOrderApply()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5964) | :closed_lock_with_key: | POST | `/v5/p2p/order/buyer/examine/sellerCancelOrderApply` | +| [sendP2POrderMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5976) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/send` | +| [getP2PChatSessions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5991) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/list_v1` | +| [getP2PChatSessionId()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6001) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/getSessionId` | +| [sendP2PChatMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6037) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/send_v1` | +| [getP2PChatMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6049) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/listpage_v1` | +| [getP2POrderMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6058) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/listpage` | +| [getP2PUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6072) | :closed_lock_with_key: | POST | `/v5/p2p/user/personal/info` | +| [getP2PCounterpartyUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6079) | :closed_lock_with_key: | POST | `/v5/p2p/user/order/personal/info` | +| [getP2PUserPayments()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6088) | :closed_lock_with_key: | POST | `/v5/p2p/user/payment/list` | +| [setApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6108) | :closed_lock_with_key: | POST | `/v5/apilimit/set` | +| [queryApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6137) | :closed_lock_with_key: | GET | `/v5/apilimit/query` | +| [getRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6156) | :closed_lock_with_key: | GET | `/v5/apilimit/query-cap` | +| [getAllRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6175) | :closed_lock_with_key: | GET | `/v5/apilimit/query-all` | +| [getLaunchpoolProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6198) | | GET | `/v5/spot-x/launchpool/project/list` | +| [getLaunchpoolUserActivityLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6204) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/activity-log` | +| [getLaunchpoolCurrentStaking()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6210) | :closed_lock_with_key: | GET | `/v5/spot-x/launchpool/user/current-staking` | +| [getLaunchpoolUserHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6216) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/history` | +| [getPuzzleProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6222) | | GET | `/v5/spot-x/puzzle/project/list` | +| [getTokenSplashProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6228) | | GET | `/v5/spot-x/token-splash/project/list` | +| [getTokenSplashUserActivityParams()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6234) | :closed_lock_with_key: | GET | `/v5/spot-x/token-splash/user/activity-params` | +| [getEventInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6257) | | GET | `/v5/event/instruments-info` | +| [getEventOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6268) | | GET | `/v5/event/orderbook` | +| [getEventOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6279) | :closed_lock_with_key: | GET | `/v5/event/order-list` | +| [getEventActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6290) | :closed_lock_with_key: | GET | `/v5/event/order-realtime` | +| [getEventPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6301) | :closed_lock_with_key: | GET | `/v5/event/positions` | +| [getEventTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6312) | :closed_lock_with_key: | GET | `/v5/event/trades` | +| [getEventSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6323) | :closed_lock_with_key: | GET | `/v5/event/settlements` | +| [submitEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6334) | :closed_lock_with_key: | POST | `/v5/event/quotes` | +| [cancelEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6345) | :closed_lock_with_key: | POST | `/v5/event/cancel` | # websocket-api-client.ts diff --git a/llms.txt b/llms.txt index 4cc32437..83b44da9 100644 --- a/llms.txt +++ b/llms.txt @@ -8442,157 +8442,6 @@ export interface GetP2PChatMessagesParamsV5 { ⋮---- /** AES encrypted session ID. */ -================ -File: src/types/request/v5-spot-leverage-token.ts -================ -import { LTOrderTypeV5 } from '../shared-v5'; -⋮---- -export interface PurchaseSpotLeveragedTokenParamsV5 { - ltCoin: string; - amount: string; - serialNo?: string; -} -⋮---- -export interface RedeemSpotLeveragedTokenParamsV5 { - ltCoin: string; - quantity: string; - serialNo?: string; -} -⋮---- -export interface GetSpotLeveragedTokenOrderHistoryParamsV5 { - ltCoin?: string; - orderId?: string; - startTime?: number; - endTime?: number; - limit?: number; - ltOrderType?: LTOrderTypeV5; - serialNo?: string; -} -⋮---- -export interface GetVIPMarginDataParamsV5 { - vipLevel?: string; - currency?: string; -} -⋮---- -export interface GetSpotMarginCurrencyDataParamsV5 { - currency?: string; -} -⋮---- -// Spot Margin Trade (UTA) endpoints -export interface ManualBorrowParamsV5 { - coin: string; - amount: string; -} -⋮---- -export interface GetMaxBorrowableAmountParamsV5 { - currency: string; -} -⋮---- -export interface GetPositionTiersParamsV5 { - currency?: string; -} -⋮---- -export interface GetCoinStateParamsV5 { - currency?: string; -} -⋮---- -export interface GetAvailableAmountToRepayParamsV5 { - currency: string; -} -⋮---- -export interface SetSpotMarginLeverageParamsV5 { - leverage: string; - currency?: string; -} -⋮---- -export interface ManualRepayWithoutConversionParamsV5 { - coin: string; - amount?: string; - /** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - */ - repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; -} -⋮---- -/** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - */ -⋮---- -export interface GetAutoRepayModeParamsV5 { - currency?: string; // Coin name, uppercase only. If not passed, returns all currencies -} -⋮---- -currency?: string; // Coin name, uppercase only. If not passed, returns all currencies -⋮---- -export interface SetAutoRepayModeParamsV5 { - currency?: string; // Coin name, uppercase only. If not passed, enables for all currencies - autoRepayMode: '0' | '1'; // 0: Off, 1: On -} -⋮---- -currency?: string; // Coin name, uppercase only. If not passed, enables for all currencies -autoRepayMode: '0' | '1'; // 0: Off, 1: On -⋮---- -export interface GetSpotMarginLiabilityInfoParamsV5 { - currency: string; -} -⋮---- -export interface FixedRateBorrowParamsV5 { - orderCurrency: string; - orderAmount: string; - /** e.g. 0.02 = 2% p.a. */ - annualRate: string; - /** 7, 14, 30, 90, 180 (days) */ - term: string; - /** 1: auto repayment; 2: transfer to flexible loan */ - repayType?: '1' | '2'; -} -⋮---- -/** e.g. 0.02 = 2% p.a. */ -⋮---- -/** 7, 14, 30, 90, 180 (days) */ -⋮---- -/** 1: auto repayment; 2: transfer to flexible loan */ -⋮---- -export interface GetFixedRateBorrowOrderInfoParamsV5 { - orderId?: string; - orderCurrency?: string; - state?: string; - term?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface GetFixedRateBorrowContractInfoParamsV5 { - orderId?: string; - orderCurrency?: string; - term?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface GetFixedRateBorrowOrderQuoteParamsV5 { - orderCurrency: string; - term?: string; - orderBy?: 'apy' | 'term' | 'quantity'; - sort?: 0 | 1; - limit?: number; -} -⋮---- -export interface RenewFixedRateBorrowParamsV5 { - loanId: string; - qty?: string; -} -⋮---- -export interface GetFlexibleAvailableInventoryParamsV5 { - currency: string; -} -⋮---- -export interface GetFixedRateAvailableInventoryParamsV5 { - currency: string; - term: string; - annualRate: string; -} - ================ File: src/types/request/v5-trade.ts ================ @@ -10442,91 +10291,253 @@ token: string; // Coin name quantity: string; // The qty to be repaid ================ -File: src/types/request/v5-user.ts +File: src/types/request/v5-spot-leverage-token.ts ================ -import { PermissionsV5 } from '../shared-v5'; +import { LTOrderTypeV5 } from '../shared-v5'; ⋮---- -export interface CreateSubMemberParamsV5 { - username: string; - password?: string; - /** - * 1: normal, 6: custodial - */ - memberType: 1 | 6; - /** - * 0: quick login disabled (default), 1: quick login enabled - */ - switch?: 0 | 1; - isUta?: boolean; - note?: string; +export interface PurchaseSpotLeveragedTokenParamsV5 { + ltCoin: string; + amount: string; + serialNo?: string; } ⋮---- -/** - * 1: normal, 6: custodial - */ -⋮---- -/** - * 0: quick login disabled (default), 1: quick login enabled - */ +export interface RedeemSpotLeveragedTokenParamsV5 { + ltCoin: string; + quantity: string; + serialNo?: string; +} ⋮---- -export interface CreateSubApiKeyParamsV5 { - subuid: number; - note?: string; - readOnly: 0 | 1; - ips?: string; - permissions: PermissionsV5; +export interface GetSpotLeveragedTokenOrderHistoryParamsV5 { + ltCoin?: string; + orderId?: string; + startTime?: number; + endTime?: number; + limit?: number; + ltOrderType?: LTOrderTypeV5; + serialNo?: string; } ⋮---- -export interface UpdateApiKeyParamsV5 { - apikey?: string; - readOnly?: 0 | 1; - permissions: PermissionsV5; +export interface GetVIPMarginDataParamsV5 { + vipLevel?: string; + currency?: string; } ⋮---- -export interface UpdateSubApiKeyUpdateParamsV5 { - readOnly?: number; - ips?: string[]; - permissions: PermissionsV5; +export interface GetSpotMarginCurrencyDataParamsV5 { + currency?: string; } ⋮---- -export interface DeleteSubMemberParamsV5 { - subMemberId: string; +// Spot Margin Trade (UTA) endpoints +export interface ManualBorrowParamsV5 { + coin: string; + amount: string; } ⋮---- -export interface GetSubAccountAllApiKeysParamsV5 { - subMemberId: string; - limit?: number; - cursor?: string; +export interface GetMaxBorrowableAmountParamsV5 { + currency: string; } ⋮---- -export interface GetAffiliateUserListParamsV5 { - size?: number; - cursor?: string; - needDeposit?: boolean; - need30?: boolean; - need365?: boolean; - startDate?: string; - endDate?: string; +export interface GetPositionTiersParamsV5 { + currency?: string; } ⋮---- -/** GET /v5/affiliate/affiliate-sub-list */ -export interface GetAffiliateSubAffiliateListParamsV5 { - cursor?: string; - /** [0, 100]. Default: 0 */ - size?: number; - /** YYYY-MM-DD. Range with endDate max 3 months */ - startDate?: string; - /** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ - endDate?: string; - /** Exact sub-affiliate ID. 0 or omit for all */ - subAffId?: number; +export interface GetCoinStateParamsV5 { + currency?: string; } ⋮---- -/** [0, 100]. Default: 0 */ +export interface GetAvailableAmountToRepayParamsV5 { + currency: string; +} ⋮---- -/** YYYY-MM-DD. Range with endDate max 3 months */ +export interface SetSpotMarginLeverageParamsV5 { + leverage: string; + currency?: string; +} ⋮---- -/** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ +export interface ManualRepayWithoutConversionParamsV5 { + coin: string; + amount?: string; + /** + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. + */ + repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; +} +⋮---- +/** + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. + */ +⋮---- +export interface GetAutoRepayModeParamsV5 { + currency?: string; // Coin name, uppercase only. If not passed, returns all currencies +} +⋮---- +currency?: string; // Coin name, uppercase only. If not passed, returns all currencies +⋮---- +export interface SetAutoRepayModeParamsV5 { + currency?: string; // Coin name, uppercase only. If not passed, enables for all currencies + autoRepayMode: '0' | '1'; // 0: Off, 1: On +} +⋮---- +currency?: string; // Coin name, uppercase only. If not passed, enables for all currencies +autoRepayMode: '0' | '1'; // 0: Off, 1: On +⋮---- +export interface GetSpotMarginLiabilityInfoParamsV5 { + currency: string; +} +⋮---- +export interface FixedRateBorrowParamsV5 { + orderCurrency: string; + orderAmount: string; + /** e.g. 0.02 = 2% p.a. */ + annualRate: string; + /** 7, 14, 30, 90, 180 (days) */ + term: string; + /** 1: auto repayment; 2: transfer to flexible loan */ + repayType?: '1' | '2'; +} +⋮---- +/** e.g. 0.02 = 2% p.a. */ +⋮---- +/** 7, 14, 30, 90, 180 (days) */ +⋮---- +/** 1: auto repayment; 2: transfer to flexible loan */ +⋮---- +export interface GetFixedRateBorrowOrderInfoParamsV5 { + orderId?: string; + orderCurrency?: string; + state?: string; + term?: string; + limit?: string; + cursor?: string; +} +⋮---- +export interface GetFixedRateBorrowContractInfoParamsV5 { + orderId?: string; + orderCurrency?: string; + term?: string; + limit?: string; + cursor?: string; +} +⋮---- +export interface GetFixedRateBorrowOrderQuoteParamsV5 { + orderCurrency: string; + term?: string; + orderBy?: 'apy' | 'term' | 'quantity'; + sort?: 0 | 1; + limit?: number; +} +⋮---- +export interface RenewFixedRateBorrowParamsV5 { + loanId: string; + qty?: string; +} +⋮---- +export interface GetFixedRateBorrowInterestAccruedParamsV5 { + orderId?: string; + orderCurrency?: string; + limit?: string; + cursor?: string; +} +⋮---- +export interface CancelFixedRateBorrowOrderParamsV5 { + orderId: string; +} +⋮---- +export interface GetFlexibleAvailableInventoryParamsV5 { + currency: string; +} +⋮---- +export interface GetFixedRateAvailableInventoryParamsV5 { + currency: string; + term: string; + annualRate: string; +} + +================ +File: src/types/request/v5-user.ts +================ +import { PermissionsV5 } from '../shared-v5'; +⋮---- +export interface CreateSubMemberParamsV5 { + username: string; + password?: string; + /** + * 1: normal, 6: custodial + */ + memberType: 1 | 6; + /** + * 0: quick login disabled (default), 1: quick login enabled + */ + switch?: 0 | 1; + isUta?: boolean; + note?: string; +} +⋮---- +/** + * 1: normal, 6: custodial + */ +⋮---- +/** + * 0: quick login disabled (default), 1: quick login enabled + */ +⋮---- +export interface CreateSubApiKeyParamsV5 { + subuid: number; + note?: string; + readOnly: 0 | 1; + ips?: string; + permissions: PermissionsV5; +} +⋮---- +export interface UpdateApiKeyParamsV5 { + apikey?: string; + readOnly?: 0 | 1; + permissions: PermissionsV5; +} +⋮---- +export interface UpdateSubApiKeyUpdateParamsV5 { + readOnly?: number; + ips?: string[]; + permissions: PermissionsV5; +} +⋮---- +export interface DeleteSubMemberParamsV5 { + subMemberId: string; +} +⋮---- +export interface GetSubAccountAllApiKeysParamsV5 { + subMemberId: string; + limit?: number; + cursor?: string; +} +⋮---- +export interface GetAffiliateUserListParamsV5 { + size?: number; + cursor?: string; + needDeposit?: boolean; + need30?: boolean; + need365?: boolean; + startDate?: string; + endDate?: string; +} +⋮---- +/** GET /v5/affiliate/affiliate-sub-list */ +export interface GetAffiliateSubAffiliateListParamsV5 { + cursor?: string; + /** [0, 100]. Default: 0 */ + size?: number; + /** YYYY-MM-DD. Range with endDate max 3 months */ + startDate?: string; + /** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ + endDate?: string; + /** Exact sub-affiliate ID. 0 or omit for all */ + subAffId?: number; +} +⋮---- +/** [0, 100]. Default: 0 */ +⋮---- +/** YYYY-MM-DD. Range with endDate max 3 months */ +⋮---- +/** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ ⋮---- /** Exact sub-affiliate ID. 0 or omit for all */ ⋮---- @@ -11135,417 +11146,166 @@ notionalUsd: string; // Notional USD value remainingQuota: string; // Remaining individual platform borrowing limit (shared between main and sub accounts) ================ -File: src/types/response/v5-spot-leverage-token.ts +File: src/websocket-client.ts ================ +/* eslint-disable @typescript-eslint/no-unused-vars */ +⋮---- import { - LeverageTokenStatusV5, - LTOrderStatusV5, - LTOrderTypeV5, -} from '../shared-v5'; + MessageEventLike, + WSCategoryV5, + WSClientConfigurableOptions, + WsKey, + WsMarket, + WsTopic, +} from './types'; +import { + Exact, + WSAPIOperation, + WsAPIOperationResponseMap, + WSAPIRequest, + WsAPITopicRequestParamMap, + WsAPIWsKeyTopicMap, + WsOperation, + WsRequestOperationBybit, +} from './types/websockets/ws-api'; +import { + APIID, + DefaultLogger, + getMaxTopicsPerSubscribeEvent, + getNormalisedTopicRequests, + getPromiseRefForWSAPIRequest, + getTopicsPerWSKey, + getWsKeyForTopic, + getWsUrl, + isPrivateWsTopic, + isTopicSubscriptionConfirmation, + isTopicSubscriptionSuccess, + isWSAPIResponse, + isWsPong, + neverGuard, + WS_AUTH_ON_CONNECT_KEYS, + WS_KEY_MAP, + WSConnectedResult, + WsTopicRequest, +} from './util'; +import { + BaseWebsocketClient, + EmittableEvent, + MidflightWsRequestEvent, +} from './util/BaseWSClient'; +import { SignAlgorithm, signMessage } from './util/webCryptoAPI'; ⋮---- -export interface LeverageTokenInfoV5 { - ltCoin: string; - ltName: string; - maxPurchase: string; - minPurchase: string; - maxPurchaseDaily: string; - maxRedeem: string; - minRedeem: string; - maxRedeemDaily: string; - purchaseFeeRate: string; - redeemFeeRate: string; - ltStatus: LeverageTokenStatusV5; - fundFee: string; - fundFeeTime: string; - manageFeeRate: string; - manageFeeTime: string; - value: string; - netValue: string; - total: string; +export interface WSAPIRequestFlags { + /** If true, will skip auth requirement for WS API connection */ + authIsOptional?: boolean | undefined; } ⋮---- -export interface LeveragedTokenMarketResultV5 { - ltCoin: string; - nav: string; - navTime: string; - circulation: string; - basket: string; - leverage: string; -} +/** If true, will skip auth requirement for WS API connection */ ⋮---- -export interface PurchaseSpotLeveragedTokenResultV5 { - ltCoin: string; - ltOrderStatus: LTOrderStatusV5; - execQty: string; - execAmt: string; - amount: string; - purchaseId: string; - serialNo: string; - valueCoin: string; -} -export interface RedeemSpotLeveragedTokenResultV5 { - ltCoin: string; - ltOrderStatus: LTOrderStatusV5; - quantity: string; - execQty: string; - execAmt: string; - redeemId: string; - serialNo: string; - valueCoin: string; -} +export class WebsocketClient extends BaseWebsocketClient< ⋮---- -export interface SpotLeveragedTokenOrderHistoryV5 { - ltCoin: string; - orderId: string; - ltOrderType: LTOrderTypeV5; - orderTime: number; - updateTime: number; - ltOrderStatus: LTOrderStatusV5; - fee: string; - amount: string; - value: string; - valueCoin: string; - serialNo: string; -} +constructor(options?: WSClientConfigurableOptions, logger?: DefaultLogger) ⋮---- -export interface VIPMarginDataV5 { - vipCoinList: { - list: { - borrowable: boolean; - collateralRatio: string; - currency: string; - hourlyBorrowRate: string; - liquidationOrder: string; - marginCollateral: boolean; - maxBorrowingAmount: string; - }[]; - vipLevel: string; - }[]; -} +/** + * Request connection of all dependent (public & private) websockets, instead of waiting + * for automatic connection by SDK. + */ +public connectAll(): Promise[] ⋮---- -export interface SpotMarginCurrencyDataV5 { - currency: string; - flexibleManualBorrowable: boolean; - minFlexibleManualBorrowQty: string; - flexibleManualBorrowAccuracy: string; - fixedManualBorrowable: boolean; - minFixedManualBorrowQty: string; - fixedManualBorrowAccuracy: string; - fixedInterestRateAccuracy: string; - minFixedInterestRate: string; - maxFixedInterestRate: string; -} +/** + * Ensures the WS API connection is active and ready. + * + * You do not need to call this, but if you call this before making any WS API requests, + * it can accelerate the first request (by preparing the connection in advance). + */ +public connectWSAPI(): Promise ⋮---- -export interface SpotMarginStateV5 { - spotLeverage: string; - spotMarginMode: '1' | '0'; - effectiveLeverage: string; -} +/** This call automatically ensures the connection is active AND authenticated before resolving */ ⋮---- -// Spot Margin Trade (UTA) response types -export interface ManualBorrowResultV5 { - coin: string; - amount: string; -} +public connectPublic(): Promise[] ⋮---- -export interface MaxBorrowableAmountV5 { - currency: string; - /** - * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or - * when no collateral coins are enabled. The app can still show a borrow - * amount after a collateral coin is selected. Undocumented; Bybit API staff - * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, - * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and - * `toggleSpotMarginTrade()` first. - */ - maxLoan: string; -} +public connectPrivate(): Promise ⋮---- /** - * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or - * when no collateral coins are enabled. The app can still show a borrow - * amount after a collateral coin is selected. Undocumented; Bybit API staff - * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, - * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and - * `toggleSpotMarginTrade()` first. + * Subscribe to V5 topics & track/persist them. + * @param wsTopics - topic or list of topics + * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). + * The value is only important when connecting to public topics and will be ignored for private topics. + * @param isPrivateTopic - optional - the library will try to detect private topics, you can use this + * to mark a topic as private (if the topic isn't recognised yet) */ +public subscribeV5( + wsTopics: WsTopic[] | WsTopic, + category: WSCategoryV5, + isPrivateTopic?: boolean, +): Promise[] ⋮---- -export interface PositionTierV5 { - tier: string; - borrowLimit: string; - positionMMR: string; - positionIMR: string; - maxLeverage: string; -} -⋮---- -export interface CurrencyPositionTiersV5 { - currency: string; - positionTiersRatioList: PositionTierV5[]; -} +// Sort into per-WsKey batches, in case there is a mix of topics here ⋮---- -export interface CoinStateV5 { - currency: string; - spotLeverage: string; -} +// Prevent duplicate requests to the same topic ⋮---- -export interface AvailableAmountToRepayV5 { - currency: string; - lossLessRepaymentAmount: string; -} +// Batch sub topics per ws key ⋮---- -export interface ManualRepayWithoutConversionResultV5 { - /** - * Result status: - * - P: Processing - * - SU: Success - * - FA: Failed - */ - resultStatus: 'P' | 'SU' | 'FA'; -} +// Return promise to resolve midflight WS request (only works if already connected before request) ⋮---- /** - * Result status: - * - P: Processing - * - SU: Success - * - FA: Failed + * Unsubscribe from V5 topics & remove them from memory. They won't be re-subscribed to if the + * connection reconnects. + * + * @param wsTopics - topic or list of topics + * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). The value is only + * important when connecting to public topics and will be ignored for private topics. + * @param isPrivateTopic - optional - the library will try to detect private topics, you can + * use this to mark a topic as private (if the topic isn't recognised yet) */ +public unsubscribeV5( + wsTopics: WsTopic[] | WsTopic, + category: WSCategoryV5, + isPrivateTopic?: boolean, +): Promise[] ⋮---- -export interface AutoRepayModeItemV5 { - currency: string; // Coin name, uppercase only - autoRepayMode: '0' | '1'; // 0: Off, 1: On -} +// Sort into per-WsKey batches, in case there is a mix of topics here ⋮---- -currency: string; // Coin name, uppercase only -autoRepayMode: '0' | '1'; // 0: Off, 1: On +// Batch sub topics per ws key ⋮---- -export interface AutoRepayModeResultV5 { - data: AutoRepayModeItemV5[]; -} +// Return promise to resolve midflight WS request (only works if already connected before request) ⋮---- -export interface SpotMarginLiabilityInfoV5 { - currency: string; - totalBorrowAmount: string; - fixedBorrowAmount: string; - flexibleBorrowAmount: string; - spotTotalBorrow: string; - derivativesBorrow: string; -} +/** + * Note: subscribeV5() might be simpler to use. The end result is the same. + * + * Request subscription to one or more topics. Pass topics as either an array of strings, + * or array of objects (if the topic has parameters). + * + * Objects should be formatted as {topic: string, params: object, category: WSCategoryV5}. + * + * - Subscriptions are automatically routed to the correct websocket connection. + * - Authentication/connection is automatic. + * - Resubscribe after network issues is automatic. + * + * Call `unsubscribe(topics)` to remove topics + */ +public subscribe( + requests: + | (WsTopicRequest | WsTopic) + | (WsTopicRequest | WsTopic)[], + requestedWsKey?: WsKey, +) ⋮---- -export interface FixedRateBorrowResultV5 { - orderId: string; -} +// Batch sub topics per ws key ⋮---- -export interface FixedRateBorrowOrderInfoV5 { - annualRate: string; - orderId: string; - orderTime: string; - filledQty: string; - orderQty: string; - orderCurrency: string; - state: number; - term: number; - repayType: string; - strategyType: 'PARTIAL' | 'FULL'; -} -⋮---- -export interface FixedRateBorrowContractInfoV5 { - annualRate: string; - borrowCurrency: string; - borrowTime: string; - interestPaid: string; - loanId: string; - orderId: string; - repaymentTime: string; - residualPenaltyInterest: string; - residualPrincipal: string; - status: number; - term: string; - repayType: string; - strategyType: 'PARTIAL' | 'FULL'; -} -⋮---- -export interface FixedRateBorrowQuoteV5 { - orderCurrency: string; - term: number; - annualRate: string; - qty: string; -} -⋮---- -export interface FlexibleAvailableInventoryV5 { - currency: string; - availableInventory: string; - updateTime: string; -} -⋮---- -export interface FixedRateAvailableInventoryV5 { - currency: string; - term: string; - annualRate: string; - availableInventory: string; - updateTime: string; -} - -================ -File: src/websocket-client.ts -================ -/* eslint-disable @typescript-eslint/no-unused-vars */ -⋮---- -import { - MessageEventLike, - WSCategoryV5, - WSClientConfigurableOptions, - WsKey, - WsMarket, - WsTopic, -} from './types'; -import { - Exact, - WSAPIOperation, - WsAPIOperationResponseMap, - WSAPIRequest, - WsAPITopicRequestParamMap, - WsAPIWsKeyTopicMap, - WsOperation, - WsRequestOperationBybit, -} from './types/websockets/ws-api'; -import { - APIID, - DefaultLogger, - getMaxTopicsPerSubscribeEvent, - getNormalisedTopicRequests, - getPromiseRefForWSAPIRequest, - getTopicsPerWSKey, - getWsKeyForTopic, - getWsUrl, - isPrivateWsTopic, - isTopicSubscriptionConfirmation, - isTopicSubscriptionSuccess, - isWSAPIResponse, - isWsPong, - neverGuard, - WS_AUTH_ON_CONNECT_KEYS, - WS_KEY_MAP, - WSConnectedResult, - WsTopicRequest, -} from './util'; -import { - BaseWebsocketClient, - EmittableEvent, - MidflightWsRequestEvent, -} from './util/BaseWSClient'; -import { SignAlgorithm, signMessage } from './util/webCryptoAPI'; -⋮---- -export interface WSAPIRequestFlags { - /** If true, will skip auth requirement for WS API connection */ - authIsOptional?: boolean | undefined; -} -⋮---- -/** If true, will skip auth requirement for WS API connection */ -⋮---- -export class WebsocketClient extends BaseWebsocketClient< -⋮---- -constructor(options?: WSClientConfigurableOptions, logger?: DefaultLogger) -⋮---- -/** - * Request connection of all dependent (public & private) websockets, instead of waiting - * for automatic connection by SDK. - */ -public connectAll(): Promise[] -⋮---- -/** - * Ensures the WS API connection is active and ready. - * - * You do not need to call this, but if you call this before making any WS API requests, - * it can accelerate the first request (by preparing the connection in advance). - */ -public connectWSAPI(): Promise -⋮---- -/** This call automatically ensures the connection is active AND authenticated before resolving */ -⋮---- -public connectPublic(): Promise[] -⋮---- -public connectPrivate(): Promise -⋮---- -/** - * Subscribe to V5 topics & track/persist them. - * @param wsTopics - topic or list of topics - * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). - * The value is only important when connecting to public topics and will be ignored for private topics. - * @param isPrivateTopic - optional - the library will try to detect private topics, you can use this - * to mark a topic as private (if the topic isn't recognised yet) - */ -public subscribeV5( - wsTopics: WsTopic[] | WsTopic, - category: WSCategoryV5, - isPrivateTopic?: boolean, -): Promise[] -⋮---- -// Sort into per-WsKey batches, in case there is a mix of topics here -⋮---- -// Prevent duplicate requests to the same topic -⋮---- -// Batch sub topics per ws key -⋮---- -// Return promise to resolve midflight WS request (only works if already connected before request) -⋮---- -/** - * Unsubscribe from V5 topics & remove them from memory. They won't be re-subscribed to if the - * connection reconnects. - * - * @param wsTopics - topic or list of topics - * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). The value is only - * important when connecting to public topics and will be ignored for private topics. - * @param isPrivateTopic - optional - the library will try to detect private topics, you can - * use this to mark a topic as private (if the topic isn't recognised yet) - */ -public unsubscribeV5( - wsTopics: WsTopic[] | WsTopic, - category: WSCategoryV5, - isPrivateTopic?: boolean, -): Promise[] -⋮---- -// Sort into per-WsKey batches, in case there is a mix of topics here -⋮---- -// Batch sub topics per ws key -⋮---- -// Return promise to resolve midflight WS request (only works if already connected before request) -⋮---- -/** - * Note: subscribeV5() might be simpler to use. The end result is the same. - * - * Request subscription to one or more topics. Pass topics as either an array of strings, - * or array of objects (if the topic has parameters). - * - * Objects should be formatted as {topic: string, params: object, category: WSCategoryV5}. - * - * - Subscriptions are automatically routed to the correct websocket connection. - * - Authentication/connection is automatic. - * - Resubscribe after network issues is automatic. - * - * Call `unsubscribe(topics)` to remove topics - */ -public subscribe( - requests: - | (WsTopicRequest | WsTopic) - | (WsTopicRequest | WsTopic)[], - requestedWsKey?: WsKey, -) -⋮---- -// Batch sub topics per ws key -⋮---- -/** - * Note: unsubscribe() might be simpler to use. The end result is the same. - * Unsubscribe from one or more topics. Similar to subscribe() but in reverse. - * - * - Requests are automatically routed to the correct websocket connection. - * - These topics will be removed from the topic cache, so they won't be subscribed to again. - */ -public unsubscribe( - requests: - | (WsTopicRequest | WsTopic) - | (WsTopicRequest | WsTopic)[], - wsKey?: WsKey, -) +/** + * Note: unsubscribe() might be simpler to use. The end result is the same. + * Unsubscribe from one or more topics. Similar to subscribe() but in reverse. + * + * - Requests are automatically routed to the correct websocket connection. + * - These topics will be removed from the topic cache, so they won't be subscribed to again. + */ +public unsubscribe( + requests: + | (WsTopicRequest | WsTopic) + | (WsTopicRequest | WsTopic)[], + wsKey?: WsKey, +) ⋮---- // Batch sub topics per ws key ⋮---- @@ -12358,27 +12118,288 @@ export interface ClosedOptionsPositionV5 { } ================ -File: src/types/websockets/ws-general.ts +File: src/types/response/v5-spot-leverage-token.ts ================ -import { AxiosRequestConfig } from 'axios'; -import type { ClientRequestArgs } from 'http'; -import WebSocket from 'isomorphic-ws'; +import { + LeverageTokenStatusV5, + LTOrderStatusV5, + LTOrderTypeV5, +} from '../shared-v5'; ⋮---- -import { APIRegion, RestClientOptions, WS_KEY_MAP } from '../../util'; +export interface LeverageTokenInfoV5 { + ltCoin: string; + ltName: string; + maxPurchase: string; + minPurchase: string; + maxPurchaseDaily: string; + maxRedeem: string; + minRedeem: string; + maxRedeemDaily: string; + purchaseFeeRate: string; + redeemFeeRate: string; + ltStatus: LeverageTokenStatusV5; + fundFee: string; + fundFeeTime: string; + manageFeeRate: string; + manageFeeTime: string; + value: string; + netValue: string; + total: string; +} ⋮---- -/** For spot markets, spotV3 is recommended */ -export type APIMarket = 'v5'; +export interface LeveragedTokenMarketResultV5 { + ltCoin: string; + nav: string; + navTime: string; + circulation: string; + basket: string; + leverage: string; +} ⋮---- -// Same as inverse futures -export type WsPublicInverseTopic = - | 'orderBookL2_25' - | 'orderBookL2_200' - | 'trade' - | 'insurance' - | 'instrument_info' - | 'klineV2'; +export interface PurchaseSpotLeveragedTokenResultV5 { + ltCoin: string; + ltOrderStatus: LTOrderStatusV5; + execQty: string; + execAmt: string; + amount: string; + purchaseId: string; + serialNo: string; + valueCoin: string; +} +export interface RedeemSpotLeveragedTokenResultV5 { + ltCoin: string; + ltOrderStatus: LTOrderStatusV5; + quantity: string; + execQty: string; + execAmt: string; + redeemId: string; + serialNo: string; + valueCoin: string; +} ⋮---- -export type WsPublicUSDTPerpTopic = +export interface SpotLeveragedTokenOrderHistoryV5 { + ltCoin: string; + orderId: string; + ltOrderType: LTOrderTypeV5; + orderTime: number; + updateTime: number; + ltOrderStatus: LTOrderStatusV5; + fee: string; + amount: string; + value: string; + valueCoin: string; + serialNo: string; +} +⋮---- +export interface VIPMarginDataV5 { + vipCoinList: { + list: { + borrowable: boolean; + collateralRatio: string; + currency: string; + hourlyBorrowRate: string; + liquidationOrder: string; + marginCollateral: boolean; + maxBorrowingAmount: string; + }[]; + vipLevel: string; + }[]; +} +⋮---- +export interface SpotMarginCurrencyDataV5 { + currency: string; + flexibleManualBorrowable: boolean; + minFlexibleManualBorrowQty: string; + flexibleManualBorrowAccuracy: string; + fixedManualBorrowable: boolean; + minFixedManualBorrowQty: string; + fixedManualBorrowAccuracy: string; + fixedInterestRateAccuracy: string; + minFixedInterestRate: string; + maxFixedInterestRate: string; +} +⋮---- +export interface SpotMarginStateV5 { + spotLeverage: string; + spotMarginMode: '1' | '0'; + effectiveLeverage: string; +} +⋮---- +// Spot Margin Trade (UTA) response types +export interface ManualBorrowResultV5 { + coin: string; + amount: string; +} +⋮---- +export interface MaxBorrowableAmountV5 { + currency: string; + /** + * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or + * when no collateral coins are enabled. The app can still show a borrow + * amount after a collateral coin is selected. Undocumented; Bybit API staff + * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, + * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and + * `toggleSpotMarginTrade()` first. + */ + maxLoan: string; +} +⋮---- +/** + * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or + * when no collateral coins are enabled. The app can still show a borrow + * amount after a collateral coin is selected. Undocumented; Bybit API staff + * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, + * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and + * `toggleSpotMarginTrade()` first. + */ +⋮---- +export interface PositionTierV5 { + tier: string; + borrowLimit: string; + positionMMR: string; + positionIMR: string; + maxLeverage: string; +} +⋮---- +export interface CurrencyPositionTiersV5 { + currency: string; + positionTiersRatioList: PositionTierV5[]; +} +⋮---- +export interface CoinStateV5 { + currency: string; + spotLeverage: string; +} +⋮---- +export interface AvailableAmountToRepayV5 { + currency: string; + lossLessRepaymentAmount: string; +} +⋮---- +export interface ManualRepayWithoutConversionResultV5 { + /** + * Result status: + * - P: Processing + * - SU: Success + * - FA: Failed + */ + resultStatus: 'P' | 'SU' | 'FA'; +} +⋮---- +/** + * Result status: + * - P: Processing + * - SU: Success + * - FA: Failed + */ +⋮---- +export interface AutoRepayModeItemV5 { + currency: string; // Coin name, uppercase only + autoRepayMode: '0' | '1'; // 0: Off, 1: On +} +⋮---- +currency: string; // Coin name, uppercase only +autoRepayMode: '0' | '1'; // 0: Off, 1: On +⋮---- +export interface AutoRepayModeResultV5 { + data: AutoRepayModeItemV5[]; +} +⋮---- +export interface SpotMarginLiabilityInfoV5 { + currency: string; + totalBorrowAmount: string; + fixedBorrowAmount: string; + flexibleBorrowAmount: string; + spotTotalBorrow: string; + derivativesBorrow: string; +} +⋮---- +export interface FixedRateBorrowResultV5 { + orderId: string; +} +⋮---- +export interface FixedRateBorrowOrderInfoV5 { + annualRate: string; + orderId: string; + orderTime: string; + filledQty: string; + orderQty: string; + orderCurrency: string; + state: number; + term: number; + repayType: string; + strategyType: 'PARTIAL' | 'FULL'; +} +⋮---- +export interface FixedRateBorrowContractInfoV5 { + annualRate: string; + borrowCurrency: string; + borrowTime: string; + interestPaid: string; + loanId: string; + orderId: string; + repaymentTime: string; + residualPenaltyInterest: string; + residualPrincipal: string; + status: number; + term: string; + repayType: string; + strategyType: 'PARTIAL' | 'FULL'; +} +⋮---- +export interface FixedRateBorrowQuoteV5 { + orderCurrency: string; + term: number; + annualRate: string; + qty: string; +} +⋮---- +export interface FixedRateBorrowInterestAccruedV5 { + refId: string; + currency: string; + orderId: string; + loanAmt: string; + interest: string; + interestRate: string; + ts: string; +} +⋮---- +export interface FlexibleAvailableInventoryV5 { + currency: string; + availableInventory: string; + updateTime: string; +} +⋮---- +export interface FixedRateAvailableInventoryV5 { + currency: string; + term: string; + annualRate: string; + availableInventory: string; + updateTime: string; +} + +================ +File: src/types/websockets/ws-general.ts +================ +import { AxiosRequestConfig } from 'axios'; +import type { ClientRequestArgs } from 'http'; +import WebSocket from 'isomorphic-ws'; +⋮---- +import { APIRegion, RestClientOptions, WS_KEY_MAP } from '../../util'; +⋮---- +/** For spot markets, spotV3 is recommended */ +export type APIMarket = 'v5'; +⋮---- +// Same as inverse futures +export type WsPublicInverseTopic = + | 'orderBookL2_25' + | 'orderBookL2_200' + | 'trade' + | 'insurance' + | 'instrument_info' + | 'klineV2'; +⋮---- +export type WsPublicUSDTPerpTopic = | 'orderBookL2_25' | 'orderBookL2_200' | 'trade' @@ -15036,1510 +15057,1542 @@ File: src/types/request/index.ts ================ -File: src/types/request/v5-market.ts +File: src/types/response/index.ts ================ -import { KlineIntervalV3 } from '../shared'; -import { - CategoryV5, - InstrumentStatusV5, - InstrumentSymbolTypeV5, - OptionTypeV5, -} from '../shared-v5'; + + +================ +File: src/types/shared-v5.ts +================ +export type CategoryV5 = 'spot' | 'linear' | 'inverse' | 'option'; +/** Public WS subscribe/routing category. Event Contract uses `'event'`; REST `CategoryV5` does not. */ +export type WSCategoryV5 = CategoryV5 | 'event'; +export type ContractTypeV5 = + | 'InversePerpetual' + | 'LinearPerpetual' + | 'InverseFutures'; +export type CopyTradingV5 = 'none' | 'both' | 'utaOnly' | 'normalOnly'; ⋮---- -export interface GetKlineParamsV5 { - category: 'spot' | 'linear' | 'inverse'; - symbol: string; - interval: KlineIntervalV3; - start?: number; - end?: number; - limit?: number; -} -⋮---- -export interface GetMarkPriceKlineParamsV5 { - /** - * linear (default if omitted), inverse, or option. - */ - category?: 'linear' | 'inverse' | 'option'; - symbol: string; - interval: KlineIntervalV3; - start?: number; - end?: number; - /** - * Futures: [1, 1000], default 200. Options: [1, 500], default 200. - */ - limit?: number; -} +export type InstrumentStatusV5 = + | 'PreLaunch' + | 'PendingOpen' + | 'Trading' + | 'Settling' + | 'Delivering' + | 'Closed'; ⋮---- /** - * linear (default if omitted), inverse, or option. - */ + * Region / product class returned as `symbolType` on instruments-info (and account instruments-info). + * For `category=linear`, includes e.g. `stock`, `forex`, `commodity`, `xstocks`. Spot may return `''`. + */ +export type InstrumentSymbolTypeV5 = + | '' + | 'stock' + | 'forex' + | 'commodity' + | 'xstocks'; ⋮---- -/** - * Futures: [1, 1000], default 200. Options: [1, 500], default 200. - */ +export type MarginTradingV5 = 'none' | 'both' | 'utaOnly' | 'normalSpotOnly'; ⋮---- -export interface GetIndexPriceKlineParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - interval: KlineIntervalV3; - start?: number; - end?: number; - limit?: number; -} +/** Product type for strategy APIs (create / list). */ +export type StrategyCategoryV5 = + | 'UTA_USDT' + | 'UTA_USDC' + | 'UTA_USDC_FUTURE' + | 'UTA_SPOT' + | 'UTA_INVERSE' + | 'UTA_INVERSE_FUTURE' + | 'UTA_USDT_FUTURE'; ⋮---- -export interface GetPremiumIndexPriceKlineParamsV5 { - category: 'linear'; - symbol: string; - interval: KlineIntervalV3; - start?: number; - end?: number; - limit?: number; -} +export type StrategyTypeV5 = 'twap' | 'chaseOrder' | 'iceberg' | 'pov'; ⋮---- -export interface GetInstrumentsInfoParamsV5 { - category: CategoryV5; - symbol?: string; - /** Filter by instrument `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ - symbolType?: InstrumentSymbolTypeV5; - status?: InstrumentStatusV5; - /** For `category=option`, pass `All` to return all option symbols. */ - baseCoin?: string; - limit?: number; - cursor?: string; -} +export type StrategyPreferV5 = + | 'limit' + | 'priceSpeedBalance' + | 'fastestExecution' + | 'quickExecution'; ⋮---- -/** Filter by instrument `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ +/** POV strategy execution mode */ +export type PovModeV5 = + | 'TradedVolume' + | 'OppositeSideLiquidity' + | 'SameSideLiquidity'; ⋮---- -/** For `category=option`, pass `All` to return all option symbols. */ +export type OrderFilterV5 = 'Order' | 'tpslOrder' | 'StopOrder'; +export type OrderSideV5 = 'Buy' | 'Sell'; +export type OrderTypeV5 = 'Market' | 'Limit'; +export type OrderTimeInForceV5 = 'GTC' | 'IOC' | 'FOK' | 'PostOnly' | 'RPI'; +export type OrderTriggerByV5 = 'LastPrice' | 'IndexPrice' | 'MarkPrice'; +export type OCOTriggerTypeV5 = + | 'OcoTriggerByUnknown' + | 'OcoTriggerTp' + | 'OcoTriggerBySl'; +⋮---- +export type OrderSMPTypeV5 = + | 'None' + | 'CancelMaker' + | 'CancelTaker' + | 'CancelBoth'; +⋮---- +export type OrderStatusV5 = + | 'Created' + | 'New' + | 'Rejected' + | 'PartiallyFilled' + | 'PartiallyFilledCanceled' + | 'Filled' + | 'Cancelled' + | 'Untriggered' + | 'Triggered' + | 'Deactivated' + | 'Active'; ⋮---- /** - * GET /v5/market/instrument-summary - * - * `category` is required. Page with `cursor` = previous `nextPageCursor`. + * Defines the types of order creation mechanisms. */ -export interface GetInstrumentSummaryParamsV5 { - /** Product type. `linear` or `option`. */ - category: 'linear' | 'option'; - symbol?: string; - /** Instrument type. */ - symbolType?: string; - /** Market region, for example `HK`, `US`, `CN`, `KR`. */ - marketRegion?: string; - /** Base coin, for example `NVDA` or `TSLA`. */ - baseCoin?: string; - /** Page size. Range [1, 1000]. Default 500. */ - limit?: number; - /** Cursor. Use `nextPageCursor` from the previous response. */ - cursor?: string; -} +export type OrderCreateTypeV5 = + /** Represents an order created by a user. */ + | 'CreateByUser' + /** Represents an order created by an admin closing. */ + | 'CreateByAdminClosing' + /** Futures conditional order. */ + | 'CreateByStopOrder' + /** Futures take profit order. */ + | 'CreateByTakeProfit' + /** Futures partial take profit order. */ + | 'CreateByPartialTakeProfit' + /** Futures stop loss order. */ + | 'CreateByStopLoss' + /** Futures partial stop loss order. */ + | 'CreateByPartialStopLoss' + /** Futures trailing stop order. */ + | 'CreateByTrailingStop' + /** Laddered liquidation to reduce the required maintenance margin. */ + | 'CreateByLiq' + /** + * If the position is still subject to liquidation (i.e., does not meet the required maintenance margin level), + * the position shall be taken over by the liquidation engine and closed at the bankruptcy price. + */ + | 'CreateByTakeOver_PassThrough' + /** Auto-Deleveraging(ADL) */ + | 'CreateByAdl_PassThrough' + /** Order placed via Paradigm. */ + | 'CreateByBlock_PassThrough' + /** Order created by move position. */ + | 'CreateByBlockTradeMovePosition_PassThrough' + /** The close order placed via web or app position area - web/app. */ + | 'CreateByClosing' + /** Order created via grid bot - web/app. */ + | 'CreateByFGridBot' + /** Order closed via grid bot - web/app. */ + | 'CloseByFGridBot' + /** Order created by TWAP - web/app. */ + | 'CreateByTWAP' + /** Order created by TV webhook - web/app. */ + | 'CreateByTVSignal' + /** Order created by Mm rate close function - web/app. */ + | 'CreateByMmRateClose' + /** Order created by Martingale bot - web/app. */ + | 'CreateByMartingaleBot' + /** Order closed by Martingale bot - web/app. */ + | 'CloseByMartingaleBot' + /** Order created by Ice berg strategy - web/app. */ + | 'CreateByIceBerg' + /** Order created by arbitrage - web/app. */ + | 'CreateByArbitrage' + /** Option dynamic delta hedge order - web/app */ + | 'CreateByDdh' + /** BBO Order - Best Bid/Offer order */ + | 'CreateByBboOrder'; ⋮---- -/** Product type. `linear` or `option`. */ +/** Represents an order created by a user. */ ⋮---- -/** Instrument type. */ +/** Represents an order created by an admin closing. */ ⋮---- -/** Market region, for example `HK`, `US`, `CN`, `KR`. */ +/** Futures conditional order. */ ⋮---- -/** Base coin, for example `NVDA` or `TSLA`. */ +/** Futures take profit order. */ ⋮---- -/** Page size. Range [1, 1000]. Default 500. */ +/** Futures partial take profit order. */ ⋮---- -/** Cursor. Use `nextPageCursor` from the previous response. */ +/** Futures stop loss order. */ ⋮---- -export interface GetOrderbookParamsV5 { - category: CategoryV5; - symbol: string; - limit?: number; -} +/** Futures partial stop loss order. */ ⋮---- -export interface GetRPIOrderbookParamsV5 { - category?: 'spot' | 'linear' | 'inverse'; - symbol: string; - limit: number; // Required for RPI orderbook, [1, 50] -} +/** Futures trailing stop order. */ ⋮---- -limit: number; // Required for RPI orderbook, [1, 50] +/** Laddered liquidation to reduce the required maintenance margin. */ ⋮---- -export interface GetIndexPriceComponentsParamsV5 { - indexName: string; // Index name, like BTCUSDT -} +/** + * If the position is still subject to liquidation (i.e., does not meet the required maintenance margin level), + * the position shall be taken over by the liquidation engine and closed at the bankruptcy price. + */ ⋮---- -indexName: string; // Index name, like BTCUSDT +/** Auto-Deleveraging(ADL) */ ⋮---- -export interface GetADLAlertParamsV5 { - symbol?: string; // Contract name, e.g. BTCUSDT. Uppercase only -} +/** Order placed via Paradigm. */ ⋮---- -symbol?: string; // Contract name, e.g. BTCUSDT. Uppercase only +/** Order created by move position. */ ⋮---- -export interface GetFeeGroupStructureParamsV5 { - productType: string; // Product type. contract only for now - groupId?: string; // Group ID. 1, 2, 3, 4, 5, 6, 7 -} +/** The close order placed via web or app position area - web/app. */ ⋮---- -productType: string; // Product type. contract only for now -groupId?: string; // Group ID. 1, 2, 3, 4, 5, 6, 7 +/** Order created via grid bot - web/app. */ ⋮---- -export interface GetTickersParamsV5 { - category: TCategory; - symbol?: string; - baseCoin?: string; - expDate?: string; -} +/** Order closed via grid bot - web/app. */ ⋮---- -export interface GetFundingRateHistoryParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - startTime?: number; - endTime?: number; - limit?: number; -} +/** Order created by TWAP - web/app. */ ⋮---- -export interface GetPublicTradingHistoryParamsV5 { - category: CategoryV5; - symbol: string; - baseCoin?: string; - optionType?: OptionTypeV5; - limit?: number; -} +/** Order created by TV webhook - web/app. */ ⋮---- -export type OpenInterestIntervalV5 = - | '5min' - | '15min' - | '30min' - | '1h' - | '4h' - | '1d'; -⋮---- -export interface GetOpenInterestParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - intervalTime: OpenInterestIntervalV5; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} +/** Order created by Mm rate close function - web/app. */ ⋮---- -export interface GetHistoricalVolatilityParamsV5 { - category: 'option'; - baseCoin?: string; - period?: 7 | 14 | 21 | 30 | 60 | 90 | 180 | 270; - startTime?: number; - endTime?: number; -} +/** Order created by Martingale bot - web/app. */ ⋮---- -export interface GetInsuranceParamsV5 { - coin?: string; -} +/** Order closed by Martingale bot - web/app. */ ⋮---- -export interface GetRiskLimitParamsV5 { - category?: 'linear' | 'inverse'; - symbol?: string; - cursor?: string; -} +/** Order created by Ice berg strategy - web/app. */ ⋮---- -export interface GetOptionDeliveryPriceParamsV5 { - category: 'option'; - symbol?: string; - baseCoin?: string; - limit?: number; - cursor?: string; -} +/** Order created by arbitrage - web/app. */ ⋮---- -export interface GetDeliveryPriceParamsV5 { - category: 'linear' | 'inverse' | 'option'; - symbol?: string; - baseCoin?: string; - settleCoin?: string; - limit?: number; - cursor?: string; -} +/** Option dynamic delta hedge order - web/app */ ⋮---- -export interface GetLongShortRatioParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - period: OpenInterestIntervalV5; - startTime?: string; - endTime?: string; - limit?: number; - cursor?: string; -} +/** BBO Order - Best Bid/Offer order */ ⋮---- -export interface GetFullDepthOrderbookParamsV5 { - category: 'spot' | 'linear' | 'inverse'; - symbol: string; -} +export type OrderCancelTypeV5 = + | 'CancelByUser' + | 'CancelByReduceOnly' + | 'CancelByPrepareLiq' + | 'CancelAllBeforeLiq' + | 'CancelByPrepareAdl' + | 'CancelAllBeforeAdl' + | 'CancelByAdmin' + | 'CancelByTpSlTsClear' + | 'CancelByPzSideCh' + | 'UNKNOWN'; ⋮---- -export interface GetOptionBaseCoinsParamsV5 { - /** - * Comma-separated underlying types. - * 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil. Omit to return all types. - */ - underlyingType?: string; -} +export type OrderRejectReasonV5 = + | 'EC_NoError' + | 'EC_Others' + | 'EC_UnknownMessageType' + | 'EC_MissingClOrdID' + | 'EC_MissingOrigClOrdID' + | 'EC_ClOrdIDOrigClOrdIDAreTheSame' + | 'EC_DuplicatedClOrdID' + | 'EC_OrigClOrdIDDoesNotExist' + | 'EC_TooLateToCancel' + | 'EC_UnknownOrderType' + | 'EC_UnknownSide' + | 'EC_UnknownTimeInForce' + | 'EC_WronglyRouted' + | 'EC_MarketOrderPriceIsNotZero' + | 'EC_LimitOrderInvalidPrice' + | 'EC_NoEnoughQtyToFill' + | 'EC_NoImmediateQtyToFill' + | 'EC_PerCancelRequest' + | 'EC_MarketOrderCannotBePostOnly' + | 'EC_PostOnlyWillTakeLiquidity' + | 'EC_CancelReplaceOrder' + | 'EC_InvalidSymbolStatus'; ⋮---- -/** - * Comma-separated underlying types. - * 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil. Omit to return all types. - */ - -================ -File: src/types/response/index.ts -================ - - -================ -File: src/types/response/v5-market.ts -================ -import { - CategoryCursorListV5, - CategoryV5, - ContractTypeV5, - CopyTradingV5, - InstrumentStatusV5, - InstrumentSymbolTypeV5, - MarginTradingV5, - OptionTypeV5, - OrderSideV5, -} from '../shared-v5'; +export type StopOrderTypeV5 = + | 'TakeProfit' + | 'StopLoss' + | 'TrailingStop' + | 'Stop' + | 'PartialTakeProfit' + | 'PartialStopLoss' + | 'tpslOrder' + | 'OcoOrder' + | 'MmRateClose' + | 'BidirectionalTpslOrder'; ⋮---- /** - * OHLCVT candle used by v5 APIs + * Position index. Used to identify positions in different position modes. * - * - list[0]: startTime string Start time of the candle (ms) - * - list[1]: openPrice string Open price - * - list[2]: highPrice string Highest price - * - list[3]: lowPrice string Lowest price - * - list[4]: closePrice string Close price. Is the last traded price when the candle is not closed - * - list[5]: volume string Trade volume. Unit of contract: pieces of contract. Unit of spot: quantity of coins - * - list[6]: turnover string Turnover. Unit of figure: quantity of quota coin + * - 0 one-way mode position + * - 1 Buy side of hedge-mode position + * - 2 Sell side of hedge-mode position */ -export type OHLCVKlineV5 = [ - string, - string, - string, - string, - string, - string, - string, -]; +export type PositionIdx = 0 | 1 | 2; ⋮---- /** - * OHLC candle used by v5 APIs + * Position status. * - * - list[0]: startTime string Start time of the candle (ms) - * - list[1]: openPrice string Open price - * - list[2]: highPrice string Highest price - * - list[3]: lowPrice string Lowest price - * - list[4]: closePrice string Close price. Is the last traded price when the candle is not closed + * - 'Normal' + * - 'Liq' in the liquidation progress + * - 'Adl' in the auto-deleverage progress */ -export type OHLCKlineV5 = [string, string, string, string, string]; -⋮---- -export interface LinearInverseInstrumentInfoV5 { - /** The ID of the symbol name. */ - symbolId: number; - symbol: string; - contractType: ContractTypeV5; - status: InstrumentStatusV5; - baseCoin: string; - quoteCoin: string; - /** Region / product class for the pair (`stock`, `forex`, `commodity`, `xstocks`, etc.). */ - symbolType: InstrumentSymbolTypeV5; - launchTime: string; - deliveryTime?: string; - deliveryFeeRate?: string; - priceScale: string; - leverageFilter: { - minLeverage: string; - maxLeverage: string; - leverageStep: string; - }; - priceFilter: { - minPrice: string; - maxPrice: string; - tickSize: string; - }; - lotSizeFilter: { - maxOrderQty: string; - maxMktOrderQty: string; - minOrderQty: string; - qtyStep: string; - postOnlyMaxOrderQty?: string; - minNotionalValue?: string; - }; - unifiedMarginTrade: boolean; - fundingInterval: number; - settleCoin: string; - copyTrading: CopyTradingV5; - upperFundingRate: string; - lowerFundingRate: string; - riskParameters: { - priceLimitRatioX: string; - priceLimitRatioY: string; - }; - isPreListing: boolean; - preListingInfo: { - curAuctionPhase: string; - phases: { - phase: string; - startTime: string; - endTime: string; - }[]; - auctionFeeInfo: { - auctionFeeRate: string; - takerFeeRate: string; - makerFeeRate: string; - }; - } | null; - skipCallAuction?: boolean; // For USDT pre-market contract - displayName: string; - fullName?: string; - marketRegion?: string; - underlyingTicker?: string; - /** Symbol tags such as `ST`. Linear and inverse only. */ - tags?: string[]; -} +export type PositionStatusV5 = 'Normal' | 'Liq' | 'Adl'; +export type PositionSideV5 = 'Buy' | 'Sell' | 'None' | ''; ⋮---- -/** The ID of the symbol name. */ +export type OptionTypeV5 = 'Call' | 'Put'; ⋮---- -/** Region / product class for the pair (`stock`, `forex`, `commodity`, `xstocks`, etc.). */ +/** + * Trade mode. + * + * - 0 cross-margin, + * - 1 isolated margin + */ +export type TradeModeV5 = 0 | 1; ⋮---- -skipCallAuction?: boolean; // For USDT pre-market contract +export type TPSLModeV5 = 'Full' | 'Partial'; +export type AccountMarginModeV5 = + | 'ISOLATED_MARGIN' + | 'REGULAR_MARGIN' + | 'PORTFOLIO_MARGIN'; +export type UnifiedUpdateStatusV5 = 'FAIL' | 'PROCESS' | 'SUCCESS'; ⋮---- -/** Symbol tags such as `ST`. Linear and inverse only. */ -⋮---- -export interface OptionInstrumentInfoV5 { - /** The ID of the symbol name. */ - symbolId: number; - symbol: string; - optionsType: OptionTypeV5; - status: InstrumentStatusV5; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - symbolType: InstrumentSymbolTypeV5; - launchTime: string; - deliveryTime: string; - deliveryFeeRate: string; - priceFilter: { - minPrice: string; - maxPrice: string; - tickSize: string; - }; - lotSizeFilter: { - maxOrderQty: string; - minOrderQty: string; - qtyStep: string; - }; - displayName: string; -} -⋮---- -/** The ID of the symbol name. */ +export type AccountTypeV5 = + | 'CONTRACT' + | 'SPOT' + | 'INVESTMENT' + | 'OPTION' + | 'UNIFIED' + | 'FUND' + | 'EARN'; ⋮---- -export interface SpotInstrumentInfoV5 { - /** The ID of the symbol name. */ - symbolId: number; - symbol: string; - baseCoin: string; - quoteCoin: string; +export type TransactionTypeV5 = + | 'TRANSFER_IN' + | 'TRANSFER_OUT' + | 'TRADE' + | 'SETTLEMENT' + | 'DELIVERY' + | 'LIQUIDATION' + | 'ADL' + | 'AIRDROP' + | 'BONUS_RECOLLECT' + | 'BONUS_RECOLLECT' + | 'FEE_REFUND' + | 'INTEREST' + | 'CURRENCY_BUY' + | 'CURRENCY_SELL' + | 'BORROWED_AMOUNT_INS_LOAN' + | 'PRINCIPLE_REPAYMENT_INS_LOAN' + | 'INTEREST_REPAYMENT_INS_LOAN' + | 'AUTO_SOLD_COLLATERAL_INS_LOAN' + | 'AUTO_BUY_LIABILITY_INS_LOAN' + | 'AUTO_PRINCIPLE_REPAYMENT_INS_LOAN' + | 'AUTO_INTEREST_REPAYMENT_INS_LOAN' + | 'TRANSFER_IN_INS_LOAN' + | 'TRANSFER_OUT_INS_LOAN' + | 'SPOT_REPAYMENT_SELL' + | 'SPOT_REPAYMENT_BUY' + | 'TOKENS_SUBSCRIPTION' + | 'TOKENS_REDEMPTION' + | 'AUTO_DEDUCTION' + | 'FLEXIBLE_STAKING_SUBSCRIPTION' + | 'FLEXIBLE_STAKING_REDEMPTION' + | 'FIXED_STAKING_SUBSCRIPTION' + | 'BORROWED_AMOUNT_INS_LOAN' + | 'PRINCIPLE_REPAYMENT_INS_LOAN' + | 'INTEREST_REPAYMENT_INS_LOAN' + | 'AUTO_SOLD_COLLATERAL_INS_LOAN' + | 'AUTO_BUY_LIABILITY_INS_LOAN' + | 'AUTO_PRINCIPLE_REPAYMENT_INS_LOAN' + | 'AUTO_INTEREST_REPAYMENT_INS_LOAN' + | 'TRANSFER_IN_INS_LOAN' + | 'TRANSFER_OUT_INS_LOAN' + | 'SPOT_REPAYMENT_SELL' + | 'SPOT_REPAYMENT_BUY' + | 'TOKENS_SUBSCRIPTION' + | 'TOKENS_REDEMPTION' + | 'AUTO_DEDUCTION' + | 'FLEXIBLE_STAKING_SUBSCRIPTION' + | 'FLEXIBLE_STAKING_REDEMPTION' + | 'FIXED_STAKING_SUBSCRIPTION' + | 'FLEXIBLE_STAKING_REFUND' + | 'FIXED_STAKING_REFUND' + | 'PREMARKET_TRANSFER_OUT' + | 'PREMARKET_DELIVERY_SELL_NEW_COIN' + | 'PREMARKET_DELIVERY_BUY_NEW_COIN' + | 'PREMARKET_DELIVERY_PLEDGE_PAY_SELLER' + | 'PREMARKET_DELIVERY_PLEDGE_BACK' + | 'PREMARKET_ROLLBACK_PLEDGE_BACK' + | 'PREMARKET_ROLLBACK_PLEDGE_PENALTY_TO_BUYER' + | 'CUSTODY_NETWORK_FEE' + | 'CUSTODY_SETTLE_FEE' + | 'CUSTODY_LOCK' + | 'CUSTODY_UNLOCK' + | 'CUSTODY_UNLOCK_REFUND' + | 'LOANS_BORROW_FUNDS' + | 'LOANS_PLEDGE_ASSET' + | 'BONUS_TRANSFER_IN' + | 'BONUS_TRANSFER_OUT' + | 'PEF_TRANSFER_IN' + | 'PEF_TRANSFER_OUT' + | 'PEF_PROFIT_SHARE' + | 'ONCHAINEARN_SUBSCRIPTION' + | 'ONCHAINEARN_REDEMPTION' + | 'ONCHAINEARN_REFUND' + | 'STRUCTURE_PRODUCT_SUBSCRIPTION' + | 'STRUCTURE_PRODUCT_REFUND' + | 'CLASSIC_WEALTH_MANAGEMENT_SUBSCRIPTION' + | 'PREMIMUM_WEALTH_MANAGEMENT_SUBSCRIPTION' + | 'PREMIMUM_WEALTH_MANAGEMENT_REFUND' + | 'LIQUIDITY_MINING_SUBSCRIPTION' + | 'LIQUIDITY_MINING_REFUND' + | 'PWM_SUBSCRIPTION' + | 'PWM_REFUND' + | 'DEFI_INVESTMENT_SUBSCRIPTION' + | 'DEFI_INVESTMENT_REFUND' + | 'DEFI_INVESTMENT_REDEMPTION' + | 'INSTITUTION_LOAN_IN' + | 'INSTITUTION_PAYBACK_PRINCIPAL_OUT' + | 'INSTITUTION_PAYBACK_INTEREST_OUT' + | 'INSTITUTION_EXCHANGE_SELL' + | 'INSTITUTION_EXCHANGE_BUY' + | 'INSTITUTION_LIQ_PRINCIPAL_OUT' + | 'INSTITUTION_LIQ_INTEREST_OUT' + | 'INSTITUTION_LOAN_TRANSFER_IN' + | 'INSTITUTION_LOAN_TRANSFER_OUT' + | 'INSTITUTION_LOAN_WITHOUT_WITHDRAW' + | 'INSTITUTION_LOAN_RESERVE_IN' + | 'INSTITUTION_LOAN_RESERVE_OUT' + | 'PLATFORM_TOKEN_MNT_LIQRECALLEDMMNT' + | 'PLATFORM_TOKEN_MNT_LIQRETURNEDMNT' + | 'DIVIDEND_SETTLEMENT' /** - * Xstock multiplier for `symbolType` = xstocks pairs. `stock_price = token_price / multiplier`, - * `stock_qty = token_qty * multiplier`. Default `"1"`. + * Forward stock split settlement. Closes the entire existing position; the + * new position is opened as `FORWARD_SPLIT_OPEN`. + * + * Changelog 2026-10-13 updated this description. The enum glossary still + * lists the older wording "fractional share settlement". */ - xstockMultiplier?: string; - symbolType: InstrumentSymbolTypeV5; - innovation: '0' | '1'; // Deprecated, always 0 - status: InstrumentStatusV5; - marginTrading: MarginTradingV5; - stTag: '0' | '1'; - lotSizeFilter: { - basePrecision: string; - quotePrecision: string; - /** - * @deprecated Spot order size is enforced by `minOrderAmt` only. - * Bybit API staff confirmed on 15 Oct 2026 that `minOrderQty` no longer - * applies for spot. Undocumented: broker and CCXT users have a 1 USDT - * minimum; direct API users have a 5 USDT minimum. - */ - minOrderQty: string; - maxOrderQty: string; - /** - * Minimum order amount in the quote coin. This is the spot minimum that - * applies. Undocumented; Bybit API staff confirmed on 15 Oct 2026 that - * broker and CCXT users have a 1 USDT minimum, and direct API users have - * a 5 USDT minimum. - */ - minOrderAmt: string; - maxOrderAmt: string; - maxLimitOrderQty: string; - maxMarketOrderQty: string; - postOnlyMaxLimitOrderSize: string; - }; - priceFilter: { - tickSize: string; - }; - riskParameters: { - priceLimitRatioX: string; - priceLimitRatioY: string; - }; - forbidUplWithdrawal: boolean; -} -⋮---- -/** The ID of the symbol name. */ + | 'FORWARD_SPLIT_SETTLE' + /** Forward stock split position opening after the existing position is settled and closed. */ + | 'FORWARD_SPLIT_OPEN' + /** + * Reverse stock split settlement. Closes the entire existing position; the + * new position is opened as `REVERSE_SPLIT_OPEN`. + * + * Changelog 2026-10-13 updated this description. The enum glossary still + * lists the older wording "fractional share settlement". + */ + | 'REVERSE_SPLIT_SETTLE' + /** Reverse stock split position opening after the existing position is settled and closed. */ + | 'REVERSE_SPLIT_OPEN'; ⋮---- /** - * Xstock multiplier for `symbolType` = xstocks pairs. `stock_price = token_price / multiplier`, - * `stock_qty = token_qty * multiplier`. Default `"1"`. + * Forward stock split settlement. Closes the entire existing position; the + * new position is opened as `FORWARD_SPLIT_OPEN`. + * + * Changelog 2026-10-13 updated this description. The enum glossary still + * lists the older wording "fractional share settlement". */ ⋮---- -innovation: '0' | '1'; // Deprecated, always 0 -⋮---- -/** - * @deprecated Spot order size is enforced by `minOrderAmt` only. - * Bybit API staff confirmed on 15 Oct 2026 that `minOrderQty` no longer - * applies for spot. Undocumented: broker and CCXT users have a 1 USDT - * minimum; direct API users have a 5 USDT minimum. - */ +/** Forward stock split position opening after the existing position is settled and closed. */ ⋮---- /** - * Minimum order amount in the quote coin. This is the spot minimum that - * applies. Undocumented; Bybit API staff confirmed on 15 Oct 2026 that - * broker and CCXT users have a 1 USDT minimum, and direct API users have - * a 5 USDT minimum. - */ + * Reverse stock split settlement. Closes the entire existing position; the + * new position is opened as `REVERSE_SPLIT_OPEN`. + * + * Changelog 2026-10-13 updated this description. The enum glossary still + * lists the older wording "fractional share settlement". + */ ⋮---- -type InstrumentInfoV5Mapping = { - linear: LinearInverseInstrumentInfoV5[]; - inverse: LinearInverseInstrumentInfoV5[]; - option: OptionInstrumentInfoV5[]; - spot: SpotInstrumentInfoV5[]; -}; +/** Reverse stock split position opening after the existing position is settled and closed. */ ⋮---- -export type InstrumentInfoResponseV5 = - CategoryCursorListV5; +export type PermissionTypeV5 = + | 'ContractTrade' + | 'Spot' + | 'Wallet' + | 'Options' + | 'Derivatives' + | 'Exchange' + | 'NFT'; ⋮---- /** - * One row from GET /v5/market/instrument-summary. + * Leveraged token status: * - * Several fields are an empty string when they do not apply (`fullName`, - * `marketRegion`, and `underlyingTicker` for option; `priceIndex` for linear). + * - '1' LT can be purchased and redeemed + * - '2' LT can be purchased, but not redeemed + * - '3' LT can be redeemed, but not purchased + * - '4' LT cannot be purchased nor redeemed + * - '5' Adjusting position */ -export interface InstrumentSummaryV5 { - symbol: string; - /** Instrument type. May be an empty string. */ - symbolType: string; - /** Display name shown in the UI. */ - displayName: string; - baseCoin: string; - settleCoin: string; - /** Full name. Empty string for `option`. */ - fullName: string; - /** - * Market region of the underlying asset (`US`, `CN`, `HK`, `KR`, and others). - * Empty string for `option` or when not applicable. - */ - marketRegion: string; +export type LeverageTokenStatusV5 = '1' | '2' | '3' | '4' | '5'; +⋮---- +/** + * Leveraged token order type: '1': purchase, '2': redeem + */ +export type LTOrderTypeV5 = '1' | '2'; +⋮---- +/** + * Leveraged token order status: '1': completed, '2': in progress, '3': failed + */ +export type LTOrderStatusV5 = '1' | '2' | '3'; +⋮---- +export type ExecTypeV5 = + | 'Trade' + | 'AdlTrade' + | 'Funding' + | 'BustTrade' + | 'Settle' + | 'BlockTrade' + | 'MovePosition' + /** @deprecated Removed from Bybit execType; kept for older payloads. */ + | 'CorporateAction' /** - * Stock ticker, security code, or asset symbol in the underlying market. - * Empty string for `option`. + * Forward stock split settlement and closure of the entire existing position, + * followed by opening a new position (`ForwardSplitOpen`). */ - underlyingTicker: string; + | 'ForwardSplitSettle' + /** Forward stock split position opening after the existing position is settled and closed. */ + | 'ForwardSplitOpen' /** - * TradFi perpetual symbol used as the price index. NVDA options use `NVDAUSDT`. - * Empty string for `linear`. + * Reverse stock split settlement and closure of the entire existing position, + * followed by opening a new position (`ReverseSplitOpen`). */ - priceIndex: string; - qtyStep: string; - tickSize: string; - /** Delivery timestamp in milliseconds. `"0"` for `linear`. */ - deliveryTime: string; -} -⋮---- -/** Instrument type. May be an empty string. */ -⋮---- -/** Display name shown in the UI. */ + | 'ReverseSplitSettle' + /** Reverse stock split position opening after the existing position is settled and closed. */ + | 'ReverseSplitOpen' + | 'Dividend' + | 'UNKNOWN'; ⋮---- -/** Full name. Empty string for `option`. */ +/** @deprecated Removed from Bybit execType; kept for older payloads. */ ⋮---- /** - * Market region of the underlying asset (`US`, `CN`, `HK`, `KR`, and others). - * Empty string for `option` or when not applicable. + * Forward stock split settlement and closure of the entire existing position, + * followed by opening a new position (`ForwardSplitOpen`). */ ⋮---- -/** - * Stock ticker, security code, or asset symbol in the underlying market. - * Empty string for `option`. - */ +/** Forward stock split position opening after the existing position is settled and closed. */ ⋮---- /** - * TradFi perpetual symbol used as the price index. NVDA options use `NVDAUSDT`. - * Empty string for `linear`. + * Reverse stock split settlement and closure of the entire existing position, + * followed by opening a new position (`ReverseSplitOpen`). */ ⋮---- -/** Delivery timestamp in milliseconds. `"0"` for `linear`. */ -⋮---- -export type InstrumentSummaryResponseV5 = CategoryCursorListV5< - InstrumentSummaryV5[], - 'linear' | 'option' ->; -⋮---- -// Account Instruments Info (includes RPI permissions) -export interface AccountSpotInstrumentInfoV5 extends SpotInstrumentInfoV5 { - isPublicRpi: boolean; - myRpiPermission: boolean; -} -⋮---- -export interface AccountLinearInverseInstrumentInfoV5 - extends LinearInverseInstrumentInfoV5 { - isPublicRpi: boolean; - myRpiPermission: boolean; -} -⋮---- -type AccountInstrumentInfoV5Mapping = { - linear: AccountLinearInverseInstrumentInfoV5[]; - inverse: AccountLinearInverseInstrumentInfoV5[]; - spot: AccountSpotInstrumentInfoV5[]; -}; -⋮---- -export type AccountInstrumentInfoResponseV5< - C extends 'spot' | 'linear' | 'inverse', -> = CategoryCursorListV5; -⋮---- -/** - * [price, size] - */ -export type OrderbookLevelV5 = [string, string]; -⋮---- -export interface OrderbookResponseV5 { - s: string; - b: OrderbookLevelV5[]; - a: OrderbookLevelV5[]; - ts: number; - u: number; - seq: number; - cts: number; -} +/** Reverse stock split position opening after the existing position is settled and closed. */ ⋮---- /** - * RPI Orderbook level: [price, nonRpiSize, rpiSize] + * Withdraw type. 0(default): on chain. 1: off chain. 2: all. */ -export type RPIOrderbookLevelV5 = [string, string, string]; -⋮---- -export interface RPIOrderbookResponseV5 { - s: string; // Symbol name - b: RPIOrderbookLevelV5[]; // Bids. Sorted by price in descending order - a: RPIOrderbookLevelV5[]; // Asks. Sorted by price in ascending order - ts: number; // The timestamp (ms) that the system generates the data - u: number; // Update ID, is always in sequence corresponds to u in the 50-level WebSocket RPI orderbook stream - seq: number; // Cross sequence - cts: number; // The timestamp from the matching engine when this orderbook data is produced -} -⋮---- -s: string; // Symbol name -b: RPIOrderbookLevelV5[]; // Bids. Sorted by price in descending order -a: RPIOrderbookLevelV5[]; // Asks. Sorted by price in ascending order -ts: number; // The timestamp (ms) that the system generates the data -u: number; // Update ID, is always in sequence corresponds to u in the 50-level WebSocket RPI orderbook stream -seq: number; // Cross sequence -cts: number; // The timestamp from the matching engine when this orderbook data is produced -⋮---- -export interface TickerLinearInverseV5 { - symbol: string; - lastPrice: string; - indexPrice: string; - markPrice: string; - prevPrice24h: string; - price24hPcnt: string; - highPrice24h: string; - lowPrice24h: string; - prevPrice1h: string; - openInterest: string; - openInterestValue: string; - singleOpenInterest?: string; - singleOpenInterestValue?: string; - turnover24h: string; - volume24h: string; - fundingRate: string; - nextFundingTime: string; - predictedDeliveryPrice: string; - basisRate: string; - basisRateYear: string; - fundingIntervalHour: string; - fundingCap: string; - deliveryFeeRate: string; - deliveryTime: string; - ask1Size: string; - bid1Price: string; - ask1Price: string; - bid1Size: string; - preOpenPrice: string; - preQty: string; - curPreListingPhase: string; - basis: string; -} -⋮---- -export interface TickerOptionV5 { - symbol: string; - bid1Price: string; - bid1Size: string; - bid1Iv: string; - ask1Price: string; - ask1Size: string; - ask1Iv: string; - lastPrice: string; - highPrice24h: string; - lowPrice24h: string; - markPrice: string; - indexPrice: string; - markIv: string; - underlyingPrice: string; - openInterest: string; - turnover24h: string; - volume24h: string; - totalVolume: string; - totalTurnover: string; - delta: string; - gamma: string; - vega: string; - theta: string; - predictedDeliveryPrice: string; - change24h: string; -} -⋮---- -export interface TickerSpotV5 { - symbol: string; - bid1Price: string; - bid1Size: string; - ask1Price: string; - ask1Size: string; - lastPrice: string; - prevPrice24h: string; - price24hPcnt: string; - highPrice24h: string; - lowPrice24h: string; - turnover24h: string; - volume24h: string; - usdIndexPrice: string; -} -⋮---- -export interface FundingRateHistoryResponseV5 { - symbol: string; - fundingRate: string; - fundingRateTimestamp: string; -} +export type WithdrawalTypeV5 = '0' | '1' | '2'; ⋮---- -export interface PublicTradeV5 { - execId: string; - symbol: string; - price: string; - size: string; - side: OrderSideV5; - time: string; - isBlockTrade: boolean; - isRPITrade: boolean; - mP?: string; - iP?: string; - mIv?: string; - iv?: string; - seq?: string; +export interface PermissionsV5 { + ContractTrade?: string[]; + Spot?: string[]; + Wallet?: string[]; + Options?: string[]; + Derivatives?: string[]; + CopyTrading?: string[]; + BlockTrade?: string[]; + Exchange?: string[]; + /** @deprecated , always returns []*/ + NFT?: string[]; + Earn?: string[]; + Affiliate?: string[]; + FiatP2P?: string[]; + /** Bybit Pay (FaitPayOrder) */ + FiatBitPay?: string[]; + FiatConvertBroker?: string[]; + BitCard?: string[]; + ByXPost?: string[]; } ⋮---- -/** - * - * - openInterest string Open interest - * - timestamp string The timestamp (ms) - */ -export type OpenInterestV5 = { - openInterest: string; - singleOpenInterest?: string; - timestamp: string; -}; +/** @deprecated , always returns []*/ ⋮---- -export interface OpenInterestResponseV5 { - category: 'linear' | 'inverse'; - symbol: string; - list: OpenInterestV5[]; +/** Bybit Pay (FaitPayOrder) */ +⋮---- +export interface CategoryCursorListV5< + T extends unknown[], + TCategory extends CategoryV5 = CategoryV5, +> { + category: TCategory; + list: T; nextPageCursor?: string; } ⋮---- -export interface HistoricalVolatilityV5 { - period: number; - value: string; - time: string; +/** + * Next page cursor does not exist for spot! + */ +export interface CursorListV5 { + nextPageCursor: string; + list: T; } ⋮---- -export interface InsuranceDataV5 { - coin: string; - symbols: string; - balance: string; - value: string; +/** + * A wrapper type for any responses that have a "nextPageCursor" property, and a "rows" property with an array of elements + * + * ```{ nextPageCursor: "something", rows: someData[] }``` + */ +export interface CursorRowsV5 { + nextPageCursor: string; + rows: T; } ⋮---- -export interface InsuranceResponseV5 { - updatedTime: string; - list: InsuranceDataV5[]; +export interface CategoryListV5< + T extends unknown[], + TCategory extends CategoryV5, +> { + category: TCategory; + list: T; } ⋮---- -export interface RiskLimitV5 { - id: number; +export interface CategorySymbolListV5< + T extends unknown[], + TCategory extends CategoryV5, +> { + category: TCategory; symbol: string; - riskLimitValue: string; - maintenanceMargin: number; - initialMargin: number; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - section: any; - isLowestRisk: 0 | 1; - maxLeverage: string; - mmDeduction: string; - nextPageCursor?: string; + list: T; } ⋮---- -// eslint-disable-next-line @typescript-eslint/no-explicit-any -⋮---- -/** @deprecated use DeliveryPriceV5 instead */ -export interface OptionDeliveryPriceV5 { - symbol: string; - deliveryPrice: string; - deliveryTime: string; +export interface GetSystemStatusParamsV5 { + id?: string; + state?: string; } ⋮---- -export interface DeliveryPriceV5 { - symbol: string; - deliveryPrice: string; - deliveryTime: string; +export interface SystemStatusItemV5 { + id: string; + title: string; + state: string; + begin: string; + end: string; + href: string; + serviceTypes: number[]; + product: number[]; + uidSuffix: number[]; + maintainType: string; + env: string; } + +================ +File: src/types/request/v5-market.ts +================ +import { KlineIntervalV3 } from '../shared'; +import { + CategoryV5, + InstrumentStatusV5, + InstrumentSymbolTypeV5, + OptionTypeV5, +} from '../shared-v5'; ⋮---- -export interface LongShortRatioV5 { +export interface GetKlineParamsV5 { + category: 'spot' | 'linear' | 'inverse'; symbol: string; - buyRatio: string; - sellRatio: string; - timestamp: string; + interval: KlineIntervalV3; + start?: number; + end?: number; + limit?: number; } ⋮---- -export interface OrderPriceLimitV5 { +export interface GetMarkPriceKlineParamsV5 { + /** + * linear (default if omitted), inverse, or option. + */ + category?: 'linear' | 'inverse' | 'option'; symbol: string; - buyLmt: string; - sellLmt: string; - ts: string; -} -⋮---- -export interface IndexPriceComponentV5 { - exchange: string; // Name of the exchange - spotPair: string; // Spot trading pair on the exchange (e.g., BTCUSDT) - equivalentPrice: string; // Equivalent price - multiplier: string; // Multiplier used for the component price - price: string; // Actual price - weight: string; // Weight in the index calculation + interval: KlineIntervalV3; + start?: number; + end?: number; + /** + * Futures: [1, 1000], default 200. Options: [1, 500], default 200. + */ + limit?: number; } ⋮---- -exchange: string; // Name of the exchange -spotPair: string; // Spot trading pair on the exchange (e.g., BTCUSDT) -equivalentPrice: string; // Equivalent price -multiplier: string; // Multiplier used for the component price -price: string; // Actual price -weight: string; // Weight in the index calculation -⋮---- -export interface IndexPriceComponentsResponseV5 { - indexName: string; // Name of the index (e.g., BTCUSDT) - lastPrice: string; // Last price of the index - updateTime: string; // Timestamp of the last update in milliseconds - components: IndexPriceComponentV5[]; // List of components contributing to the index price -} +/** + * linear (default if omitted), inverse, or option. + */ ⋮---- -indexName: string; // Name of the index (e.g., BTCUSDT) -lastPrice: string; // Last price of the index -updateTime: string; // Timestamp of the last update in milliseconds -components: IndexPriceComponentV5[]; // List of components contributing to the index price +/** + * Futures: [1, 1000], default 200. Options: [1, 500], default 200. + */ ⋮---- -export interface ADLAlertItemV5 { - coin: string; // Token of the insurance pool - symbol: string; // Trading pair name - balance: string; // Balance of the insurance fund. Used to determine if ADL is triggered - maxBalance: string; // Maximum balance of the insurance pool in the last 8 hours - insurancePnlRatio: string; // PnL ratio threshold for triggering contract PnL drawdown ADL - pnlRatio: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped - adlTriggerThreshold: string; // Trigger threshold for contract PnL drawdown ADL - adlStopRatio: string; // Stop ratio threshold for contract PnL drawdown ADL +export interface GetIndexPriceKlineParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + interval: KlineIntervalV3; + start?: number; + end?: number; + limit?: number; } ⋮---- -coin: string; // Token of the insurance pool -symbol: string; // Trading pair name -balance: string; // Balance of the insurance fund. Used to determine if ADL is triggered -maxBalance: string; // Maximum balance of the insurance pool in the last 8 hours -insurancePnlRatio: string; // PnL ratio threshold for triggering contract PnL drawdown ADL -pnlRatio: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped -adlTriggerThreshold: string; // Trigger threshold for contract PnL drawdown ADL -adlStopRatio: string; // Stop ratio threshold for contract PnL drawdown ADL -⋮---- -export interface ADLAlertResponseV5 { - updateTime: string; // Latest data update timestamp (ms) - list: ADLAlertItemV5[]; // List of ADL alert items +export interface GetPremiumIndexPriceKlineParamsV5 { + category: 'linear'; + symbol: string; + interval: KlineIntervalV3; + start?: number; + end?: number; + limit?: number; } ⋮---- -updateTime: string; // Latest data update timestamp (ms) -list: ADLAlertItemV5[]; // List of ADL alert items -⋮---- -export interface FeeGroupLevelV5 { - level: string; // Pro level name or Market Maker level name - takerFeeRate: string; // Taker fee rate - makerFeeRate: string; // Maker fee rate - makerRebate: string; // Maker rebate fee rate - rpiMakerRebate?: string; +export interface GetInstrumentsInfoParamsV5 { + category: CategoryV5; + symbol?: string; + /** Filter by instrument `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ + symbolType?: InstrumentSymbolTypeV5; + status?: InstrumentStatusV5; + /** For `category=option`, pass `All` to return all option symbols. */ + baseCoin?: string; + limit?: number; + cursor?: string; } ⋮---- -level: string; // Pro level name or Market Maker level name -takerFeeRate: string; // Taker fee rate -makerFeeRate: string; // Maker fee rate -makerRebate: string; // Maker rebate fee rate -⋮---- -export interface FeeGroupRatesV5 { - pro: FeeGroupLevelV5[]; // Pro-level fee structures - marketMaker: FeeGroupLevelV5[]; // Market Maker-level fee structures -} +/** Filter by instrument `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ ⋮---- -pro: FeeGroupLevelV5[]; // Pro-level fee structures -marketMaker: FeeGroupLevelV5[]; // Market Maker-level fee structures +/** For `category=option`, pass `All` to return all option symbols. */ ⋮---- -export interface FeeGroupItemV5 { - groupName: string; // Fee group name - weightingFactor: number; // Group weighting factor - symbolsNumbers: number; // Symbols number - symbols: string[]; // Symbol names - feeRates: FeeGroupRatesV5; // Fee rate details for different categories - updateTime: string; // Latest data update timestamp (ms) +/** + * GET /v5/market/instrument-summary + * + * `category` is required. Page with `cursor` = previous `nextPageCursor`. + */ +export interface GetInstrumentSummaryParamsV5 { + /** Product type. `linear` or `option`. */ + category: 'linear' | 'option'; + symbol?: string; + /** Instrument type. */ + symbolType?: string; + /** Market region, for example `HK`, `US`, `CN`, `KR`. */ + marketRegion?: string; + /** Base coin, for example `NVDA` or `TSLA`. */ + baseCoin?: string; + /** Page size. Range [1, 1000]. Default 500. */ + limit?: number; + /** Cursor. Use `nextPageCursor` from the previous response. */ + cursor?: string; } ⋮---- -groupName: string; // Fee group name -weightingFactor: number; // Group weighting factor -symbolsNumbers: number; // Symbols number -symbols: string[]; // Symbol names -feeRates: FeeGroupRatesV5; // Fee rate details for different categories -updateTime: string; // Latest data update timestamp (ms) +/** Product type. `linear` or `option`. */ ⋮---- -export interface FeeGroupStructureResponseV5 { - list: FeeGroupItemV5[]; // List of fee group objects -} +/** Instrument type. */ ⋮---- -list: FeeGroupItemV5[]; // List of fee group objects +/** Market region, for example `HK`, `US`, `CN`, `KR`. */ ⋮---- -export interface OptionBaseCoinV5 { - baseCoin: string; - quoteCoin: string; - settleCoin: string; - optionShowName: string; - /** UTC milliseconds. 0 when the option is not scheduled. */ - optionOnlineTime: number; - /** 1 when tradable option symbols exist, otherwise 0 */ - hasSymbol: 0 | 1; - /** 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil */ - underlyingType: 0 | 1 | 2 | 3 | 4; -} +/** Base coin, for example `NVDA` or `TSLA`. */ ⋮---- -/** UTC milliseconds. 0 when the option is not scheduled. */ +/** Page size. Range [1, 1000]. Default 500. */ ⋮---- -/** 1 when tradable option symbols exist, otherwise 0 */ +/** Cursor. Use `nextPageCursor` from the previous response. */ ⋮---- -/** 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil */ +export interface GetOrderbookParamsV5 { + category: CategoryV5; + symbol: string; + limit?: number; +} ⋮---- -export interface OptionBaseCoinsResultV5 { - list: OptionBaseCoinV5[]; +export interface GetRPIOrderbookParamsV5 { + category?: 'spot' | 'linear' | 'inverse'; + symbol: string; + limit: number; // Required for RPI orderbook, [1, 50] } - -================ -File: src/types/shared-v5.ts -================ -export type CategoryV5 = 'spot' | 'linear' | 'inverse' | 'option'; -/** Public WS subscribe/routing category. Event Contract uses `'event'`; REST `CategoryV5` does not. */ -export type WSCategoryV5 = CategoryV5 | 'event'; -export type ContractTypeV5 = - | 'InversePerpetual' - | 'LinearPerpetual' - | 'InverseFutures'; -export type CopyTradingV5 = 'none' | 'both' | 'utaOnly' | 'normalOnly'; ⋮---- -export type InstrumentStatusV5 = - | 'PreLaunch' - | 'PendingOpen' - | 'Trading' - | 'Settling' - | 'Delivering' - | 'Closed'; +limit: number; // Required for RPI orderbook, [1, 50] ⋮---- -/** - * Region / product class returned as `symbolType` on instruments-info (and account instruments-info). - * For `category=linear`, includes e.g. `stock`, `forex`, `commodity`, `xstocks`. Spot may return `''`. - */ -export type InstrumentSymbolTypeV5 = - | '' - | 'stock' - | 'forex' - | 'commodity' - | 'xstocks'; +export interface GetIndexPriceComponentsParamsV5 { + indexName: string; // Index name, like BTCUSDT +} ⋮---- -export type MarginTradingV5 = 'none' | 'both' | 'utaOnly' | 'normalSpotOnly'; +indexName: string; // Index name, like BTCUSDT ⋮---- -/** Product type for strategy APIs (create / list). */ -export type StrategyCategoryV5 = - | 'UTA_USDT' - | 'UTA_USDC' - | 'UTA_USDC_FUTURE' - | 'UTA_SPOT' - | 'UTA_INVERSE' - | 'UTA_INVERSE_FUTURE' - | 'UTA_USDT_FUTURE'; +export interface GetADLAlertParamsV5 { + symbol?: string; // Contract name, e.g. BTCUSDT. Uppercase only +} ⋮---- -export type StrategyTypeV5 = 'twap' | 'chaseOrder' | 'iceberg' | 'pov'; +symbol?: string; // Contract name, e.g. BTCUSDT. Uppercase only ⋮---- -export type StrategyPreferV5 = - | 'limit' - | 'priceSpeedBalance' - | 'fastestExecution' - | 'quickExecution'; +export interface GetFeeGroupStructureParamsV5 { + productType: string; // Product type. contract only for now + groupId?: string; // Group ID. 1, 2, 3, 4, 5, 6, 7 +} ⋮---- -/** POV strategy execution mode */ -export type PovModeV5 = - | 'TradedVolume' - | 'OppositeSideLiquidity' - | 'SameSideLiquidity'; +productType: string; // Product type. contract only for now +groupId?: string; // Group ID. 1, 2, 3, 4, 5, 6, 7 ⋮---- -export type OrderFilterV5 = 'Order' | 'tpslOrder' | 'StopOrder'; -export type OrderSideV5 = 'Buy' | 'Sell'; -export type OrderTypeV5 = 'Market' | 'Limit'; -export type OrderTimeInForceV5 = 'GTC' | 'IOC' | 'FOK' | 'PostOnly' | 'RPI'; -export type OrderTriggerByV5 = 'LastPrice' | 'IndexPrice' | 'MarkPrice'; -export type OCOTriggerTypeV5 = - | 'OcoTriggerByUnknown' - | 'OcoTriggerTp' - | 'OcoTriggerBySl'; +export interface GetTickersParamsV5 { + category: TCategory; + symbol?: string; + baseCoin?: string; + expDate?: string; +} ⋮---- -export type OrderSMPTypeV5 = - | 'None' - | 'CancelMaker' - | 'CancelTaker' - | 'CancelBoth'; +export interface GetFundingRateHistoryParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + startTime?: number; + endTime?: number; + limit?: number; +} ⋮---- -export type OrderStatusV5 = - | 'Created' - | 'New' - | 'Rejected' - | 'PartiallyFilled' - | 'PartiallyFilledCanceled' - | 'Filled' - | 'Cancelled' - | 'Untriggered' - | 'Triggered' - | 'Deactivated' - | 'Active'; +export interface GetPublicTradingHistoryParamsV5 { + category: CategoryV5; + symbol: string; + baseCoin?: string; + optionType?: OptionTypeV5; + limit?: number; +} ⋮---- -/** - * Defines the types of order creation mechanisms. - */ -export type OrderCreateTypeV5 = - /** Represents an order created by a user. */ - | 'CreateByUser' - /** Represents an order created by an admin closing. */ - | 'CreateByAdminClosing' - /** Futures conditional order. */ - | 'CreateByStopOrder' - /** Futures take profit order. */ - | 'CreateByTakeProfit' - /** Futures partial take profit order. */ - | 'CreateByPartialTakeProfit' - /** Futures stop loss order. */ - | 'CreateByStopLoss' - /** Futures partial stop loss order. */ - | 'CreateByPartialStopLoss' - /** Futures trailing stop order. */ - | 'CreateByTrailingStop' - /** Laddered liquidation to reduce the required maintenance margin. */ - | 'CreateByLiq' - /** - * If the position is still subject to liquidation (i.e., does not meet the required maintenance margin level), - * the position shall be taken over by the liquidation engine and closed at the bankruptcy price. - */ - | 'CreateByTakeOver_PassThrough' - /** Auto-Deleveraging(ADL) */ - | 'CreateByAdl_PassThrough' - /** Order placed via Paradigm. */ - | 'CreateByBlock_PassThrough' - /** Order created by move position. */ - | 'CreateByBlockTradeMovePosition_PassThrough' - /** The close order placed via web or app position area - web/app. */ - | 'CreateByClosing' - /** Order created via grid bot - web/app. */ - | 'CreateByFGridBot' - /** Order closed via grid bot - web/app. */ - | 'CloseByFGridBot' - /** Order created by TWAP - web/app. */ - | 'CreateByTWAP' - /** Order created by TV webhook - web/app. */ - | 'CreateByTVSignal' - /** Order created by Mm rate close function - web/app. */ - | 'CreateByMmRateClose' - /** Order created by Martingale bot - web/app. */ - | 'CreateByMartingaleBot' - /** Order closed by Martingale bot - web/app. */ - | 'CloseByMartingaleBot' - /** Order created by Ice berg strategy - web/app. */ - | 'CreateByIceBerg' - /** Order created by arbitrage - web/app. */ - | 'CreateByArbitrage' - /** Option dynamic delta hedge order - web/app */ - | 'CreateByDdh' - /** BBO Order - Best Bid/Offer order */ - | 'CreateByBboOrder'; +export type OpenInterestIntervalV5 = + | '5min' + | '15min' + | '30min' + | '1h' + | '4h' + | '1d'; ⋮---- -/** Represents an order created by a user. */ +export interface GetOpenInterestParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + intervalTime: OpenInterestIntervalV5; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -/** Represents an order created by an admin closing. */ +export interface GetHistoricalVolatilityParamsV5 { + category: 'option'; + baseCoin?: string; + period?: 7 | 14 | 21 | 30 | 60 | 90 | 180 | 270; + startTime?: number; + endTime?: number; +} ⋮---- -/** Futures conditional order. */ +export interface GetInsuranceParamsV5 { + coin?: string; +} ⋮---- -/** Futures take profit order. */ +export interface GetRiskLimitParamsV5 { + category?: 'linear' | 'inverse'; + symbol?: string; + cursor?: string; +} ⋮---- -/** Futures partial take profit order. */ +export interface GetOptionDeliveryPriceParamsV5 { + category: 'option'; + symbol?: string; + baseCoin?: string; + limit?: number; + cursor?: string; +} ⋮---- -/** Futures stop loss order. */ +export interface GetDeliveryPriceParamsV5 { + category: 'linear' | 'inverse' | 'option'; + symbol?: string; + baseCoin?: string; + settleCoin?: string; + limit?: number; + cursor?: string; +} ⋮---- -/** Futures partial stop loss order. */ +export interface GetLongShortRatioParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + period: OpenInterestIntervalV5; + startTime?: string; + endTime?: string; + limit?: number; + cursor?: string; +} ⋮---- -/** Futures trailing stop order. */ +export interface GetFullDepthOrderbookParamsV5 { + category: 'spot' | 'linear' | 'inverse'; + symbol: string; +} ⋮---- -/** Laddered liquidation to reduce the required maintenance margin. */ +export interface GetOptionBaseCoinsParamsV5 { + /** + * Comma-separated underlying types. + * 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil. Omit to return all types. + */ + underlyingType?: string; +} ⋮---- /** - * If the position is still subject to liquidation (i.e., does not meet the required maintenance margin level), - * the position shall be taken over by the liquidation engine and closed at the bankruptcy price. + * Comma-separated underlying types. + * 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil. Omit to return all types. */ ⋮---- -/** Auto-Deleveraging(ADL) */ -⋮---- -/** Order placed via Paradigm. */ -⋮---- -/** Order created by move position. */ -⋮---- -/** The close order placed via web or app position area - web/app. */ -⋮---- -/** Order created via grid bot - web/app. */ +export interface GetCorporateActionsParamsV5 { + category?: 'option'; + baseCoin?: string; + actionType?: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; + limit?: number; + cursor?: string; +} + +================ +File: src/types/response/v5-market.ts +================ +import { + CategoryCursorListV5, + CategoryV5, + ContractTypeV5, + CopyTradingV5, + InstrumentStatusV5, + InstrumentSymbolTypeV5, + MarginTradingV5, + OptionTypeV5, + OrderSideV5, +} from '../shared-v5'; ⋮---- -/** Order closed via grid bot - web/app. */ +/** + * OHLCVT candle used by v5 APIs + * + * - list[0]: startTime string Start time of the candle (ms) + * - list[1]: openPrice string Open price + * - list[2]: highPrice string Highest price + * - list[3]: lowPrice string Lowest price + * - list[4]: closePrice string Close price. Is the last traded price when the candle is not closed + * - list[5]: volume string Trade volume. Unit of contract: pieces of contract. Unit of spot: quantity of coins + * - list[6]: turnover string Turnover. Unit of figure: quantity of quota coin + */ +export type OHLCVKlineV5 = [ + string, + string, + string, + string, + string, + string, + string, +]; ⋮---- -/** Order created by TWAP - web/app. */ +/** + * OHLC candle used by v5 APIs + * + * - list[0]: startTime string Start time of the candle (ms) + * - list[1]: openPrice string Open price + * - list[2]: highPrice string Highest price + * - list[3]: lowPrice string Lowest price + * - list[4]: closePrice string Close price. Is the last traded price when the candle is not closed + */ +export type OHLCKlineV5 = [string, string, string, string, string]; ⋮---- -/** Order created by TV webhook - web/app. */ +export interface LinearInverseInstrumentInfoV5 { + /** The ID of the symbol name. */ + symbolId: number; + symbol: string; + contractType: ContractTypeV5; + status: InstrumentStatusV5; + baseCoin: string; + quoteCoin: string; + /** Region / product class for the pair (`stock`, `forex`, `commodity`, `xstocks`, etc.). */ + symbolType: InstrumentSymbolTypeV5; + launchTime: string; + deliveryTime?: string; + deliveryFeeRate?: string; + priceScale: string; + leverageFilter: { + minLeverage: string; + maxLeverage: string; + leverageStep: string; + }; + priceFilter: { + minPrice: string; + maxPrice: string; + tickSize: string; + }; + lotSizeFilter: { + maxOrderQty: string; + maxMktOrderQty: string; + minOrderQty: string; + qtyStep: string; + postOnlyMaxOrderQty?: string; + minNotionalValue?: string; + }; + unifiedMarginTrade: boolean; + fundingInterval: number; + settleCoin: string; + copyTrading: CopyTradingV5; + upperFundingRate: string; + lowerFundingRate: string; + riskParameters: { + priceLimitRatioX: string; + priceLimitRatioY: string; + }; + isPreListing: boolean; + preListingInfo: { + curAuctionPhase: string; + phases: { + phase: string; + startTime: string; + endTime: string; + }[]; + auctionFeeInfo: { + auctionFeeRate: string; + takerFeeRate: string; + makerFeeRate: string; + }; + } | null; + skipCallAuction?: boolean; // For USDT pre-market contract + displayName: string; + fullName?: string; + marketRegion?: string; + underlyingTicker?: string; + /** Symbol tags such as `ST`. Linear and inverse only. */ + tags?: string[]; +} ⋮---- -/** Order created by Mm rate close function - web/app. */ +/** The ID of the symbol name. */ ⋮---- -/** Order created by Martingale bot - web/app. */ +/** Region / product class for the pair (`stock`, `forex`, `commodity`, `xstocks`, etc.). */ ⋮---- -/** Order closed by Martingale bot - web/app. */ +skipCallAuction?: boolean; // For USDT pre-market contract ⋮---- -/** Order created by Ice berg strategy - web/app. */ +/** Symbol tags such as `ST`. Linear and inverse only. */ ⋮---- -/** Order created by arbitrage - web/app. */ +export interface OptionInstrumentInfoV5 { + /** The ID of the symbol name. */ + symbolId: number; + symbol: string; + optionsType: OptionTypeV5; + status: InstrumentStatusV5; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + symbolType: InstrumentSymbolTypeV5; + launchTime: string; + deliveryTime: string; + deliveryFeeRate: string; + priceFilter: { + minPrice: string; + maxPrice: string; + tickSize: string; + }; + lotSizeFilter: { + maxOrderQty: string; + minOrderQty: string; + qtyStep: string; + }; + displayName: string; +} ⋮---- -/** Option dynamic delta hedge order - web/app */ +/** The ID of the symbol name. */ ⋮---- -/** BBO Order - Best Bid/Offer order */ +export interface SpotInstrumentInfoV5 { + /** The ID of the symbol name. */ + symbolId: number; + symbol: string; + baseCoin: string; + quoteCoin: string; + /** + * Xstock multiplier for `symbolType` = xstocks pairs. `stock_price = token_price / multiplier`, + * `stock_qty = token_qty * multiplier`. Default `"1"`. + */ + xstockMultiplier?: string; + symbolType: InstrumentSymbolTypeV5; + innovation: '0' | '1'; // Deprecated, always 0 + status: InstrumentStatusV5; + marginTrading: MarginTradingV5; + stTag: '0' | '1'; + lotSizeFilter: { + basePrecision: string; + quotePrecision: string; + /** + * @deprecated Spot order size is enforced by `minOrderAmt` only. + * Bybit API staff confirmed on 15 Oct 2026 that `minOrderQty` no longer + * applies for spot. Undocumented: broker and CCXT users have a 1 USDT + * minimum; direct API users have a 5 USDT minimum. + */ + minOrderQty: string; + maxOrderQty: string; + /** + * Minimum order amount in the quote coin. This is the spot minimum that + * applies. Undocumented; Bybit API staff confirmed on 15 Oct 2026 that + * broker and CCXT users have a 1 USDT minimum, and direct API users have + * a 5 USDT minimum. + */ + minOrderAmt: string; + maxOrderAmt: string; + maxLimitOrderQty: string; + maxMarketOrderQty: string; + postOnlyMaxLimitOrderSize: string; + }; + priceFilter: { + tickSize: string; + }; + riskParameters: { + priceLimitRatioX: string; + priceLimitRatioY: string; + }; + forbidUplWithdrawal: boolean; +} ⋮---- -export type OrderCancelTypeV5 = - | 'CancelByUser' - | 'CancelByReduceOnly' - | 'CancelByPrepareLiq' - | 'CancelAllBeforeLiq' - | 'CancelByPrepareAdl' - | 'CancelAllBeforeAdl' - | 'CancelByAdmin' - | 'CancelByTpSlTsClear' - | 'CancelByPzSideCh' - | 'UNKNOWN'; +/** The ID of the symbol name. */ ⋮---- -export type OrderRejectReasonV5 = - | 'EC_NoError' - | 'EC_Others' - | 'EC_UnknownMessageType' - | 'EC_MissingClOrdID' - | 'EC_MissingOrigClOrdID' - | 'EC_ClOrdIDOrigClOrdIDAreTheSame' - | 'EC_DuplicatedClOrdID' - | 'EC_OrigClOrdIDDoesNotExist' - | 'EC_TooLateToCancel' - | 'EC_UnknownOrderType' - | 'EC_UnknownSide' - | 'EC_UnknownTimeInForce' - | 'EC_WronglyRouted' - | 'EC_MarketOrderPriceIsNotZero' - | 'EC_LimitOrderInvalidPrice' - | 'EC_NoEnoughQtyToFill' - | 'EC_NoImmediateQtyToFill' - | 'EC_PerCancelRequest' - | 'EC_MarketOrderCannotBePostOnly' - | 'EC_PostOnlyWillTakeLiquidity' - | 'EC_CancelReplaceOrder' - | 'EC_InvalidSymbolStatus'; +/** + * Xstock multiplier for `symbolType` = xstocks pairs. `stock_price = token_price / multiplier`, + * `stock_qty = token_qty * multiplier`. Default `"1"`. + */ ⋮---- -export type StopOrderTypeV5 = - | 'TakeProfit' - | 'StopLoss' - | 'TrailingStop' - | 'Stop' - | 'PartialTakeProfit' - | 'PartialStopLoss' - | 'tpslOrder' - | 'OcoOrder' - | 'MmRateClose' - | 'BidirectionalTpslOrder'; +innovation: '0' | '1'; // Deprecated, always 0 ⋮---- /** - * Position index. Used to identify positions in different position modes. - * - * - 0 one-way mode position - * - 1 Buy side of hedge-mode position - * - 2 Sell side of hedge-mode position - */ -export type PositionIdx = 0 | 1 | 2; + * @deprecated Spot order size is enforced by `minOrderAmt` only. + * Bybit API staff confirmed on 15 Oct 2026 that `minOrderQty` no longer + * applies for spot. Undocumented: broker and CCXT users have a 1 USDT + * minimum; direct API users have a 5 USDT minimum. + */ ⋮---- /** - * Position status. - * - * - 'Normal' - * - 'Liq' in the liquidation progress - * - 'Adl' in the auto-deleverage progress - */ -export type PositionStatusV5 = 'Normal' | 'Liq' | 'Adl'; -export type PositionSideV5 = 'Buy' | 'Sell' | 'None' | ''; + * Minimum order amount in the quote coin. This is the spot minimum that + * applies. Undocumented; Bybit API staff confirmed on 15 Oct 2026 that + * broker and CCXT users have a 1 USDT minimum, and direct API users have + * a 5 USDT minimum. + */ ⋮---- -export type OptionTypeV5 = 'Call' | 'Put'; +type InstrumentInfoV5Mapping = { + linear: LinearInverseInstrumentInfoV5[]; + inverse: LinearInverseInstrumentInfoV5[]; + option: OptionInstrumentInfoV5[]; + spot: SpotInstrumentInfoV5[]; +}; +⋮---- +export type InstrumentInfoResponseV5 = + CategoryCursorListV5; ⋮---- /** - * Trade mode. + * One row from GET /v5/market/instrument-summary. * - * - 0 cross-margin, - * - 1 isolated margin + * Several fields are an empty string when they do not apply (`fullName`, + * `marketRegion`, and `underlyingTicker` for option; `priceIndex` for linear). */ -export type TradeModeV5 = 0 | 1; -⋮---- -export type TPSLModeV5 = 'Full' | 'Partial'; -export type AccountMarginModeV5 = - | 'ISOLATED_MARGIN' - | 'REGULAR_MARGIN' - | 'PORTFOLIO_MARGIN'; -export type UnifiedUpdateStatusV5 = 'FAIL' | 'PROCESS' | 'SUCCESS'; -⋮---- -export type AccountTypeV5 = - | 'CONTRACT' - | 'SPOT' - | 'INVESTMENT' - | 'OPTION' - | 'UNIFIED' - | 'FUND' - | 'EARN'; -⋮---- -export type TransactionTypeV5 = - | 'TRANSFER_IN' - | 'TRANSFER_OUT' - | 'TRADE' - | 'SETTLEMENT' - | 'DELIVERY' - | 'LIQUIDATION' - | 'ADL' - | 'AIRDROP' - | 'BONUS_RECOLLECT' - | 'BONUS_RECOLLECT' - | 'FEE_REFUND' - | 'INTEREST' - | 'CURRENCY_BUY' - | 'CURRENCY_SELL' - | 'BORROWED_AMOUNT_INS_LOAN' - | 'PRINCIPLE_REPAYMENT_INS_LOAN' - | 'INTEREST_REPAYMENT_INS_LOAN' - | 'AUTO_SOLD_COLLATERAL_INS_LOAN' - | 'AUTO_BUY_LIABILITY_INS_LOAN' - | 'AUTO_PRINCIPLE_REPAYMENT_INS_LOAN' - | 'AUTO_INTEREST_REPAYMENT_INS_LOAN' - | 'TRANSFER_IN_INS_LOAN' - | 'TRANSFER_OUT_INS_LOAN' - | 'SPOT_REPAYMENT_SELL' - | 'SPOT_REPAYMENT_BUY' - | 'TOKENS_SUBSCRIPTION' - | 'TOKENS_REDEMPTION' - | 'AUTO_DEDUCTION' - | 'FLEXIBLE_STAKING_SUBSCRIPTION' - | 'FLEXIBLE_STAKING_REDEMPTION' - | 'FIXED_STAKING_SUBSCRIPTION' - | 'BORROWED_AMOUNT_INS_LOAN' - | 'PRINCIPLE_REPAYMENT_INS_LOAN' - | 'INTEREST_REPAYMENT_INS_LOAN' - | 'AUTO_SOLD_COLLATERAL_INS_LOAN' - | 'AUTO_BUY_LIABILITY_INS_LOAN' - | 'AUTO_PRINCIPLE_REPAYMENT_INS_LOAN' - | 'AUTO_INTEREST_REPAYMENT_INS_LOAN' - | 'TRANSFER_IN_INS_LOAN' - | 'TRANSFER_OUT_INS_LOAN' - | 'SPOT_REPAYMENT_SELL' - | 'SPOT_REPAYMENT_BUY' - | 'TOKENS_SUBSCRIPTION' - | 'TOKENS_REDEMPTION' - | 'AUTO_DEDUCTION' - | 'FLEXIBLE_STAKING_SUBSCRIPTION' - | 'FLEXIBLE_STAKING_REDEMPTION' - | 'FIXED_STAKING_SUBSCRIPTION' - | 'FLEXIBLE_STAKING_REFUND' - | 'FIXED_STAKING_REFUND' - | 'PREMARKET_TRANSFER_OUT' - | 'PREMARKET_DELIVERY_SELL_NEW_COIN' - | 'PREMARKET_DELIVERY_BUY_NEW_COIN' - | 'PREMARKET_DELIVERY_PLEDGE_PAY_SELLER' - | 'PREMARKET_DELIVERY_PLEDGE_BACK' - | 'PREMARKET_ROLLBACK_PLEDGE_BACK' - | 'PREMARKET_ROLLBACK_PLEDGE_PENALTY_TO_BUYER' - | 'CUSTODY_NETWORK_FEE' - | 'CUSTODY_SETTLE_FEE' - | 'CUSTODY_LOCK' - | 'CUSTODY_UNLOCK' - | 'CUSTODY_UNLOCK_REFUND' - | 'LOANS_BORROW_FUNDS' - | 'LOANS_PLEDGE_ASSET' - | 'BONUS_TRANSFER_IN' - | 'BONUS_TRANSFER_OUT' - | 'PEF_TRANSFER_IN' - | 'PEF_TRANSFER_OUT' - | 'PEF_PROFIT_SHARE' - | 'ONCHAINEARN_SUBSCRIPTION' - | 'ONCHAINEARN_REDEMPTION' - | 'ONCHAINEARN_REFUND' - | 'STRUCTURE_PRODUCT_SUBSCRIPTION' - | 'STRUCTURE_PRODUCT_REFUND' - | 'CLASSIC_WEALTH_MANAGEMENT_SUBSCRIPTION' - | 'PREMIMUM_WEALTH_MANAGEMENT_SUBSCRIPTION' - | 'PREMIMUM_WEALTH_MANAGEMENT_REFUND' - | 'LIQUIDITY_MINING_SUBSCRIPTION' - | 'LIQUIDITY_MINING_REFUND' - | 'PWM_SUBSCRIPTION' - | 'PWM_REFUND' - | 'DEFI_INVESTMENT_SUBSCRIPTION' - | 'DEFI_INVESTMENT_REFUND' - | 'DEFI_INVESTMENT_REDEMPTION' - | 'INSTITUTION_LOAN_IN' - | 'INSTITUTION_PAYBACK_PRINCIPAL_OUT' - | 'INSTITUTION_PAYBACK_INTEREST_OUT' - | 'INSTITUTION_EXCHANGE_SELL' - | 'INSTITUTION_EXCHANGE_BUY' - | 'INSTITUTION_LIQ_PRINCIPAL_OUT' - | 'INSTITUTION_LIQ_INTEREST_OUT' - | 'INSTITUTION_LOAN_TRANSFER_IN' - | 'INSTITUTION_LOAN_TRANSFER_OUT' - | 'INSTITUTION_LOAN_WITHOUT_WITHDRAW' - | 'INSTITUTION_LOAN_RESERVE_IN' - | 'INSTITUTION_LOAN_RESERVE_OUT' - | 'PLATFORM_TOKEN_MNT_LIQRECALLEDMMNT' - | 'PLATFORM_TOKEN_MNT_LIQRETURNEDMNT' - | 'DIVIDEND_SETTLEMENT' +export interface InstrumentSummaryV5 { + symbol: string; + /** Instrument type. May be an empty string. */ + symbolType: string; + /** Display name shown in the UI. */ + displayName: string; + baseCoin: string; + settleCoin: string; + /** Full name. Empty string for `option`. */ + fullName: string; /** - * Forward stock split settlement. Closes the entire existing position; the - * new position is opened as `FORWARD_SPLIT_OPEN`. - * - * Changelog 2026-10-13 updated this description. The enum glossary still - * lists the older wording "fractional share settlement". + * Market region of the underlying asset (`US`, `CN`, `HK`, `KR`, and others). + * Empty string for `option` or when not applicable. */ - | 'FORWARD_SPLIT_SETTLE' - /** Forward stock split position opening after the existing position is settled and closed. */ - | 'FORWARD_SPLIT_OPEN' + marketRegion: string; /** - * Reverse stock split settlement. Closes the entire existing position; the - * new position is opened as `REVERSE_SPLIT_OPEN`. - * - * Changelog 2026-10-13 updated this description. The enum glossary still - * lists the older wording "fractional share settlement". + * Stock ticker, security code, or asset symbol in the underlying market. + * Empty string for `option`. */ - | 'REVERSE_SPLIT_SETTLE' - /** Reverse stock split position opening after the existing position is settled and closed. */ - | 'REVERSE_SPLIT_OPEN'; + underlyingTicker: string; + /** + * TradFi perpetual symbol used as the price index. NVDA options use `NVDAUSDT`. + * Empty string for `linear`. + */ + priceIndex: string; + qtyStep: string; + tickSize: string; + /** Delivery timestamp in milliseconds. `"0"` for `linear`. */ + deliveryTime: string; +} +⋮---- +/** Instrument type. May be an empty string. */ +⋮---- +/** Display name shown in the UI. */ +⋮---- +/** Full name. Empty string for `option`. */ ⋮---- /** - * Forward stock split settlement. Closes the entire existing position; the - * new position is opened as `FORWARD_SPLIT_OPEN`. - * - * Changelog 2026-10-13 updated this description. The enum glossary still - * lists the older wording "fractional share settlement". + * Market region of the underlying asset (`US`, `CN`, `HK`, `KR`, and others). + * Empty string for `option` or when not applicable. */ ⋮---- -/** Forward stock split position opening after the existing position is settled and closed. */ +/** + * Stock ticker, security code, or asset symbol in the underlying market. + * Empty string for `option`. + */ ⋮---- /** - * Reverse stock split settlement. Closes the entire existing position; the - * new position is opened as `REVERSE_SPLIT_OPEN`. - * - * Changelog 2026-10-13 updated this description. The enum glossary still - * lists the older wording "fractional share settlement". + * TradFi perpetual symbol used as the price index. NVDA options use `NVDAUSDT`. + * Empty string for `linear`. */ ⋮---- -/** Reverse stock split position opening after the existing position is settled and closed. */ +/** Delivery timestamp in milliseconds. `"0"` for `linear`. */ ⋮---- -export type PermissionTypeV5 = - | 'ContractTrade' - | 'Spot' - | 'Wallet' - | 'Options' - | 'Derivatives' - | 'Exchange' - | 'NFT'; +export type InstrumentSummaryResponseV5 = CategoryCursorListV5< + InstrumentSummaryV5[], + 'linear' | 'option' +>; +⋮---- +// Account Instruments Info (includes RPI permissions) +export interface AccountSpotInstrumentInfoV5 extends SpotInstrumentInfoV5 { + isPublicRpi: boolean; + myRpiPermission: boolean; +} +⋮---- +export interface AccountLinearInverseInstrumentInfoV5 + extends LinearInverseInstrumentInfoV5 { + isPublicRpi: boolean; + myRpiPermission: boolean; +} +⋮---- +type AccountInstrumentInfoV5Mapping = { + linear: AccountLinearInverseInstrumentInfoV5[]; + inverse: AccountLinearInverseInstrumentInfoV5[]; + spot: AccountSpotInstrumentInfoV5[]; +}; +⋮---- +export type AccountInstrumentInfoResponseV5< + C extends 'spot' | 'linear' | 'inverse', +> = CategoryCursorListV5; ⋮---- /** - * Leveraged token status: - * - * - '1' LT can be purchased and redeemed - * - '2' LT can be purchased, but not redeemed - * - '3' LT can be redeemed, but not purchased - * - '4' LT cannot be purchased nor redeemed - * - '5' Adjusting position + * [price, size] */ -export type LeverageTokenStatusV5 = '1' | '2' | '3' | '4' | '5'; +export type OrderbookLevelV5 = [string, string]; +⋮---- +export interface OrderbookResponseV5 { + s: string; + b: OrderbookLevelV5[]; + a: OrderbookLevelV5[]; + ts: number; + u: number; + seq: number; + cts: number; +} ⋮---- /** - * Leveraged token order type: '1': purchase, '2': redeem + * RPI Orderbook level: [price, nonRpiSize, rpiSize] */ -export type LTOrderTypeV5 = '1' | '2'; +export type RPIOrderbookLevelV5 = [string, string, string]; +⋮---- +export interface RPIOrderbookResponseV5 { + s: string; // Symbol name + b: RPIOrderbookLevelV5[]; // Bids. Sorted by price in descending order + a: RPIOrderbookLevelV5[]; // Asks. Sorted by price in ascending order + ts: number; // The timestamp (ms) that the system generates the data + u: number; // Update ID, is always in sequence corresponds to u in the 50-level WebSocket RPI orderbook stream + seq: number; // Cross sequence + cts: number; // The timestamp from the matching engine when this orderbook data is produced +} +⋮---- +s: string; // Symbol name +b: RPIOrderbookLevelV5[]; // Bids. Sorted by price in descending order +a: RPIOrderbookLevelV5[]; // Asks. Sorted by price in ascending order +ts: number; // The timestamp (ms) that the system generates the data +u: number; // Update ID, is always in sequence corresponds to u in the 50-level WebSocket RPI orderbook stream +seq: number; // Cross sequence +cts: number; // The timestamp from the matching engine when this orderbook data is produced +⋮---- +export interface TickerLinearInverseV5 { + symbol: string; + lastPrice: string; + indexPrice: string; + markPrice: string; + prevPrice24h: string; + price24hPcnt: string; + highPrice24h: string; + lowPrice24h: string; + prevPrice1h: string; + openInterest: string; + openInterestValue: string; + singleOpenInterest?: string; + singleOpenInterestValue?: string; + turnover24h: string; + volume24h: string; + fundingRate: string; + nextFundingTime: string; + predictedDeliveryPrice: string; + basisRate: string; + basisRateYear: string; + fundingIntervalHour: string; + fundingCap: string; + deliveryFeeRate: string; + deliveryTime: string; + ask1Size: string; + bid1Price: string; + ask1Price: string; + bid1Size: string; + preOpenPrice: string; + preQty: string; + curPreListingPhase: string; + basis: string; +} +⋮---- +export interface TickerOptionV5 { + symbol: string; + bid1Price: string; + bid1Size: string; + bid1Iv: string; + ask1Price: string; + ask1Size: string; + ask1Iv: string; + lastPrice: string; + highPrice24h: string; + lowPrice24h: string; + markPrice: string; + indexPrice: string; + markIv: string; + underlyingPrice: string; + openInterest: string; + turnover24h: string; + volume24h: string; + totalVolume: string; + totalTurnover: string; + delta: string; + gamma: string; + vega: string; + theta: string; + predictedDeliveryPrice: string; + change24h: string; +} +⋮---- +export interface TickerSpotV5 { + symbol: string; + bid1Price: string; + bid1Size: string; + ask1Price: string; + ask1Size: string; + lastPrice: string; + prevPrice24h: string; + price24hPcnt: string; + highPrice24h: string; + lowPrice24h: string; + turnover24h: string; + volume24h: string; + usdIndexPrice: string; +} +⋮---- +export interface FundingRateHistoryResponseV5 { + symbol: string; + fundingRate: string; + fundingRateTimestamp: string; +} +⋮---- +export interface PublicTradeV5 { + execId: string; + symbol: string; + price: string; + size: string; + side: OrderSideV5; + time: string; + isBlockTrade: boolean; + isRPITrade: boolean; + mP?: string; + iP?: string; + mIv?: string; + iv?: string; + seq?: string; +} ⋮---- /** - * Leveraged token order status: '1': completed, '2': in progress, '3': failed + * + * - openInterest string Open interest + * - timestamp string The timestamp (ms) */ -export type LTOrderStatusV5 = '1' | '2' | '3'; +export type OpenInterestV5 = { + openInterest: string; + singleOpenInterest?: string; + timestamp: string; +}; +⋮---- +export interface OpenInterestResponseV5 { + category: 'linear' | 'inverse'; + symbol: string; + list: OpenInterestV5[]; + nextPageCursor?: string; +} +⋮---- +export interface HistoricalVolatilityV5 { + period: number; + value: string; + time: string; +} +⋮---- +export interface InsuranceDataV5 { + coin: string; + symbols: string; + balance: string; + value: string; +} +⋮---- +export interface InsuranceResponseV5 { + updatedTime: string; + list: InsuranceDataV5[]; +} +⋮---- +export interface RiskLimitV5 { + id: number; + symbol: string; + riskLimitValue: string; + maintenanceMargin: number; + initialMargin: number; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + section: any; + isLowestRisk: 0 | 1; + maxLeverage: string; + mmDeduction: string; + nextPageCursor?: string; +} +⋮---- +// eslint-disable-next-line @typescript-eslint/no-explicit-any +⋮---- +/** @deprecated use DeliveryPriceV5 instead */ +export interface OptionDeliveryPriceV5 { + symbol: string; + deliveryPrice: string; + deliveryTime: string; +} ⋮---- -export type ExecTypeV5 = - | 'Trade' - | 'AdlTrade' - | 'Funding' - | 'BustTrade' - | 'Settle' - | 'BlockTrade' - | 'MovePosition' - /** @deprecated Removed from Bybit execType; kept for older payloads. */ - | 'CorporateAction' - /** - * Forward stock split settlement and closure of the entire existing position, - * followed by opening a new position (`ForwardSplitOpen`). - */ - | 'ForwardSplitSettle' - /** Forward stock split position opening after the existing position is settled and closed. */ - | 'ForwardSplitOpen' - /** - * Reverse stock split settlement and closure of the entire existing position, - * followed by opening a new position (`ReverseSplitOpen`). - */ - | 'ReverseSplitSettle' - /** Reverse stock split position opening after the existing position is settled and closed. */ - | 'ReverseSplitOpen' - | 'Dividend' - | 'UNKNOWN'; +export interface DeliveryPriceV5 { + symbol: string; + deliveryPrice: string; + deliveryTime: string; +} ⋮---- -/** @deprecated Removed from Bybit execType; kept for older payloads. */ +export interface LongShortRatioV5 { + symbol: string; + buyRatio: string; + sellRatio: string; + timestamp: string; +} ⋮---- -/** - * Forward stock split settlement and closure of the entire existing position, - * followed by opening a new position (`ForwardSplitOpen`). - */ +export interface OrderPriceLimitV5 { + symbol: string; + buyLmt: string; + sellLmt: string; + ts: string; +} ⋮---- -/** Forward stock split position opening after the existing position is settled and closed. */ +export interface IndexPriceComponentV5 { + exchange: string; // Name of the exchange + spotPair: string; // Spot trading pair on the exchange (e.g., BTCUSDT) + equivalentPrice: string; // Equivalent price + multiplier: string; // Multiplier used for the component price + price: string; // Actual price + weight: string; // Weight in the index calculation +} ⋮---- -/** - * Reverse stock split settlement and closure of the entire existing position, - * followed by opening a new position (`ReverseSplitOpen`). - */ +exchange: string; // Name of the exchange +spotPair: string; // Spot trading pair on the exchange (e.g., BTCUSDT) +equivalentPrice: string; // Equivalent price +multiplier: string; // Multiplier used for the component price +price: string; // Actual price +weight: string; // Weight in the index calculation ⋮---- -/** Reverse stock split position opening after the existing position is settled and closed. */ +export interface IndexPriceComponentsResponseV5 { + indexName: string; // Name of the index (e.g., BTCUSDT) + lastPrice: string; // Last price of the index + updateTime: string; // Timestamp of the last update in milliseconds + components: IndexPriceComponentV5[]; // List of components contributing to the index price +} ⋮---- -/** - * Withdraw type. 0(default): on chain. 1: off chain. 2: all. - */ -export type WithdrawalTypeV5 = '0' | '1' | '2'; +indexName: string; // Name of the index (e.g., BTCUSDT) +lastPrice: string; // Last price of the index +updateTime: string; // Timestamp of the last update in milliseconds +components: IndexPriceComponentV5[]; // List of components contributing to the index price ⋮---- -export interface PermissionsV5 { - ContractTrade?: string[]; - Spot?: string[]; - Wallet?: string[]; - Options?: string[]; - Derivatives?: string[]; - CopyTrading?: string[]; - BlockTrade?: string[]; - Exchange?: string[]; - /** @deprecated , always returns []*/ - NFT?: string[]; - Earn?: string[]; - Affiliate?: string[]; - FiatP2P?: string[]; - /** Bybit Pay (FaitPayOrder) */ - FiatBitPay?: string[]; - FiatConvertBroker?: string[]; - BitCard?: string[]; - ByXPost?: string[]; +export interface ADLAlertItemV5 { + coin: string; // Token of the insurance pool + symbol: string; // Trading pair name + balance: string; // Balance of the insurance fund. Used to determine if ADL is triggered + maxBalance: string; // Maximum balance of the insurance pool in the last 8 hours + insurancePnlRatio: string; // PnL ratio threshold for triggering contract PnL drawdown ADL + pnlRatio: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped + adlTriggerThreshold: string; // Trigger threshold for contract PnL drawdown ADL + adlStopRatio: string; // Stop ratio threshold for contract PnL drawdown ADL } ⋮---- -/** @deprecated , always returns []*/ +coin: string; // Token of the insurance pool +symbol: string; // Trading pair name +balance: string; // Balance of the insurance fund. Used to determine if ADL is triggered +maxBalance: string; // Maximum balance of the insurance pool in the last 8 hours +insurancePnlRatio: string; // PnL ratio threshold for triggering contract PnL drawdown ADL +pnlRatio: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped +adlTriggerThreshold: string; // Trigger threshold for contract PnL drawdown ADL +adlStopRatio: string; // Stop ratio threshold for contract PnL drawdown ADL ⋮---- -/** Bybit Pay (FaitPayOrder) */ +export interface ADLAlertResponseV5 { + updateTime: string; // Latest data update timestamp (ms) + list: ADLAlertItemV5[]; // List of ADL alert items +} ⋮---- -export interface CategoryCursorListV5< - T extends unknown[], - TCategory extends CategoryV5 = CategoryV5, -> { - category: TCategory; - list: T; - nextPageCursor?: string; +updateTime: string; // Latest data update timestamp (ms) +list: ADLAlertItemV5[]; // List of ADL alert items +⋮---- +export interface FeeGroupLevelV5 { + level: string; // Pro level name or Market Maker level name + takerFeeRate: string; // Taker fee rate + makerFeeRate: string; // Maker fee rate + makerRebate: string; // Maker rebate fee rate + rpiMakerRebate?: string; } ⋮---- -/** - * Next page cursor does not exist for spot! - */ -export interface CursorListV5 { - nextPageCursor: string; - list: T; +level: string; // Pro level name or Market Maker level name +takerFeeRate: string; // Taker fee rate +makerFeeRate: string; // Maker fee rate +makerRebate: string; // Maker rebate fee rate +⋮---- +export interface FeeGroupRatesV5 { + pro: FeeGroupLevelV5[]; // Pro-level fee structures + marketMaker: FeeGroupLevelV5[]; // Market Maker-level fee structures } ⋮---- -/** - * A wrapper type for any responses that have a "nextPageCursor" property, and a "rows" property with an array of elements - * - * ```{ nextPageCursor: "something", rows: someData[] }``` - */ -export interface CursorRowsV5 { - nextPageCursor: string; - rows: T; +pro: FeeGroupLevelV5[]; // Pro-level fee structures +marketMaker: FeeGroupLevelV5[]; // Market Maker-level fee structures +⋮---- +export interface FeeGroupItemV5 { + groupName: string; // Fee group name + weightingFactor: number; // Group weighting factor + symbolsNumbers: number; // Symbols number + symbols: string[]; // Symbol names + feeRates: FeeGroupRatesV5; // Fee rate details for different categories + updateTime: string; // Latest data update timestamp (ms) } ⋮---- -export interface CategoryListV5< - T extends unknown[], - TCategory extends CategoryV5, -> { - category: TCategory; - list: T; +groupName: string; // Fee group name +weightingFactor: number; // Group weighting factor +symbolsNumbers: number; // Symbols number +symbols: string[]; // Symbol names +feeRates: FeeGroupRatesV5; // Fee rate details for different categories +updateTime: string; // Latest data update timestamp (ms) +⋮---- +export interface FeeGroupStructureResponseV5 { + list: FeeGroupItemV5[]; // List of fee group objects } ⋮---- -export interface CategorySymbolListV5< - T extends unknown[], - TCategory extends CategoryV5, -> { - category: TCategory; - symbol: string; - list: T; +list: FeeGroupItemV5[]; // List of fee group objects +⋮---- +export interface OptionBaseCoinV5 { + baseCoin: string; + quoteCoin: string; + settleCoin: string; + optionShowName: string; + /** UTC milliseconds. 0 when the option is not scheduled. */ + optionOnlineTime: number; + /** 1 when tradable option symbols exist, otherwise 0 */ + hasSymbol: 0 | 1; + /** 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil */ + underlyingType: 0 | 1 | 2 | 3 | 4; } ⋮---- -export interface GetSystemStatusParamsV5 { - id?: string; - state?: string; +/** UTC milliseconds. 0 when the option is not scheduled. */ +⋮---- +/** 1 when tradable option symbols exist, otherwise 0 */ +⋮---- +/** 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil */ +⋮---- +export interface OptionBaseCoinsResultV5 { + list: OptionBaseCoinV5[]; } ⋮---- -export interface SystemStatusItemV5 { - id: string; - title: string; - state: string; - begin: string; - end: string; - href: string; - serviceTypes: number[]; - product: number[]; - uidSuffix: number[]; - maintainType: string; - env: string; +export interface CorporateActionV5 { + category?: 'option'; + symbol: string; + baseCoin: string; + actionType: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; + status: string; + effectiveTime: number; + details: { + splitFactor?: string; + splitType?: 'FORWARD' | 'REVERSE'; + dividendAmountPerShare?: string; + dividendCurrency?: string; + installmentCount?: number; + installmentAmountPerShare?: string; + installmentCoin?: string; + firstSettlementTimeUtc?: number; + installments?: { + installmentNo: number; + settlementTimeUtc: number; + status: string; + }[]; + }; } ================ @@ -16638,6 +16691,7 @@ import { CancelAllRFQResultV5, CancelBorrowOrderFixedParamsV5, CancelEventQuoteParamsV5, + CancelFixedRateBorrowOrderParamsV5, CancelOrderParamsV5, CancelRFQParamsV5, CancelRFQQuoteItemV5, @@ -16673,6 +16727,7 @@ import { ConvertHistoryRecordV5, ConvertQuoteV5, ConvertStatusV5, + CorporateActionV5, CreateBorrowOrderFixedParamsV5, CreateBorrowOrderFixedV5, CreateP2PAdParamsV5, @@ -16749,6 +16804,7 @@ import { FixedLoanAvailableInventoryV5, FixedRateAvailableInventoryV5, FixedRateBorrowContractInfoV5, + FixedRateBorrowInterestAccruedV5, FixedRateBorrowOrderInfoV5, FixedRateBorrowParamsV5, FixedRateBorrowQuoteV5, @@ -16826,6 +16882,7 @@ import { GetCollateralCoinsParamsV5, GetCompletedLoanOrderHistoryParamsV5, GetConvertHistoryParamsV5, + GetCorporateActionsParamsV5, GetDeliveryPriceParamsV5, GetDeliveryRecordParamsV5, GetDepositRecordParamsV5, @@ -16856,6 +16913,7 @@ import { GetFixedLoanAvailableInventoryParamsV5, GetFixedRateAvailableInventoryParamsV5, GetFixedRateBorrowContractInfoParamsV5, + GetFixedRateBorrowInterestAccruedParamsV5, GetFixedRateBorrowOrderInfoParamsV5, GetFixedRateBorrowOrderQuoteParamsV5, GetFixedTermEarnOrderListParamsV5, @@ -17716,6 +17774,14 @@ getOptionBaseCoins( params?: GetOptionBaseCoinsParamsV5, ): Promise> ⋮---- +getCorporateActions(params?: GetCorporateActionsParamsV5): Promise< + APIResponseV3WithTime<{ + list: CorporateActionV5[]; + nextPageCursor: string; + }> + > { + return this.get('/v5/market/corporate-action', params); +⋮---- /** * ****** Trade APIs @@ -19799,6 +19865,23 @@ renewFixedRateBorrow( params: RenewFixedRateBorrowParamsV5, ): Promise> ⋮---- +getFixedRateBorrowInterestAccrued( + params?: GetFixedRateBorrowInterestAccruedParamsV5, + ): Promise< + APIResponseV3WithTime<{ + list: FixedRateBorrowInterestAccruedV5[]; + nextPageCursor: string; + }> + > { + return this.getPrivate( + '/v5/spot-margin-trade/fixedborrow-interest-accrued', + params, + ); +⋮---- +cancelFixedRateBorrowOrder( + params: CancelFixedRateBorrowOrderParamsV5, +): Promise> @@ -24636,7 +24719,7 @@ File: package.json ================ { "name": "bybit-api", - "version": "4.8.4", + "version": "4.8.5", "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", From cce1ada19d08ea2509d3bcf563752ab00b0fe334 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Tue, 3 Nov 2026 11:17:28 +0100 Subject: [PATCH 3/9] chore: drop added tests --- test/v5/market-spot-margin.test.ts | 200 ----------------------------- 1 file changed, 200 deletions(-) delete mode 100644 test/v5/market-spot-margin.test.ts diff --git a/test/v5/market-spot-margin.test.ts b/test/v5/market-spot-margin.test.ts deleted file mode 100644 index e82d5d32..00000000 --- a/test/v5/market-spot-margin.test.ts +++ /dev/null @@ -1,200 +0,0 @@ -import { AxiosAdapter } from 'axios'; - -import { RestClientV5 } from '../../src'; - -describe('Corporate actions and fixed-rate borrow endpoints', () => { - let api: RestClientV5; - let adapter: jest.MockedFunction; - let result: object; - - beforeEach(() => { - result = {}; - adapter = jest.fn(async (config) => ({ - config, - data: { - retCode: 0, - retMsg: 'OK', - result, - retExtInfo: {}, - time: 1792117143000, - }, - headers: {}, - status: 200, - statusText: 'OK', - })); - api = new RestClientV5( - { - testnet: true, - key: 'test-key-placeholder', - secret: 'test-secret-placeholder', - }, - { adapter }, - ); - }); - - it('queries corporate actions without credentials or filters', async () => { - result = { list: [], nextPageCursor: '' }; - const publicApi = new RestClientV5({ testnet: true }, { adapter }); - const response = await publicApi.getCorporateActions(); - - expect(response.result).toEqual(result); - expect(adapter).toHaveBeenCalledTimes(1); - expect(adapter.mock.calls[0][0]).toMatchObject({ - method: 'get', - url: 'https://api-testnet.bybit.com/v5/market/corporate-action', - }); - expect(adapter.mock.calls[0][0].headers['X-BAPI-SIGN']).toBeUndefined(); - }); - - it.each([ - { actionType: 'ForwardSplit' as const, splitType: 'FORWARD' }, - { actionType: 'ReverseSplit' as const, splitType: 'REVERSE' }, - ])( - 'passes $actionType filters and pagination and preserves split details', - async ({ actionType, splitType }) => { - result = { - list: [ - { - category: 'option', - symbol: 'AAPLUSDT', - baseCoin: 'AAPL', - actionType, - status: 'Completed', - effectiveTime: 1788278400000, - details: { splitFactor: '4', splitType }, - }, - ], - nextPageCursor: 'next-page', - }; - const params = { - category: 'option' as const, - baseCoin: 'AAPL', - actionType, - limit: 1, - cursor: 'previous-page', - }; - const response = await api.getCorporateActions(params); - - expect(adapter.mock.calls[0][0].params).toEqual(params); - expect(response.result).toEqual(result); - expect(response.result.list[0].details.splitFactor).toBe('4'); - }, - ); - - it('preserves dividend installment details and numeric timestamps', async () => { - result = { - list: [ - { - symbol: 'AAPLUSDT', - baseCoin: 'AAPL', - actionType: 'Dividend', - status: 'Announced', - effectiveTime: 1788278400000, - details: { - dividendAmountPerShare: '0.25', - dividendCurrency: 'USD', - installmentCount: 4, - installmentAmountPerShare: '5.00000', - installmentCoin: 'USDT', - firstSettlementTimeUtc: 1788134400000, - installments: [ - { - installmentNo: 1, - settlementTimeUtc: 1788134400000, - status: 'SUCCESS', - }, - ], - }, - }, - ], - nextPageCursor: '', - }; - const response = await api.getCorporateActions({ actionType: 'Dividend' }); - - expect(response.result).toEqual(result); - expect(response.result.list[0].details.installments?.[0]).toEqual({ - installmentNo: 1, - settlementTimeUtc: 1788134400000, - status: 'SUCCESS', - }); - }); - - it('queries penalty interest without filters using a signed GET', async () => { - result = { list: [], nextPageCursor: '' }; - const response = await api.getFixedRateBorrowInterestAccrued(); - - expect(response.result).toEqual(result); - expect(adapter.mock.calls[0][0]).toMatchObject({ - method: 'get', - url: 'https://api-testnet.bybit.com/v5/spot-margin-trade/fixedborrow-interest-accrued', - }); - expect(adapter.mock.calls[0][0].headers['X-BAPI-SIGN']).toEqual( - expect.any(String), - ); - }); - - it('serializes penalty interest filters and cursor and preserves decimal strings', async () => { - result = { - list: [ - { - refId: '26', - currency: 'USDT', - orderId: 'FIXED_BORROW_example', - loanAmt: '6.019203532535780822', - interest: '0.000206137107278623', - interestRate: '0.30', - ts: '1792117143000', - }, - ], - nextPageCursor: 'next-page', - }; - const response = await api.getFixedRateBorrowInterestAccrued({ - orderId: 'FIXED_BORROW_example', - orderCurrency: 'USDT', - limit: '10', - cursor: 'cursor+=/', - }); - - const request = adapter.mock.calls[0][0]; - const url = new URL(request.url!); - expect(Object.fromEntries(url.searchParams)).toEqual({ - orderId: 'FIXED_BORROW_example', - orderCurrency: 'USDT', - limit: '10', - cursor: 'cursor+=/', - }); - expect(response.result).toEqual(result); - expect(response.result.list[0].interest).toBe('0.000206137107278623'); - }); - - it('sends a signed cancellation POST and returns the empty result', async () => { - const response = await api.cancelFixedRateBorrowOrder({ - orderId: 'FIXED_BORROW_example', - }); - - const request = adapter.mock.calls[0][0]; - expect(request).toMatchObject({ - method: 'post', - url: 'https://api-testnet.bybit.com/v5/spot-margin-trade/fixedborrow-order-cancel', - }); - expect(JSON.parse(request.data)).toEqual({ - orderId: 'FIXED_BORROW_example', - }); - expect(request.headers['X-BAPI-SIGN']).toEqual(expect.any(String)); - expect(response.retCode).toBe(0); - expect(response.result).toEqual({}); - expect(adapter).toHaveBeenCalledTimes(1); - }); - - it('requires credentials for both private endpoints', async () => { - const publicApi = new RestClientV5({ testnet: true }, { adapter }); - - await expect(publicApi.getFixedRateBorrowInterestAccrued()).rejects.toThrow( - 'Private endpoints require api and private keys set', - ); - await expect( - publicApi.cancelFixedRateBorrowOrder({ orderId: 'FIXED_BORROW_example' }), - ).rejects.toThrow('Private endpoints require api and private keys set'); - expect(adapter).not.toHaveBeenCalled(); - }); -}); From 1b21221d895e5ddf26c3f1bdb9e54121e869b57f Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Mon, 9 Nov 2026 09:16:53 +0100 Subject: [PATCH 4/9] feat(v4.8.5): add event quote and trade auto repayment updates - Add request IDs to on-chain deposit records. - Add Event Contract quote expiry and cancel-all support. - Add Compliance appeal API key permissions. - Add spread order status filtering and document order history defaults. - Document the one-year strategy query window. - Add trade auto repayment controls and document global repayment settings. --- src/rest-client-v5.ts | 53 +++++++++++++++++++- src/types/request/v5-event.ts | 6 +++ src/types/request/v5-spot-leverage-token.ts | 8 ++- src/types/request/v5-spreadtrading.ts | 5 ++ src/types/request/v5-strategy.ts | 10 +++- src/types/response/v5-asset.ts | 1 + src/types/response/v5-event.ts | 6 +++ src/types/response/v5-spot-leverage-token.ts | 5 ++ src/types/response/v5-user.ts | 2 + src/types/shared-v5.ts | 2 + 10 files changed, 94 insertions(+), 4 deletions(-) diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index 14d0de05..d13f32ef 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -87,6 +87,8 @@ import { BrokerRateLimitCapItemV5, BrokerRateLimitSetResultItemV5, BrokerVoucherSpecV5, + CancelAllEventQuotesParamsV5, + CancelAllEventQuotesResultV5, CancelAllOrdersParamsV5, CancelAllRFQResultV5, CancelBorrowOrderFixedParamsV5, @@ -591,6 +593,7 @@ import { SettlePwmFundProfitParamsV5, SettlePwmFundProfitResultV5, SetTPSLModeParamsV5, + SetTradeAutoRepayParamsV5, SetTradingStopParamsV5, SignAgreementParamsV5, SmallBalanceListV5, @@ -635,6 +638,7 @@ import { TokenSplashUserActivityResultV5, TotalMembersAssetsResultV5, TPSLModeV5, + TradeAutoRepayResultV5, TradeInfoForAnalysisResultV5, TransactionLogV5, UnifiedAccountUpgradeResultV5, @@ -919,6 +923,10 @@ export class RestClientV5 extends BaseRestClient { * - orderId & orderLinkId has a higher priority than startTime & endTime * - Fully canceled orders are stored for up to 24 hours * - Single leg orders can also be found with "createType"=CreateByFutureSpread via Get Order History + * - From 2026-11-12, omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * Pass orderStatus explicitly to retrieve matching orders from that period. + * Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 */ getSpreadOrderHistory(params?: GetSpreadOrderHistoryParamsV5): Promise< APIResponseV3WithTime<{ @@ -1340,6 +1348,10 @@ export class RestClientV5 extends BaseRestClient { * Query order history. As order creation/cancellation is asynchronous, the data returned from this endpoint may delay. * * If you want to get real-time order information, you could query this endpoint or rely on the websocket stream (recommended). + * + * From 2026-11-12, omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * Pass orderStatus explicitly to retrieve matching orders from that period. + * @see https://t.me/Bybit_API_Announcements/464 */ getHistoricOrders( params: GetAccountHistoricOrdersParamsV5, @@ -3677,7 +3689,9 @@ export class RestClientV5 extends BaseRestClient { * Set spot automatic repayment mode. * * INFO: - * - If currency is not passed, spot automatic repayment will be enabled for all currencies + * - If currency is not passed, autoRepayMode sets the global automatic repayment switch. + * When enabled, it also applies to currencies that become borrowable later. + * - If currency is passed, only that currency is updated; single-currency behavior is unchanged. * - If autoRepayMode of a currency is set to 1, the system will automatically make repayments * without asset conversion to that currency at 0 and 30 minutes every hour * - The amount of repayments is the minimum of available spot balance and liability @@ -3691,6 +3705,32 @@ export class RestClientV5 extends BaseRestClient { ); } + /** + * Get the Unified account's trade auto repayment switch. + * + * Applies only in Cross and Portfolio margin modes; has no effect in Isolated mode. + * Separate from scheduled automatic repayment configured through setAutoRepayMode. + */ + getTradeAutoRepay(): Promise> { + return this.getPrivate('/v5/spot-margin-trade/get-trade-auto-repay'); + } + + /** + * Set the Unified account's trade auto repayment switch. Disabled by default. + * Repays a credited coin's own flexible-rate liability after an eligible spot trade, without asset conversion. + * + * Runs only in Cross and Portfolio margin modes. Isolated mode can save the setting, but repayment does not run. + * Separate from scheduled automatic repayment configured through setAutoRepayMode. + */ + setTradeAutoRepay( + params: SetTradeAutoRepayParamsV5, + ): Promise> { + return this.postPrivate( + '/v5/spot-margin-trade/set-trade-auto-repay', + params, + ); + } + /** * Get Liability Info (spot margin UTA): fixed vs floating, spot vs derivatives borrow split. */ @@ -6347,4 +6387,15 @@ export class RestClientV5 extends BaseRestClient { ): Promise> { return this.postPrivate('/v5/event/cancel', params); } + + /** + * Cancel all active Event Contract quotes for a symbol. + * + * INFO: Event Contract maker accounts only. + */ + cancelAllEventQuotes( + params: CancelAllEventQuotesParamsV5, + ): Promise> { + return this.postPrivate('/v5/event/cancel-all', params); + } } diff --git a/src/types/request/v5-event.ts b/src/types/request/v5-event.ts index b0490a64..91efe8f5 100644 --- a/src/types/request/v5-event.ts +++ b/src/types/request/v5-event.ts @@ -59,9 +59,15 @@ export interface SubmitEventQuoteParamsV5 { orderLinkId: string; grossPayoutRatio: string; amount: string; + /** Automatically cancel after this many milliseconds. 0 uses quoteMaxValidMs; non-zero values must not exceed quoteMaxValidMs */ + cancelAfterMs?: number; } export interface CancelEventQuoteParamsV5 { orderLinkId?: string; orderId?: string; } + +export interface CancelAllEventQuotesParamsV5 { + symbol: string; +} diff --git a/src/types/request/v5-spot-leverage-token.ts b/src/types/request/v5-spot-leverage-token.ts index 07f07aae..266aa662 100644 --- a/src/types/request/v5-spot-leverage-token.ts +++ b/src/types/request/v5-spot-leverage-token.ts @@ -72,10 +72,16 @@ export interface GetAutoRepayModeParamsV5 { } export interface SetAutoRepayModeParamsV5 { - currency?: string; // Coin name, uppercase only. If not passed, enables for all currencies + /** Coin name, uppercase only. If omitted, sets the global switch; when enabled, includes currencies that become borrowable later */ + currency?: string; autoRepayMode: '0' | '1'; // 0: Off, 1: On } +export interface SetTradeAutoRepayParamsV5 { + /** 1: enable trade auto repayment; 0: disable */ + autoRepay: '0' | '1'; +} + export interface GetSpotMarginLiabilityInfoParamsV5 { currency: string; } diff --git a/src/types/request/v5-spreadtrading.ts b/src/types/request/v5-spreadtrading.ts index 68c01105..eaff944d 100644 --- a/src/types/request/v5-spreadtrading.ts +++ b/src/types/request/v5-spreadtrading.ts @@ -44,6 +44,11 @@ export interface GetSpreadOrderHistoryParamsV5 { baseCoin?: string; orderId?: string; orderLinkId?: string; + /** + * Filter by order status. Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 + */ + orderStatus?: 'Rejected' | 'Cancelled' | 'Filled'; startTime?: number; endTime?: number; limit?: number; diff --git a/src/types/request/v5-strategy.ts b/src/types/request/v5-strategy.ts index 01c32b63..f01d57d8 100644 --- a/src/types/request/v5-strategy.ts +++ b/src/types/request/v5-strategy.ts @@ -58,7 +58,10 @@ export interface CreateStrategyOrderParamsV5 { depthReference?: string; } -/** GET /v5/strategy/list */ +/** + * GET /v5/strategy/list + * The range between beginTimeE0 and endTimeE0 (Unix timestamps in seconds) cannot exceed one year. + */ export interface GetStrategyListParamsV5 { strategyId?: string; symbol?: string; @@ -72,7 +75,10 @@ export interface GetStrategyListParamsV5 { cursor?: string; } -/** GET /v5/strategy/order-list */ +/** + * GET /v5/strategy/order-list + * The range between beginTimeE0 and endTimeE0 (Unix timestamps in seconds) cannot exceed one year. + */ export interface GetStrategyOrderListParamsV5 { strategyId: string; /** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ diff --git a/src/types/response/v5-asset.ts b/src/types/response/v5-asset.ts index ed8c90f5..a0852921 100644 --- a/src/types/response/v5-asset.ts +++ b/src/types/response/v5-asset.ts @@ -107,6 +107,7 @@ export interface AllowedDepositCoinInfoV5 { export interface DepositRecordV5 { id: string; + requestId?: string; coin: string; chain: string; amount: string; diff --git a/src/types/response/v5-event.ts b/src/types/response/v5-event.ts index a4186061..4d75eb90 100644 --- a/src/types/response/v5-event.ts +++ b/src/types/response/v5-event.ts @@ -230,3 +230,9 @@ export interface EventQuoteResultV5 { orderLinkId: string; orderId: string; } + +export interface CancelAllEventQuotesResultV5 { + list: EventQuoteResultV5[]; + /** 1: success; 0: failed */ + success: '1' | '0'; +} diff --git a/src/types/response/v5-spot-leverage-token.ts b/src/types/response/v5-spot-leverage-token.ts index 811dade6..1027ab0e 100644 --- a/src/types/response/v5-spot-leverage-token.ts +++ b/src/types/response/v5-spot-leverage-token.ts @@ -164,6 +164,11 @@ export interface AutoRepayModeResultV5 { data: AutoRepayModeItemV5[]; } +export interface TradeAutoRepayResultV5 { + /** Saved switch state. 1: enabled; 0: disabled */ + autoRepay: '0' | '1'; +} + export interface SpotMarginLiabilityInfoV5 { currency: string; totalBorrowAmount: string; diff --git a/src/types/response/v5-user.ts b/src/types/response/v5-user.ts index ec0655fb..71f5c4e9 100644 --- a/src/types/response/v5-user.ts +++ b/src/types/response/v5-user.ts @@ -50,6 +50,8 @@ export interface ApiKeyPermissionsV5 { FiatGlobalPay?: string[]; BitCard?: string[]; ByXPost?: string[]; + /** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] when not granted */ + Compliance?: string[]; } export interface ApiKeyInfoV5 { diff --git a/src/types/shared-v5.ts b/src/types/shared-v5.ts index db2e15df..04f5d772 100644 --- a/src/types/shared-v5.ts +++ b/src/types/shared-v5.ts @@ -434,6 +434,8 @@ export interface PermissionsV5 { FiatConvertBroker?: string[]; BitCard?: string[]; ByXPost?: string[]; + /** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] revokes permission */ + Compliance?: string[]; } export interface CategoryCursorListV5< From fc5e925fd9128fc8c479e65a60479d268528c438 Mon Sep 17 00:00:00 2001 From: JJ-Cro sync bot Date: Mon, 9 Nov 2026 09:18:51 +0100 Subject: [PATCH 5/9] chore: regenerate endpoint docs and examples --- docs/endpointFunctionList.md | 861 +-- llms.txt | 10897 ++++++++++++++++----------------- 2 files changed, 5817 insertions(+), 5941 deletions(-) diff --git a/docs/endpointFunctionList.md b/docs/endpointFunctionList.md index bbbc47e8..8a6d02fa 100644 --- a/docs/endpointFunctionList.md +++ b/docs/endpointFunctionList.md @@ -49,435 +49,438 @@ This table includes all endpoints from the official Exchange API docs and corres | Function | AUTH | HTTP Method | Endpoint | | -------- | :------: | :------: | -------- | -| [getSystemStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L735) | :closed_lock_with_key: | GET | `/v5/system/status` | -| [getServerTime()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L752) | | GET | `/v5/market/time` | -| [requestDemoTradingFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L764) | :closed_lock_with_key: | POST | `/v5/account/demo-apply-money` | -| [createDemoAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L777) | :closed_lock_with_key: | POST | `/v5/user/create-demo-member` | -| [getSpreadInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L790) | | GET | `/v5/spread/instrument` | -| [getSpreadOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L802) | | GET | `/v5/spread/orderbook` | -| [getSpreadTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L812) | | GET | `/v5/spread/tickers` | -| [getSpreadRecentTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L823) | | GET | `/v5/spread/recent-trade` | -| [getSpreadMaxQty()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L835) | :closed_lock_with_key: | GET | `/v5/spread/max-qty` | -| [submitSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L844) | :closed_lock_with_key: | POST | `/v5/spread/order/create` | -| [amendSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L857) | :closed_lock_with_key: | POST | `/v5/spread/order/amend` | -| [cancelSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L869) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel` | -| [cancelAllSpreadOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L887) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel-all` | -| [getSpreadOpenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L906) | :closed_lock_with_key: | GET | `/v5/spread/order/realtime` | -| [getSpreadOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L923) | :closed_lock_with_key: | GET | `/v5/spread/order/history` | -| [getSpreadTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L939) | :closed_lock_with_key: | GET | `/v5/spread/execution/list` | -| [getKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L959) | | GET | `/v5/market/kline` | -| [getMarkPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L976) | | GET | `/v5/market/mark-price-kline` | -| [getIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L991) | | GET | `/v5/market/index-price-kline` | -| [getPremiumIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1006) | | GET | `/v5/market/premium-index-price-kline` | -| [getInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1022) | | GET | `/v5/market/instruments-info` | -| [getInstrumentSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1036) | | GET | `/v5/market/instrument-summary` | -| [getOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1047) | | GET | `/v5/market/orderbook` | -| [getFullDepthOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1053) | | GET | `/v5/market/full_orderbook` | -| [getRPIOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1067) | | GET | `/v5/market/rpi_orderbook` | -| [getTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1073) | | GET | `/v5/market/tickers` | -| [getFundingRateHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1111) | | GET | `/v5/market/funding/history` | -| [getPublicTradingHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1126) | | GET | `/v5/market/recent-trade` | -| [getOpenInterest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1139) | | GET | `/v5/market/open-interest` | -| [getHistoricalVolatility()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1149) | | GET | `/v5/market/historical-volatility` | -| [getInsurance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1160) | | GET | `/v5/market/insurance` | -| [getRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1171) | | GET | `/v5/market/risk-limit` | -| [getOptionDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1186) | | GET | `/v5/market/delivery-price` | -| [getDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1199) | | GET | `/v5/market/delivery-price` | -| [getNewDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1215) | | GET | `/v5/market/new-delivery-price` | -| [getLongShortRatio()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1231) | | GET | `/v5/market/account-ratio` | -| [getIndexPriceComponents()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1241) | | GET | `/v5/market/index-price-components` | -| [getOrderPriceLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1247) | | GET | `/v5/market/price-limit` | -| [getADLAlert()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1261) | | GET | `/v5/market/adlAlert` | -| [getFeeGroupStructure()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1274) | | GET | `/v5/market/fee-group-info` | -| [getOptionBaseCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1283) | | GET | `/v5/market/option-base-coins` | -| [getCorporateActions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1289) | | GET | `/v5/market/corporate-action` | -| [submitOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1304) | :closed_lock_with_key: | POST | `/v5/order/create` | -| [amendOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1310) | :closed_lock_with_key: | POST | `/v5/order/amend` | -| [cancelOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1316) | :closed_lock_with_key: | POST | `/v5/order/cancel` | -| [getActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1325) | :closed_lock_with_key: | GET | `/v5/order/realtime` | -| [cancelAllOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1331) | :closed_lock_with_key: | POST | `/v5/order/cancel-all` | -| [getHistoricOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1344) | :closed_lock_with_key: | GET | `/v5/order/history` | -| [getExecutionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1356) | :closed_lock_with_key: | GET | `/v5/execution/list` | -| [batchSubmitOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1374) | :closed_lock_with_key: | POST | `/v5/order/create-batch` | -| [batchAmendOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1399) | :closed_lock_with_key: | POST | `/v5/order/amend-batch` | -| [batchCancelOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1424) | :closed_lock_with_key: | POST | `/v5/order/cancel-batch` | -| [getSpotBorrowCheck()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1446) | :closed_lock_with_key: | GET | `/v5/order/spot-borrow-check` | -| [setDisconnectCancelAllWindow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1467) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | -| [setDisconnectCancelAllWindowV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1485) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | -| [preCheckOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1500) | :closed_lock_with_key: | POST | `/v5/order/pre-check` | -| [createStrategyOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1517) | :closed_lock_with_key: | POST | `/v5/strategy/create` | -| [getStrategyList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1528) | :closed_lock_with_key: | GET | `/v5/strategy/list` | -| [getStrategyOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1539) | :closed_lock_with_key: | GET | `/v5/strategy/order-list` | -| [stopStrategy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1550) | :closed_lock_with_key: | POST | `/v5/strategy/stop` | -| [getPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1575) | :closed_lock_with_key: | GET | `/v5/position/list` | -| [getFuturesLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1587) | :closed_lock_with_key: | GET | `/v5/position/symbol-info` | -| [setLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1602) | :closed_lock_with_key: | POST | `/v5/position/set-leverage` | -| [switchIsolatedMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1615) | :closed_lock_with_key: | POST | `/v5/position/switch-isolated` | -| [setTPSLMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1629) | :closed_lock_with_key: | POST | `/v5/position/set-tpsl-mode` | -| [switchPositionMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1644) | :closed_lock_with_key: | POST | `/v5/position/switch-mode` | -| [setRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1658) | :closed_lock_with_key: | POST | `/v5/position/set-risk-limit` | -| [setTradingStop()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1673) | :closed_lock_with_key: | POST | `/v5/position/trading-stop` | -| [setAutoAddMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1684) | :closed_lock_with_key: | POST | `/v5/position/set-auto-add-margin` | -| [addOrReduceMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1696) | :closed_lock_with_key: | POST | `/v5/position/add-margin` | -| [getClosedPnL()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1708) | :closed_lock_with_key: | GET | `/v5/position/closed-pnl` | -| [getClosedOptionsPositions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1722) | :closed_lock_with_key: | GET | `/v5/position/get-closed-positions` | -| [movePosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1747) | :closed_lock_with_key: | POST | `/v5/position/move-positions` | -| [getMovePositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1758) | :closed_lock_with_key: | GET | `/v5/position/move-history` | -| [confirmNewRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1777) | :closed_lock_with_key: | POST | `/v5/position/confirm-pending-mmr` | -| [getPreUpgradeOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1797) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/order/history` | -| [getPreUpgradeTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1812) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/execution/list` | -| [getPreUpgradeClosedPnl()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1823) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/position/closed-pnl` | -| [getPreUpgradeTransactions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1837) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/account/transaction-log` | -| [getPreUpgradeOptionDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1854) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/delivery-record` | -| [getPreUpgradeUSDCSessionSettlements()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1868) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/settlement-record` | -| [getWalletBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1889) | :closed_lock_with_key: | GET | `/v5/account/wallet-balance` | -| [getTransferableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1900) | :closed_lock_with_key: | GET | `/v5/account/withdrawal` | -| [getAccountInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1917) | :closed_lock_with_key: | GET | `/v5/account/instruments-info` | -| [upgradeToUnifiedAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1928) | :closed_lock_with_key: | POST | `/v5/account/upgrade-to-uta` | -| [getBorrowHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1939) | :closed_lock_with_key: | GET | `/v5/account/borrow-history` | -| [repayLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1960) | :closed_lock_with_key: | POST | `/v5/account/quick-repayment` | -| [manualRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1985) | :closed_lock_with_key: | POST | `/v5/account/repay` | -| [setCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1994) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch` | -| [batchSetCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2000) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch-batch` | -| [getCollateralInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2010) | :closed_lock_with_key: | GET | `/v5/account/collateral-info` | -| [getCoinGreeks()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2019) | :closed_lock_with_key: | GET | `/v5/asset/coin-greeks` | -| [getFeeRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2032) | :closed_lock_with_key: | GET | `/v5/account/fee-rate` | -| [getAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2041) | :closed_lock_with_key: | GET | `/v5/account/info` | -| [getDCPInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2054) | :closed_lock_with_key: | GET | `/v5/account/query-dcp-info` | -| [getTransactionLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2061) | :closed_lock_with_key: | GET | `/v5/account/transaction-log` | -| [getClassicTransactionLogs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2072) | :closed_lock_with_key: | GET | `/v5/account/contract-transaction-log` | -| [getSMPGroup()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2083) | :closed_lock_with_key: | GET | `/v5/account/smp-group` | -| [setMarginMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2096) | :closed_lock_with_key: | POST | `/v5/account/set-margin-mode` | -| [setSpotHedging()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2113) | :closed_lock_with_key: | POST | `/v5/account/set-hedging-mode` | -| [setLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2126) | :closed_lock_with_key: | POST | `/v5/account/set-limit-px-action` | -| [getLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2137) | :closed_lock_with_key: | GET | `/v5/account/user-setting-config` | -| [setDeltaNeutralMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2145) | :closed_lock_with_key: | POST | `/v5/account/set-delta-mode` | -| [setMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2154) | :closed_lock_with_key: | POST | `/v5/account/mmp-modify` | -| [resetMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2161) | :closed_lock_with_key: | POST | `/v5/account/mmp-reset` | -| [getMMPState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2168) | :closed_lock_with_key: | GET | `/v5/account/mmp-state` | -| [getOptionAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2178) | :closed_lock_with_key: | GET | `/v5/account/option-asset-info` | -| [getPayInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2188) | :closed_lock_with_key: | GET | `/v5/account/pay-info` | -| [getTradeInfoForAnalysis()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2198) | :closed_lock_with_key: | GET | `/v5/account/trade-info-for-analysis` | -| [getAssetOverview()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2218) | :closed_lock_with_key: | GET | `/v5/asset/asset-overview` | -| [getPortfolioMarginInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2228) | :closed_lock_with_key: | GET | `/v5/asset/portfolio-margin` | -| [getTotalMembersAssets()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2238) | :closed_lock_with_key: | GET | `/v5/asset/total-members-assets` | -| [getFundingAccountTransactionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2250) | :closed_lock_with_key: | GET | `/v5/asset/fundinghistory` | -| [getDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2266) | :closed_lock_with_key: | GET | `/v5/asset/delivery-record` | -| [getSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2277) | :closed_lock_with_key: | GET | `/v5/asset/settlement-record` | -| [getCoinExchangeRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2290) | :closed_lock_with_key: | GET | `/v5/asset/exchange/order-record` | -| [getCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2305) | :closed_lock_with_key: | GET | `/v5/asset/coin/query-info` | -| [getSubUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2319) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-sub-member-list` | -| [getAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2334) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-asset-info` | -| [getAllCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2345) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | -| [getCoinBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2359) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coin-balance` | -| [getWithdrawableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2373) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/withdrawable-amount` | -| [getTransferableCoinList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2382) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-transfer-coin-list` | -| [createInternalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2398) | :closed_lock_with_key: | POST | `/v5/asset/transfer/inter-transfer` | -| [getInternalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2417) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-inter-transfer-list` | -| [enableUniversalTransferForSubUIDs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2437) | :closed_lock_with_key: | POST | `/v5/asset/transfer/save-transfer-sub-member` | -| [createUniversalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2448) | :closed_lock_with_key: | POST | `/v5/asset/transfer/universal-transfer` | -| [getUniversalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2460) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-universal-transfer-list` | -| [getAllowedDepositCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2473) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-allowed-list` | -| [setDepositAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2488) | :closed_lock_with_key: | POST | `/v5/asset/deposit/deposit-to-account` | -| [getDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2504) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-record` | -| [getSubAccountDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2519) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-record` | -| [getInternalDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2535) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-internal-record` | -| [getMasterDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2547) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-address` | -| [getSubDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2565) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | -| [querySubMemberAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2590) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | -| [getWithdrawalRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2610) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-record` | -| [getWithdrawalAddressList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2622) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-address` | -| [getExchangeEntities()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2636) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/vasp/list` | -| [submitDepositOriginatorInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2646) | :closed_lock_with_key: | POST | `/v5/asset/travel-rule/deposit/submit` | -| [submitWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2661) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/create` | -| [cancelWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2672) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/cancel` | -| [getConvertCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2681) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-coin-list` | -| [requestConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2692) | :closed_lock_with_key: | POST | `/v5/asset/exchange/quote-apply` | -| [confirmConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2701) | :closed_lock_with_key: | POST | `/v5/asset/exchange/convert-execute` | -| [getConvertStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2713) | :closed_lock_with_key: | GET | `/v5/asset/exchange/convert-result-query` | -| [getConvertHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2732) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-convert-history` | -| [getSmallBalanceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2749) | :closed_lock_with_key: | GET | `/v5/asset/covert/small-balance-list` | -| [getFiatTradingPairList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2763) | :closed_lock_with_key: | GET | `/v5/fiat/query-coin-list` | -| [createSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2781) | :closed_lock_with_key: | POST | `/v5/user/create-sub-member` | -| [createSubUIDAPIKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2793) | :closed_lock_with_key: | POST | `/v5/user/create-sub-api` | -| [getSubUIDList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2802) | :closed_lock_with_key: | GET | `/v5/user/query-sub-members` | -| [getSubUIDListUnlimited()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2811) | :closed_lock_with_key: | GET | `/v5/user/submembers` | -| [setSubUIDFrozenState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2829) | :closed_lock_with_key: | POST | `/v5/user/frozen-sub-member` | -| [getQueryApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2844) | :closed_lock_with_key: | GET | `/v5/user/query-api` | -| [getSubAccountAllApiKeys()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2851) | :closed_lock_with_key: | GET | `/v5/user/sub-apikeys` | -| [getUIDWalletType()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2860) | :closed_lock_with_key: | GET | `/v5/user/get-member-type` | -| [updateMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2879) | :closed_lock_with_key: | POST | `/v5/user/update-api` | -| [updateSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2893) | :closed_lock_with_key: | POST | `/v5/user/update-sub-api` | -| [deleteSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2906) | :closed_lock_with_key: | POST | `/v5/user/del-submember` | -| [deleteMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2921) | :closed_lock_with_key: | POST | `/v5/user/delete-api` | -| [deleteSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2935) | :closed_lock_with_key: | POST | `/v5/user/delete-sub-api` | -| [createTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2950) | :closed_lock_with_key: | POST | `/v5/fht/compliance/tax/private/batch_create` | -| [getTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2962) | :closed_lock_with_key: | GET | `/v5/fht/compliance/tax/private/batch_query` | -| [getAffiliateUserList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2985) | :closed_lock_with_key: | GET | `/v5/affiliate/aff-user-list` | -| [getAffiliateSubAffiliateList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3003) | :closed_lock_with_key: | GET | `/v5/affiliate/affiliate-sub-list` | -| [getAffiliateUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3019) | :closed_lock_with_key: | GET | `/v5/user/aff-customer-info` | -| [getFriendReferrals()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3031) | :closed_lock_with_key: | GET | `/v5/user/invitation/referrals` | -| [getReferralCode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3040) | :closed_lock_with_key: | GET | `/v5/user/invitation/code` | -| [getReferralCommissionRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3052) | :closed_lock_with_key: | POST | `/v5/referral/commission/records` | -| [getReferralCampaignRewards()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3065) | :closed_lock_with_key: | POST | `/v5/referral/campaign/rewards` | -| [getReferralUserIdentityProfile()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3080) | :closed_lock_with_key: | POST | `/v5/referral/user/identity-profile` | -| [getReferralUserInvitations()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3093) | :closed_lock_with_key: | POST | `/v5/referral/user/invitations` | -| [signAgreement()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3111) | :closed_lock_with_key: | POST | `/v5/user/agreement` | -| [getAlphaTradeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3128) | :closed_lock_with_key: | POST | `/v5/alpha/trade/quote` | -| [executeAlphaTradePurchase()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3139) | :closed_lock_with_key: | POST | `/v5/alpha/trade/purchase` | -| [executeAlphaTradeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3150) | :closed_lock_with_key: | POST | `/v5/alpha/trade/redeem` | -| [getAlphaPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3160) | :closed_lock_with_key: | POST | `/v5/alpha/trade/pay-token-list` | -| [getAlphaTradeOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3170) | :closed_lock_with_key: | POST | `/v5/alpha/trade/order-list` | -| [getAlphaBizTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3180) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-list` | -| [getAlphaBizTokenPriceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3190) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-price-list` | -| [getAlphaBizTokenDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3200) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-details` | -| [getAlphaAssetList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3210) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-list` | -| [getAlphaAssetDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3218) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-detail` | -| [getAlphaPredictionEngineStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3234) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/engine-status` | -| [getAlphaPredictionPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3244) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/pay-token-list` | -| [getAlphaPredictionEventDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3254) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/event-detail` | -| [getAlphaPredictionOrderEstimate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3264) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-estimate` | -| [executeAlphaPredictionBuy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3274) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/buy` | -| [executeAlphaPredictionSell()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3284) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sell` | -| [getAlphaPredictionOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3294) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-list` | -| [getAlphaPredictionOrderBook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3304) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-book` | -| [getAlphaPredictionTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3314) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/token-price` | -| [getAlphaPredictionPriceHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3324) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/price-history` | -| [getAlphaPredictionPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3334) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-list` | -| [getAlphaPredictionPositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3344) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-history` | -| [getAlphaPredictionPortfolioSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3354) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/portfolio-summary` | -| [getAlphaPredictionSideMarketList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3364) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/side-market-list` | -| [getAlphaPredictionSportsMatchList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3374) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/match-list` | -| [getAlphaPredictionSportsTimelineStages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3384) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/sports/timeline-stages` | -| [getAlphaPredictionSportsGroupStageDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3397) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/group-stage-detail` | -| [getAlphaLPPoolList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3416) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-list` | -| [getAlphaLPPoolInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3426) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-info` | -| [executeAlphaLPStake()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3436) | :closed_lock_with_key: | POST | `/v5/alpha/lp/stake` | -| [executeAlphaLPRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3446) | :closed_lock_with_key: | POST | `/v5/alpha/lp/redeem` | -| [getAlphaLPOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3456) | :closed_lock_with_key: | POST | `/v5/alpha/lp/order-list` | -| [getAlphaLPPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3466) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-list` | -| [getAlphaLPPayTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3476) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-price` | -| [getAlphaLPPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3486) | :closed_lock_with_key: | POST | `/v5/alpha/lp/position-list` | -| [getVIPMarginData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3506) | | GET | `/v5/spot-margin-trade/data` | -| [getHistoricalInterestRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3517) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/interest-rate-history` | -| [getSpotMarginCurrencyData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3542) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/currency-data` | -| [toggleSpotMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3554) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/switch-mode` | -| [setSpotMarginLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3565) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | -| [setSpotMarginLeverageV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3573) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | -| [getSpotMarginState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3584) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/state` | -| [manualBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3591) | :closed_lock_with_key: | POST | `/v5/account/borrow` | -| [getMaxBorrowableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3606) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/max-borrowable` | -| [getPositionTiers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3615) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/position-tiers` | -| [getCoinState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3626) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/coinstate` | -| [getAvailableAmountToRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3637) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/repayment-available-amount` | -| [manualRepayWithoutConversion()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3656) | :closed_lock_with_key: | POST | `/v5/account/no-convert-repay` | -| [getAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3669) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-auto-repay-mode` | -| [setAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3685) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-auto-repay-mode` | -| [getSpotMarginLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3697) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/liability` | -| [submitFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3706) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow` | -| [getFixedRateBorrowOrderInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3715) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-info` | -| [getFixedRateBorrowContractInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3732) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-contract-info` | -| [getFixedRateBorrowOrderQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3749) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-quote` | -| [renewFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3761) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-renew` | -| [getFixedRateBorrowInterestAccrued()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3767) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-interest-accrued` | -| [cancelFixedRateBorrowOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3781) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-order-cancel` | -| [getFlexibleAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3790) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/flexible-available-inventory` | -| [getFixedRateAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3799) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixed-available-inventory` | -| [getSpotMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3817) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/pledge-token` | -| [getSpotMarginBorrowableCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3834) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/borrow-token` | -| [getSpotMarginInterestAndQuota()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3851) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/loan-info` | -| [getSpotMarginLoanAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3869) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/account` | -| [spotMarginBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3893) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/loan` | -| [spotMarginRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3904) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/repay` | -| [getSpotMarginBorrowOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3919) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/orders` | -| [getSpotMarginRepaymentOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3948) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/repay-history` | -| [toggleSpotCrossMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3977) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/switch` | -| [getCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3997) | | GET | `/v5/crypto-loan/collateral-data` | -| [getBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4014) | | GET | `/v5/crypto-loan/loanable-data` | -| [getAccountBorrowCollateralLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4032) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrowable-collateralisable-number` | -| [borrowCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4052) | :closed_lock_with_key: | POST | `/v5/crypto-loan/borrow` | -| [repayCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4073) | :closed_lock_with_key: | POST | `/v5/crypto-loan/repay` | -| [getUnpaidLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4089) | :closed_lock_with_key: | GET | `/v5/crypto-loan/ongoing-orders` | -| [getRepaymentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4110) | :closed_lock_with_key: | GET | `/v5/crypto-loan/repayment-history` | -| [getCompletedLoanOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4130) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrow-history` | -| [getMaxAllowedReductionCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4149) | :closed_lock_with_key: | GET | `/v5/crypto-loan/max-collateral-amount` | -| [adjustCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4168) | :closed_lock_with_key: | POST | `/v5/crypto-loan/adjust-ltv` | -| [getLoanLTVAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4192) | :closed_lock_with_key: | GET | `/v5/crypto-loan/adjustment-history` | -| [getLoanBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4213) | | GET | `/v5/crypto-loan-common/loanable-data` | -| [getLoanCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4225) | | GET | `/v5/crypto-loan-common/collateral-data` | -| [getMaxCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4235) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/max-collateral-amount` | -| [getMaxLoanAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4254) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/max-loan` | -| [updateCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4264) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/adjust-ltv` | -| [getCollateralAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4275) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/adjustment-history` | -| [getCryptoLoanPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4290) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/position` | -| [borrowFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4307) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/borrow` | -| [repayFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4318) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay` | -| [repayCollateralFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4328) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | -| [getOngoingFlexibleLoans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4342) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/ongoing-coin` | -| [getBorrowHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4354) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/borrow-history` | -| [getRepaymentHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4367) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/repayment-history` | -| [getFlexibleLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4381) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/available-inventory` | -| [getSupplyOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4401) | | GET | `/v5/crypto-loan-fixed/supply-order-quote` | -| [getBorrowOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4414) | | GET | `/v5/crypto-loan-fixed/borrow-order-quote` | -| [createBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4427) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow` | -| [createSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4440) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply` | -| [cancelBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4450) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow-order-cancel` | -| [cancelSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4464) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply-order-cancel` | -| [getBorrowContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4477) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-contract-info` | -| [getSupplyContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4495) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-contract-info` | -| [getBorrowOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4513) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-order-info` | -| [getSupplyOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4526) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-order-info` | -| [repayFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4540) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/fully-repay` | -| [repayCollateralFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4551) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | -| [getRepaymentHistoryFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4564) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/repayment-history` | -| [renewBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4581) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/renew` | -| [getRenewOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4594) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/renew-info` | -| [getFixedLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4603) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/available-inventory` | -| [getInstitutionalLendingProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4618) | | GET | `/v5/ins-loan/product-infos` | -| [getInstitutionalLendingCoinDeltaAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4630) | :closed_lock_with_key: | GET | `/v5/ins-loan/coin-delta-amount` | -| [getInstitutionalLendingDelayLiquidationStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4639) | :closed_lock_with_key: | GET | `/v5/ins-loan/delay-liq-status` | -| [getInstitutionalLendingMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4649) | | GET | `/v5/ins-loan/ensure-tokens` | -| [getInstitutionalLendingMarginCoinInfoWithConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4658) | | GET | `/v5/ins-loan/ensure-tokens-convert` | -| [getInstitutionalLendingLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4667) | :closed_lock_with_key: | GET | `/v5/ins-loan/loan-order` | -| [getInstitutionalLendingRepayOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4679) | :closed_lock_with_key: | GET | `/v5/ins-loan/repaid-history` | -| [getInstitutionalLendingLTV()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4691) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv` | -| [getInstitutionalLendingLTVWithLadderConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4700) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv-convert` | -| [bindOrUnbindUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4715) | :closed_lock_with_key: | POST | `/v5/ins-loan/association-uid` | -| [repayInstitutionalLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4735) | :closed_lock_with_key: | POST | `/v5/ins-loan/repay-loan` | -| [getExchangeBrokerEarnings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4756) | :closed_lock_with_key: | GET | `/v5/broker/earnings-info` | -| [getExchangeBrokerAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4769) | :closed_lock_with_key: | GET | `/v5/broker/account-info` | -| [getBrokerSubAccountDeposits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4785) | :closed_lock_with_key: | GET | `/v5/broker/asset/query-sub-member-deposit-record` | -| [getBrokerVoucherSpec()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4800) | :closed_lock_with_key: | POST | `/v5/broker/award/info` | -| [issueBrokerVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4812) | :closed_lock_with_key: | POST | `/v5/broker/award/distribute-award` | -| [getBrokerIssuedVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4824) | :closed_lock_with_key: | POST | `/v5/broker/award/distribution-record` | -| [setBrokerRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4841) | :closed_lock_with_key: | POST | `/v5/broker/apilimit/set` | -| [getBrokerRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4860) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-cap` | -| [getAllBrokerRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4878) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-all` | -| [getEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4898) | | GET | `/v5/earn/product` | -| [getFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4909) | :closed_lock_with_key: | GET | `/v5/earn/flexible-saving/auto-savings` | -| [setFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4920) | :closed_lock_with_key: | POST | `/v5/earn/flexible-saving/auto-savings` | -| [getEarnCouponList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4930) | :closed_lock_with_key: | GET | `/v5/earn/coupons` | -| [getRWAProductList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4940) | | GET | `/v5/earn/rwa/product` | -| [placeRWAOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4950) | :closed_lock_with_key: | POST | `/v5/earn/rwa/place-order` | -| [getRWAPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4959) | :closed_lock_with_key: | GET | `/v5/earn/rwa/position` | -| [getRWAOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4968) | :closed_lock_with_key: | GET | `/v5/earn/rwa/order` | -| [getRWANavChart()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4978) | | GET | `/v5/earn/rwa/nav-chart` | -| [getHoldToEarnAirdropProducts()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4989) | | GET | `/v5/earn/hold-to-earn/product` | -| [getAdvanceEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5000) | | GET | `/v5/earn/advance/product` | -| [getLiquidityMiningProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5011) | | GET | `/v5/earn/liquidity-mining/product` | -| [reinvestLiquidityMining()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5024) | :closed_lock_with_key: | POST | `/v5/earn/liquidity-mining/reinvest` | -| [getFixedTermEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5035) | | GET | `/v5/earn/fixed-term/product` | -| [getAdvanceEarnProductExtraInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5047) | | GET | `/v5/earn/advance/product-extra-info` | -| [submitAdvanceEarnPlaceOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5058) | :closed_lock_with_key: | POST | `/v5/earn/advance/place-order` | -| [getAdvanceEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5069) | :closed_lock_with_key: | GET | `/v5/earn/advance/position` | -| [getAdvanceEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5080) | :closed_lock_with_key: | GET | `/v5/earn/advance/order` | -| [submitFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5091) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/place-order` | -| [redeemFixedTermEarn()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5102) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/redeem` | -| [getFixedTermEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5113) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/position` | -| [getFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5124) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/order` | -| [setFixedTermEarnAutoInvest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5135) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/position/auto-invest` | -| [submitStakeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5151) | :closed_lock_with_key: | POST | `/v5/earn/place-order` | -| [getEarnOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5170) | :closed_lock_with_key: | GET | `/v5/earn/order` | -| [getEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5188) | :closed_lock_with_key: | GET | `/v5/earn/position` | -| [modifyEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5201) | :closed_lock_with_key: | POST | `/v5/earn/position/modify` | -| [getEarnYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5214) | :closed_lock_with_key: | GET | `/v5/earn/yield` | -| [getHoldToEarnAirdropYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5228) | :closed_lock_with_key: | GET | `/v5/earn/hold-to-earn/yield-history` | -| [getEarnHourlyYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5239) | :closed_lock_with_key: | GET | `/v5/earn/hourly-yield` | -| [getEarnAprHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5253) | | GET | `/v5/earn/apr-history` | -| [getEarnTokenProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5263) | | GET | `/v5/earn/token/product` | -| [submitEarnTokenOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5272) | :closed_lock_with_key: | POST | `/v5/earn/token/place-order` | -| [getEarnTokenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5281) | :closed_lock_with_key: | GET | `/v5/earn/token/order` | -| [getEarnTokenPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5293) | :closed_lock_with_key: | GET | `/v5/earn/token/position` | -| [getEarnTokenDailyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5302) | :closed_lock_with_key: | GET | `/v5/earn/token/yield` | -| [getEarnTokenHourlyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5314) | :closed_lock_with_key: | GET | `/v5/earn/token/hourly-yield` | -| [getEarnTokenHistoryApr()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5326) | | GET | `/v5/earn/token/history-apr` | -| [getPwmInvestmentPlanList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5341) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/list` | -| [getPwmInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5350) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/detail` | -| [getPwmPendingInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5359) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/new-plan` | -| [claimPwmWithdrawableFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5368) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/claim` | -| [getPwmInvestmentPlanAssetTrend()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5377) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/asset-trend` | -| [getPwmFundHistoricalNav()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5386) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/fund-nav` | -| [subscribePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5395) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/subscribe` | -| [investMorePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5404) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/invest-more` | -| [redeemPwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5413) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/redeem` | -| [getPwmInvestmentPlanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5422) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/order` | -| [getPwmSubscribableProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5431) | | GET | `/v5/earn/pwm/customize-plan/product` | -| [createPwmCustomizeInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5440) | :closed_lock_with_key: | POST | `/v5/earn/pwm/customize-plan/create` | -| [getPwmAllFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5455) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-funds` | -| [settlePwmFundProfit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5464) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/settle-profit` | -| [createPwmFund()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5473) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-fund` | -| [createPwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5482) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-investment-plan` | -| [getPwmAssetManagerInvestmentPlans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5496) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/get-investment-plan` | -| [managePwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5508) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-investment-plan` | -| [getPwmAllFundOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5522) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-order` | -| [managePwmFundOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5531) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-order` | -| [createPwmFundSubAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5540) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-sub-account` | -| [pwmFundTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5552) | :closed_lock_with_key: | POST | `/v5/earn/pwm/fund-transfer` | -| [getPwmFundTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5561) | :closed_lock_with_key: | GET | `/v5/earn/pwm/query-fund-transfer-result` | -| [queryCardAssetRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5576) | :closed_lock_with_key: | POST | `/v5/card/transaction/query-asset-records` | -| [queryCardPointsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5585) | :closed_lock_with_key: | POST | `/v5/card/reward/points/balance` | -| [queryCardPointsRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5592) | :closed_lock_with_key: | POST | `/v5/card/reward/points/records` | -| [queryCardPointsTier()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5601) | :closed_lock_with_key: | POST | `/v5/card/reward/points/tier` | -| [queryCardMallItemList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5608) | :closed_lock_with_key: | POST | `/v5/card/reward/mall/item/list` | -| [queryCardPointCashbackDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5617) | :closed_lock_with_key: | POST | `/v5/card/reward/point/cashback/detail` | -| [createRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5633) | :closed_lock_with_key: | POST | `/v5/rfq/create-rfq` | -| [getRFQConfig()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5644) | :closed_lock_with_key: | GET | `/v5/rfq/config` | -| [cancelRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5653) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-rfq` | -| [cancelAllRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5663) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-rfq` | -| [createRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5672) | :closed_lock_with_key: | POST | `/v5/rfq/create-quote` | -| [executeRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5683) | :closed_lock_with_key: | POST | `/v5/rfq/execute-quote` | -| [cancelRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5694) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-quote` | -| [cancelAllRFQQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5704) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-quotes` | -| [getRFQRealtimeInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5718) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-realtime` | -| [getRFQHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5730) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-list` | -| [getRFQRealtimeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5744) | :closed_lock_with_key: | GET | `/v5/rfq/quote-realtime` | -| [getRFQHistoryQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5759) | :closed_lock_with_key: | GET | `/v5/rfq/quote-list` | -| [getRFQTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5772) | :closed_lock_with_key: | GET | `/v5/rfq/trade-list` | -| [getRFQPublicTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5785) | :closed_lock_with_key: | GET | `/v5/rfq/public-trades` | -| [acceptNonLPQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5801) | :closed_lock_with_key: | POST | `/v5/rfq/accept-other-quote` | -| [getRFQDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5807) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-detail-list` | -| [getP2PAccountCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5832) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | -| [getP2POnlineAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5849) | :closed_lock_with_key: | POST | `/v5/p2p/item/online` | -| [createP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5858) | :closed_lock_with_key: | POST | `/v5/p2p/item/create` | -| [cancelP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5867) | :closed_lock_with_key: | POST | `/v5/p2p/item/cancel` | -| [updateP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5881) | :closed_lock_with_key: | POST | `/v5/p2p/item/update` | -| [getP2PPersonalAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5891) | :closed_lock_with_key: | POST | `/v5/p2p/item/personal/list` | -| [getP2PAdDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5900) | :closed_lock_with_key: | POST | `/v5/p2p/item/info` | -| [getP2POrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5915) | :closed_lock_with_key: | POST | `/v5/p2p/order/simplifyList` | -| [getP2POrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5925) | :closed_lock_with_key: | POST | `/v5/p2p/order/info` | -| [getP2PPendingOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5934) | :closed_lock_with_key: | POST | `/v5/p2p/order/pending/simplifyList` | -| [markP2POrderAsPaid()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5943) | :closed_lock_with_key: | POST | `/v5/p2p/order/pay` | -| [releaseP2POrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5952) | :closed_lock_with_key: | POST | `/v5/p2p/order/finish` | -| [reviewP2PSellerCancelOrderApply()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5964) | :closed_lock_with_key: | POST | `/v5/p2p/order/buyer/examine/sellerCancelOrderApply` | -| [sendP2POrderMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5976) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/send` | -| [getP2PChatSessions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5991) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/list_v1` | -| [getP2PChatSessionId()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6001) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/getSessionId` | -| [sendP2PChatMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6037) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/send_v1` | -| [getP2PChatMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6049) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/listpage_v1` | -| [getP2POrderMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6058) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/listpage` | -| [getP2PUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6072) | :closed_lock_with_key: | POST | `/v5/p2p/user/personal/info` | -| [getP2PCounterpartyUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6079) | :closed_lock_with_key: | POST | `/v5/p2p/user/order/personal/info` | -| [getP2PUserPayments()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6088) | :closed_lock_with_key: | POST | `/v5/p2p/user/payment/list` | -| [setApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6108) | :closed_lock_with_key: | POST | `/v5/apilimit/set` | -| [queryApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6137) | :closed_lock_with_key: | GET | `/v5/apilimit/query` | -| [getRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6156) | :closed_lock_with_key: | GET | `/v5/apilimit/query-cap` | -| [getAllRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6175) | :closed_lock_with_key: | GET | `/v5/apilimit/query-all` | -| [getLaunchpoolProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6198) | | GET | `/v5/spot-x/launchpool/project/list` | -| [getLaunchpoolUserActivityLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6204) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/activity-log` | -| [getLaunchpoolCurrentStaking()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6210) | :closed_lock_with_key: | GET | `/v5/spot-x/launchpool/user/current-staking` | -| [getLaunchpoolUserHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6216) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/history` | -| [getPuzzleProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6222) | | GET | `/v5/spot-x/puzzle/project/list` | -| [getTokenSplashProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6228) | | GET | `/v5/spot-x/token-splash/project/list` | -| [getTokenSplashUserActivityParams()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6234) | :closed_lock_with_key: | GET | `/v5/spot-x/token-splash/user/activity-params` | -| [getEventInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6257) | | GET | `/v5/event/instruments-info` | -| [getEventOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6268) | | GET | `/v5/event/orderbook` | -| [getEventOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6279) | :closed_lock_with_key: | GET | `/v5/event/order-list` | -| [getEventActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6290) | :closed_lock_with_key: | GET | `/v5/event/order-realtime` | -| [getEventPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6301) | :closed_lock_with_key: | GET | `/v5/event/positions` | -| [getEventTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6312) | :closed_lock_with_key: | GET | `/v5/event/trades` | -| [getEventSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6323) | :closed_lock_with_key: | GET | `/v5/event/settlements` | -| [submitEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6334) | :closed_lock_with_key: | POST | `/v5/event/quotes` | -| [cancelEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6345) | :closed_lock_with_key: | POST | `/v5/event/cancel` | +| [getSystemStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L739) | :closed_lock_with_key: | GET | `/v5/system/status` | +| [getServerTime()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L756) | | GET | `/v5/market/time` | +| [requestDemoTradingFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L768) | :closed_lock_with_key: | POST | `/v5/account/demo-apply-money` | +| [createDemoAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L781) | :closed_lock_with_key: | POST | `/v5/user/create-demo-member` | +| [getSpreadInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L794) | | GET | `/v5/spread/instrument` | +| [getSpreadOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L806) | | GET | `/v5/spread/orderbook` | +| [getSpreadTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L816) | | GET | `/v5/spread/tickers` | +| [getSpreadRecentTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L827) | | GET | `/v5/spread/recent-trade` | +| [getSpreadMaxQty()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L839) | :closed_lock_with_key: | GET | `/v5/spread/max-qty` | +| [submitSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L848) | :closed_lock_with_key: | POST | `/v5/spread/order/create` | +| [amendSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L861) | :closed_lock_with_key: | POST | `/v5/spread/order/amend` | +| [cancelSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L873) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel` | +| [cancelAllSpreadOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L891) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel-all` | +| [getSpreadOpenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L910) | :closed_lock_with_key: | GET | `/v5/spread/order/realtime` | +| [getSpreadOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L931) | :closed_lock_with_key: | GET | `/v5/spread/order/history` | +| [getSpreadTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L947) | :closed_lock_with_key: | GET | `/v5/spread/execution/list` | +| [getKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L967) | | GET | `/v5/market/kline` | +| [getMarkPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L984) | | GET | `/v5/market/mark-price-kline` | +| [getIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L999) | | GET | `/v5/market/index-price-kline` | +| [getPremiumIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1014) | | GET | `/v5/market/premium-index-price-kline` | +| [getInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1030) | | GET | `/v5/market/instruments-info` | +| [getInstrumentSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1044) | | GET | `/v5/market/instrument-summary` | +| [getOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1055) | | GET | `/v5/market/orderbook` | +| [getFullDepthOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1061) | | GET | `/v5/market/full_orderbook` | +| [getRPIOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1075) | | GET | `/v5/market/rpi_orderbook` | +| [getTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1081) | | GET | `/v5/market/tickers` | +| [getFundingRateHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1119) | | GET | `/v5/market/funding/history` | +| [getPublicTradingHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1134) | | GET | `/v5/market/recent-trade` | +| [getOpenInterest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1147) | | GET | `/v5/market/open-interest` | +| [getHistoricalVolatility()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1157) | | GET | `/v5/market/historical-volatility` | +| [getInsurance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1168) | | GET | `/v5/market/insurance` | +| [getRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1179) | | GET | `/v5/market/risk-limit` | +| [getOptionDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1194) | | GET | `/v5/market/delivery-price` | +| [getDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1207) | | GET | `/v5/market/delivery-price` | +| [getNewDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1223) | | GET | `/v5/market/new-delivery-price` | +| [getLongShortRatio()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1239) | | GET | `/v5/market/account-ratio` | +| [getIndexPriceComponents()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1249) | | GET | `/v5/market/index-price-components` | +| [getOrderPriceLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1255) | | GET | `/v5/market/price-limit` | +| [getADLAlert()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1269) | | GET | `/v5/market/adlAlert` | +| [getFeeGroupStructure()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1282) | | GET | `/v5/market/fee-group-info` | +| [getOptionBaseCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1291) | | GET | `/v5/market/option-base-coins` | +| [getCorporateActions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1297) | | GET | `/v5/market/corporate-action` | +| [submitOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1312) | :closed_lock_with_key: | POST | `/v5/order/create` | +| [amendOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1318) | :closed_lock_with_key: | POST | `/v5/order/amend` | +| [cancelOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1324) | :closed_lock_with_key: | POST | `/v5/order/cancel` | +| [getActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1333) | :closed_lock_with_key: | GET | `/v5/order/realtime` | +| [cancelAllOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1339) | :closed_lock_with_key: | POST | `/v5/order/cancel-all` | +| [getHistoricOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1356) | :closed_lock_with_key: | GET | `/v5/order/history` | +| [getExecutionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1368) | :closed_lock_with_key: | GET | `/v5/execution/list` | +| [batchSubmitOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1386) | :closed_lock_with_key: | POST | `/v5/order/create-batch` | +| [batchAmendOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1411) | :closed_lock_with_key: | POST | `/v5/order/amend-batch` | +| [batchCancelOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1436) | :closed_lock_with_key: | POST | `/v5/order/cancel-batch` | +| [getSpotBorrowCheck()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1458) | :closed_lock_with_key: | GET | `/v5/order/spot-borrow-check` | +| [setDisconnectCancelAllWindow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1479) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | +| [setDisconnectCancelAllWindowV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1497) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | +| [preCheckOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1512) | :closed_lock_with_key: | POST | `/v5/order/pre-check` | +| [createStrategyOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1529) | :closed_lock_with_key: | POST | `/v5/strategy/create` | +| [getStrategyList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1540) | :closed_lock_with_key: | GET | `/v5/strategy/list` | +| [getStrategyOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1551) | :closed_lock_with_key: | GET | `/v5/strategy/order-list` | +| [stopStrategy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1562) | :closed_lock_with_key: | POST | `/v5/strategy/stop` | +| [getPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1587) | :closed_lock_with_key: | GET | `/v5/position/list` | +| [getFuturesLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1599) | :closed_lock_with_key: | GET | `/v5/position/symbol-info` | +| [setLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1614) | :closed_lock_with_key: | POST | `/v5/position/set-leverage` | +| [switchIsolatedMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1627) | :closed_lock_with_key: | POST | `/v5/position/switch-isolated` | +| [setTPSLMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1641) | :closed_lock_with_key: | POST | `/v5/position/set-tpsl-mode` | +| [switchPositionMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1656) | :closed_lock_with_key: | POST | `/v5/position/switch-mode` | +| [setRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1670) | :closed_lock_with_key: | POST | `/v5/position/set-risk-limit` | +| [setTradingStop()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1685) | :closed_lock_with_key: | POST | `/v5/position/trading-stop` | +| [setAutoAddMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1696) | :closed_lock_with_key: | POST | `/v5/position/set-auto-add-margin` | +| [addOrReduceMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1708) | :closed_lock_with_key: | POST | `/v5/position/add-margin` | +| [getClosedPnL()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1720) | :closed_lock_with_key: | GET | `/v5/position/closed-pnl` | +| [getClosedOptionsPositions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1734) | :closed_lock_with_key: | GET | `/v5/position/get-closed-positions` | +| [movePosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1759) | :closed_lock_with_key: | POST | `/v5/position/move-positions` | +| [getMovePositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1770) | :closed_lock_with_key: | GET | `/v5/position/move-history` | +| [confirmNewRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1789) | :closed_lock_with_key: | POST | `/v5/position/confirm-pending-mmr` | +| [getPreUpgradeOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1809) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/order/history` | +| [getPreUpgradeTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1824) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/execution/list` | +| [getPreUpgradeClosedPnl()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1835) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/position/closed-pnl` | +| [getPreUpgradeTransactions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1849) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/account/transaction-log` | +| [getPreUpgradeOptionDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1866) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/delivery-record` | +| [getPreUpgradeUSDCSessionSettlements()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1880) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/settlement-record` | +| [getWalletBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1901) | :closed_lock_with_key: | GET | `/v5/account/wallet-balance` | +| [getTransferableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1912) | :closed_lock_with_key: | GET | `/v5/account/withdrawal` | +| [getAccountInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1929) | :closed_lock_with_key: | GET | `/v5/account/instruments-info` | +| [upgradeToUnifiedAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1940) | :closed_lock_with_key: | POST | `/v5/account/upgrade-to-uta` | +| [getBorrowHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1951) | :closed_lock_with_key: | GET | `/v5/account/borrow-history` | +| [repayLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1972) | :closed_lock_with_key: | POST | `/v5/account/quick-repayment` | +| [manualRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1997) | :closed_lock_with_key: | POST | `/v5/account/repay` | +| [setCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2006) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch` | +| [batchSetCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2012) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch-batch` | +| [getCollateralInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2022) | :closed_lock_with_key: | GET | `/v5/account/collateral-info` | +| [getCoinGreeks()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2031) | :closed_lock_with_key: | GET | `/v5/asset/coin-greeks` | +| [getFeeRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2044) | :closed_lock_with_key: | GET | `/v5/account/fee-rate` | +| [getAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2053) | :closed_lock_with_key: | GET | `/v5/account/info` | +| [getDCPInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2066) | :closed_lock_with_key: | GET | `/v5/account/query-dcp-info` | +| [getTransactionLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2073) | :closed_lock_with_key: | GET | `/v5/account/transaction-log` | +| [getClassicTransactionLogs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2084) | :closed_lock_with_key: | GET | `/v5/account/contract-transaction-log` | +| [getSMPGroup()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2095) | :closed_lock_with_key: | GET | `/v5/account/smp-group` | +| [setMarginMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2108) | :closed_lock_with_key: | POST | `/v5/account/set-margin-mode` | +| [setSpotHedging()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2125) | :closed_lock_with_key: | POST | `/v5/account/set-hedging-mode` | +| [setLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2138) | :closed_lock_with_key: | POST | `/v5/account/set-limit-px-action` | +| [getLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2149) | :closed_lock_with_key: | GET | `/v5/account/user-setting-config` | +| [setDeltaNeutralMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2157) | :closed_lock_with_key: | POST | `/v5/account/set-delta-mode` | +| [setMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2166) | :closed_lock_with_key: | POST | `/v5/account/mmp-modify` | +| [resetMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2173) | :closed_lock_with_key: | POST | `/v5/account/mmp-reset` | +| [getMMPState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2180) | :closed_lock_with_key: | GET | `/v5/account/mmp-state` | +| [getOptionAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2190) | :closed_lock_with_key: | GET | `/v5/account/option-asset-info` | +| [getPayInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2200) | :closed_lock_with_key: | GET | `/v5/account/pay-info` | +| [getTradeInfoForAnalysis()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2210) | :closed_lock_with_key: | GET | `/v5/account/trade-info-for-analysis` | +| [getAssetOverview()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2230) | :closed_lock_with_key: | GET | `/v5/asset/asset-overview` | +| [getPortfolioMarginInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2240) | :closed_lock_with_key: | GET | `/v5/asset/portfolio-margin` | +| [getTotalMembersAssets()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2250) | :closed_lock_with_key: | GET | `/v5/asset/total-members-assets` | +| [getFundingAccountTransactionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2262) | :closed_lock_with_key: | GET | `/v5/asset/fundinghistory` | +| [getDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2278) | :closed_lock_with_key: | GET | `/v5/asset/delivery-record` | +| [getSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2289) | :closed_lock_with_key: | GET | `/v5/asset/settlement-record` | +| [getCoinExchangeRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2302) | :closed_lock_with_key: | GET | `/v5/asset/exchange/order-record` | +| [getCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2317) | :closed_lock_with_key: | GET | `/v5/asset/coin/query-info` | +| [getSubUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2331) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-sub-member-list` | +| [getAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2346) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-asset-info` | +| [getAllCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2357) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | +| [getCoinBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2371) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coin-balance` | +| [getWithdrawableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2385) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/withdrawable-amount` | +| [getTransferableCoinList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2394) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-transfer-coin-list` | +| [createInternalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2410) | :closed_lock_with_key: | POST | `/v5/asset/transfer/inter-transfer` | +| [getInternalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2429) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-inter-transfer-list` | +| [enableUniversalTransferForSubUIDs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2449) | :closed_lock_with_key: | POST | `/v5/asset/transfer/save-transfer-sub-member` | +| [createUniversalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2460) | :closed_lock_with_key: | POST | `/v5/asset/transfer/universal-transfer` | +| [getUniversalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2472) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-universal-transfer-list` | +| [getAllowedDepositCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2485) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-allowed-list` | +| [setDepositAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2500) | :closed_lock_with_key: | POST | `/v5/asset/deposit/deposit-to-account` | +| [getDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2516) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-record` | +| [getSubAccountDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2531) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-record` | +| [getInternalDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2547) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-internal-record` | +| [getMasterDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2559) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-address` | +| [getSubDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2577) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | +| [querySubMemberAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2602) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | +| [getWithdrawalRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2622) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-record` | +| [getWithdrawalAddressList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2634) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-address` | +| [getExchangeEntities()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2648) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/vasp/list` | +| [submitDepositOriginatorInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2658) | :closed_lock_with_key: | POST | `/v5/asset/travel-rule/deposit/submit` | +| [submitWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2673) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/create` | +| [cancelWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2684) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/cancel` | +| [getConvertCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2693) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-coin-list` | +| [requestConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2704) | :closed_lock_with_key: | POST | `/v5/asset/exchange/quote-apply` | +| [confirmConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2713) | :closed_lock_with_key: | POST | `/v5/asset/exchange/convert-execute` | +| [getConvertStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2725) | :closed_lock_with_key: | GET | `/v5/asset/exchange/convert-result-query` | +| [getConvertHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2744) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-convert-history` | +| [getSmallBalanceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2761) | :closed_lock_with_key: | GET | `/v5/asset/covert/small-balance-list` | +| [getFiatTradingPairList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2775) | :closed_lock_with_key: | GET | `/v5/fiat/query-coin-list` | +| [createSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2793) | :closed_lock_with_key: | POST | `/v5/user/create-sub-member` | +| [createSubUIDAPIKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2805) | :closed_lock_with_key: | POST | `/v5/user/create-sub-api` | +| [getSubUIDList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2814) | :closed_lock_with_key: | GET | `/v5/user/query-sub-members` | +| [getSubUIDListUnlimited()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2823) | :closed_lock_with_key: | GET | `/v5/user/submembers` | +| [setSubUIDFrozenState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2841) | :closed_lock_with_key: | POST | `/v5/user/frozen-sub-member` | +| [getQueryApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2856) | :closed_lock_with_key: | GET | `/v5/user/query-api` | +| [getSubAccountAllApiKeys()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2863) | :closed_lock_with_key: | GET | `/v5/user/sub-apikeys` | +| [getUIDWalletType()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2872) | :closed_lock_with_key: | GET | `/v5/user/get-member-type` | +| [updateMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2891) | :closed_lock_with_key: | POST | `/v5/user/update-api` | +| [updateSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2905) | :closed_lock_with_key: | POST | `/v5/user/update-sub-api` | +| [deleteSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2918) | :closed_lock_with_key: | POST | `/v5/user/del-submember` | +| [deleteMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2933) | :closed_lock_with_key: | POST | `/v5/user/delete-api` | +| [deleteSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2947) | :closed_lock_with_key: | POST | `/v5/user/delete-sub-api` | +| [createTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2962) | :closed_lock_with_key: | POST | `/v5/fht/compliance/tax/private/batch_create` | +| [getTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2974) | :closed_lock_with_key: | GET | `/v5/fht/compliance/tax/private/batch_query` | +| [getAffiliateUserList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2997) | :closed_lock_with_key: | GET | `/v5/affiliate/aff-user-list` | +| [getAffiliateSubAffiliateList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3015) | :closed_lock_with_key: | GET | `/v5/affiliate/affiliate-sub-list` | +| [getAffiliateUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3031) | :closed_lock_with_key: | GET | `/v5/user/aff-customer-info` | +| [getFriendReferrals()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3043) | :closed_lock_with_key: | GET | `/v5/user/invitation/referrals` | +| [getReferralCode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3052) | :closed_lock_with_key: | GET | `/v5/user/invitation/code` | +| [getReferralCommissionRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3064) | :closed_lock_with_key: | POST | `/v5/referral/commission/records` | +| [getReferralCampaignRewards()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3077) | :closed_lock_with_key: | POST | `/v5/referral/campaign/rewards` | +| [getReferralUserIdentityProfile()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3092) | :closed_lock_with_key: | POST | `/v5/referral/user/identity-profile` | +| [getReferralUserInvitations()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3105) | :closed_lock_with_key: | POST | `/v5/referral/user/invitations` | +| [signAgreement()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3123) | :closed_lock_with_key: | POST | `/v5/user/agreement` | +| [getAlphaTradeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3140) | :closed_lock_with_key: | POST | `/v5/alpha/trade/quote` | +| [executeAlphaTradePurchase()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3151) | :closed_lock_with_key: | POST | `/v5/alpha/trade/purchase` | +| [executeAlphaTradeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3162) | :closed_lock_with_key: | POST | `/v5/alpha/trade/redeem` | +| [getAlphaPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3172) | :closed_lock_with_key: | POST | `/v5/alpha/trade/pay-token-list` | +| [getAlphaTradeOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3182) | :closed_lock_with_key: | POST | `/v5/alpha/trade/order-list` | +| [getAlphaBizTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3192) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-list` | +| [getAlphaBizTokenPriceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3202) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-price-list` | +| [getAlphaBizTokenDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3212) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-details` | +| [getAlphaAssetList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3222) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-list` | +| [getAlphaAssetDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3230) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-detail` | +| [getAlphaPredictionEngineStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3246) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/engine-status` | +| [getAlphaPredictionPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3256) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/pay-token-list` | +| [getAlphaPredictionEventDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3266) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/event-detail` | +| [getAlphaPredictionOrderEstimate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3276) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-estimate` | +| [executeAlphaPredictionBuy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3286) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/buy` | +| [executeAlphaPredictionSell()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3296) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sell` | +| [getAlphaPredictionOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3306) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-list` | +| [getAlphaPredictionOrderBook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3316) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-book` | +| [getAlphaPredictionTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3326) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/token-price` | +| [getAlphaPredictionPriceHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3336) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/price-history` | +| [getAlphaPredictionPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3346) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-list` | +| [getAlphaPredictionPositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3356) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-history` | +| [getAlphaPredictionPortfolioSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3366) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/portfolio-summary` | +| [getAlphaPredictionSideMarketList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3376) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/side-market-list` | +| [getAlphaPredictionSportsMatchList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3386) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/match-list` | +| [getAlphaPredictionSportsTimelineStages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3396) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/sports/timeline-stages` | +| [getAlphaPredictionSportsGroupStageDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3409) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/group-stage-detail` | +| [getAlphaLPPoolList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3428) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-list` | +| [getAlphaLPPoolInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3438) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-info` | +| [executeAlphaLPStake()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3448) | :closed_lock_with_key: | POST | `/v5/alpha/lp/stake` | +| [executeAlphaLPRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3458) | :closed_lock_with_key: | POST | `/v5/alpha/lp/redeem` | +| [getAlphaLPOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3468) | :closed_lock_with_key: | POST | `/v5/alpha/lp/order-list` | +| [getAlphaLPPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3478) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-list` | +| [getAlphaLPPayTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3488) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-price` | +| [getAlphaLPPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3498) | :closed_lock_with_key: | POST | `/v5/alpha/lp/position-list` | +| [getVIPMarginData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3518) | | GET | `/v5/spot-margin-trade/data` | +| [getHistoricalInterestRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3529) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/interest-rate-history` | +| [getSpotMarginCurrencyData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3554) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/currency-data` | +| [toggleSpotMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3566) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/switch-mode` | +| [setSpotMarginLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3577) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | +| [setSpotMarginLeverageV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3585) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | +| [getSpotMarginState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3596) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/state` | +| [manualBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3603) | :closed_lock_with_key: | POST | `/v5/account/borrow` | +| [getMaxBorrowableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3618) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/max-borrowable` | +| [getPositionTiers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3627) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/position-tiers` | +| [getCoinState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3638) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/coinstate` | +| [getAvailableAmountToRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3649) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/repayment-available-amount` | +| [manualRepayWithoutConversion()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3668) | :closed_lock_with_key: | POST | `/v5/account/no-convert-repay` | +| [getAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3681) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-auto-repay-mode` | +| [setAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3699) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-auto-repay-mode` | +| [getTradeAutoRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3714) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-trade-auto-repay` | +| [setTradeAutoRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3725) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-trade-auto-repay` | +| [getSpotMarginLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3737) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/liability` | +| [submitFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3746) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow` | +| [getFixedRateBorrowOrderInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3755) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-info` | +| [getFixedRateBorrowContractInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3772) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-contract-info` | +| [getFixedRateBorrowOrderQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3789) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-quote` | +| [renewFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3801) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-renew` | +| [getFixedRateBorrowInterestAccrued()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3807) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-interest-accrued` | +| [cancelFixedRateBorrowOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3821) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-order-cancel` | +| [getFlexibleAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3830) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/flexible-available-inventory` | +| [getFixedRateAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3839) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixed-available-inventory` | +| [getSpotMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3857) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/pledge-token` | +| [getSpotMarginBorrowableCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3874) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/borrow-token` | +| [getSpotMarginInterestAndQuota()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3891) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/loan-info` | +| [getSpotMarginLoanAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3909) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/account` | +| [spotMarginBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3933) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/loan` | +| [spotMarginRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3944) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/repay` | +| [getSpotMarginBorrowOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3959) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/orders` | +| [getSpotMarginRepaymentOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3988) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/repay-history` | +| [toggleSpotCrossMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4017) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/switch` | +| [getCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4037) | | GET | `/v5/crypto-loan/collateral-data` | +| [getBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4054) | | GET | `/v5/crypto-loan/loanable-data` | +| [getAccountBorrowCollateralLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4072) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrowable-collateralisable-number` | +| [borrowCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4092) | :closed_lock_with_key: | POST | `/v5/crypto-loan/borrow` | +| [repayCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4113) | :closed_lock_with_key: | POST | `/v5/crypto-loan/repay` | +| [getUnpaidLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4129) | :closed_lock_with_key: | GET | `/v5/crypto-loan/ongoing-orders` | +| [getRepaymentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4150) | :closed_lock_with_key: | GET | `/v5/crypto-loan/repayment-history` | +| [getCompletedLoanOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4170) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrow-history` | +| [getMaxAllowedReductionCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4189) | :closed_lock_with_key: | GET | `/v5/crypto-loan/max-collateral-amount` | +| [adjustCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4208) | :closed_lock_with_key: | POST | `/v5/crypto-loan/adjust-ltv` | +| [getLoanLTVAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4232) | :closed_lock_with_key: | GET | `/v5/crypto-loan/adjustment-history` | +| [getLoanBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4253) | | GET | `/v5/crypto-loan-common/loanable-data` | +| [getLoanCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4265) | | GET | `/v5/crypto-loan-common/collateral-data` | +| [getMaxCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4275) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/max-collateral-amount` | +| [getMaxLoanAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4294) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/max-loan` | +| [updateCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4304) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/adjust-ltv` | +| [getCollateralAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4315) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/adjustment-history` | +| [getCryptoLoanPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4330) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/position` | +| [borrowFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4347) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/borrow` | +| [repayFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4358) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay` | +| [repayCollateralFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4368) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | +| [getOngoingFlexibleLoans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4382) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/ongoing-coin` | +| [getBorrowHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4394) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/borrow-history` | +| [getRepaymentHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4407) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/repayment-history` | +| [getFlexibleLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4421) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/available-inventory` | +| [getSupplyOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4441) | | GET | `/v5/crypto-loan-fixed/supply-order-quote` | +| [getBorrowOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4454) | | GET | `/v5/crypto-loan-fixed/borrow-order-quote` | +| [createBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4467) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow` | +| [createSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4480) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply` | +| [cancelBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4490) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow-order-cancel` | +| [cancelSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4504) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply-order-cancel` | +| [getBorrowContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4517) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-contract-info` | +| [getSupplyContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4535) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-contract-info` | +| [getBorrowOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4553) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-order-info` | +| [getSupplyOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4566) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-order-info` | +| [repayFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4580) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/fully-repay` | +| [repayCollateralFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4591) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | +| [getRepaymentHistoryFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4604) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/repayment-history` | +| [renewBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4621) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/renew` | +| [getRenewOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4634) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/renew-info` | +| [getFixedLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4643) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/available-inventory` | +| [getInstitutionalLendingProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4658) | | GET | `/v5/ins-loan/product-infos` | +| [getInstitutionalLendingCoinDeltaAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4670) | :closed_lock_with_key: | GET | `/v5/ins-loan/coin-delta-amount` | +| [getInstitutionalLendingDelayLiquidationStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4679) | :closed_lock_with_key: | GET | `/v5/ins-loan/delay-liq-status` | +| [getInstitutionalLendingMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4689) | | GET | `/v5/ins-loan/ensure-tokens` | +| [getInstitutionalLendingMarginCoinInfoWithConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4698) | | GET | `/v5/ins-loan/ensure-tokens-convert` | +| [getInstitutionalLendingLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4707) | :closed_lock_with_key: | GET | `/v5/ins-loan/loan-order` | +| [getInstitutionalLendingRepayOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4719) | :closed_lock_with_key: | GET | `/v5/ins-loan/repaid-history` | +| [getInstitutionalLendingLTV()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4731) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv` | +| [getInstitutionalLendingLTVWithLadderConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4740) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv-convert` | +| [bindOrUnbindUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4755) | :closed_lock_with_key: | POST | `/v5/ins-loan/association-uid` | +| [repayInstitutionalLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4775) | :closed_lock_with_key: | POST | `/v5/ins-loan/repay-loan` | +| [getExchangeBrokerEarnings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4796) | :closed_lock_with_key: | GET | `/v5/broker/earnings-info` | +| [getExchangeBrokerAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4809) | :closed_lock_with_key: | GET | `/v5/broker/account-info` | +| [getBrokerSubAccountDeposits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4825) | :closed_lock_with_key: | GET | `/v5/broker/asset/query-sub-member-deposit-record` | +| [getBrokerVoucherSpec()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4840) | :closed_lock_with_key: | POST | `/v5/broker/award/info` | +| [issueBrokerVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4852) | :closed_lock_with_key: | POST | `/v5/broker/award/distribute-award` | +| [getBrokerIssuedVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4864) | :closed_lock_with_key: | POST | `/v5/broker/award/distribution-record` | +| [setBrokerRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4881) | :closed_lock_with_key: | POST | `/v5/broker/apilimit/set` | +| [getBrokerRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4900) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-cap` | +| [getAllBrokerRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4918) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-all` | +| [getEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4938) | | GET | `/v5/earn/product` | +| [getFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4949) | :closed_lock_with_key: | GET | `/v5/earn/flexible-saving/auto-savings` | +| [setFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4960) | :closed_lock_with_key: | POST | `/v5/earn/flexible-saving/auto-savings` | +| [getEarnCouponList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4970) | :closed_lock_with_key: | GET | `/v5/earn/coupons` | +| [getRWAProductList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4980) | | GET | `/v5/earn/rwa/product` | +| [placeRWAOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4990) | :closed_lock_with_key: | POST | `/v5/earn/rwa/place-order` | +| [getRWAPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4999) | :closed_lock_with_key: | GET | `/v5/earn/rwa/position` | +| [getRWAOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5008) | :closed_lock_with_key: | GET | `/v5/earn/rwa/order` | +| [getRWANavChart()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5018) | | GET | `/v5/earn/rwa/nav-chart` | +| [getHoldToEarnAirdropProducts()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5029) | | GET | `/v5/earn/hold-to-earn/product` | +| [getAdvanceEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5040) | | GET | `/v5/earn/advance/product` | +| [getLiquidityMiningProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5051) | | GET | `/v5/earn/liquidity-mining/product` | +| [reinvestLiquidityMining()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5064) | :closed_lock_with_key: | POST | `/v5/earn/liquidity-mining/reinvest` | +| [getFixedTermEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5075) | | GET | `/v5/earn/fixed-term/product` | +| [getAdvanceEarnProductExtraInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5087) | | GET | `/v5/earn/advance/product-extra-info` | +| [submitAdvanceEarnPlaceOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5098) | :closed_lock_with_key: | POST | `/v5/earn/advance/place-order` | +| [getAdvanceEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5109) | :closed_lock_with_key: | GET | `/v5/earn/advance/position` | +| [getAdvanceEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5120) | :closed_lock_with_key: | GET | `/v5/earn/advance/order` | +| [submitFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5131) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/place-order` | +| [redeemFixedTermEarn()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5142) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/redeem` | +| [getFixedTermEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5153) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/position` | +| [getFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5164) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/order` | +| [setFixedTermEarnAutoInvest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5175) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/position/auto-invest` | +| [submitStakeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5191) | :closed_lock_with_key: | POST | `/v5/earn/place-order` | +| [getEarnOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5210) | :closed_lock_with_key: | GET | `/v5/earn/order` | +| [getEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5228) | :closed_lock_with_key: | GET | `/v5/earn/position` | +| [modifyEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5241) | :closed_lock_with_key: | POST | `/v5/earn/position/modify` | +| [getEarnYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5254) | :closed_lock_with_key: | GET | `/v5/earn/yield` | +| [getHoldToEarnAirdropYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5268) | :closed_lock_with_key: | GET | `/v5/earn/hold-to-earn/yield-history` | +| [getEarnHourlyYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5279) | :closed_lock_with_key: | GET | `/v5/earn/hourly-yield` | +| [getEarnAprHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5293) | | GET | `/v5/earn/apr-history` | +| [getEarnTokenProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5303) | | GET | `/v5/earn/token/product` | +| [submitEarnTokenOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5312) | :closed_lock_with_key: | POST | `/v5/earn/token/place-order` | +| [getEarnTokenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5321) | :closed_lock_with_key: | GET | `/v5/earn/token/order` | +| [getEarnTokenPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5333) | :closed_lock_with_key: | GET | `/v5/earn/token/position` | +| [getEarnTokenDailyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5342) | :closed_lock_with_key: | GET | `/v5/earn/token/yield` | +| [getEarnTokenHourlyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5354) | :closed_lock_with_key: | GET | `/v5/earn/token/hourly-yield` | +| [getEarnTokenHistoryApr()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5366) | | GET | `/v5/earn/token/history-apr` | +| [getPwmInvestmentPlanList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5381) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/list` | +| [getPwmInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5390) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/detail` | +| [getPwmPendingInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5399) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/new-plan` | +| [claimPwmWithdrawableFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5408) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/claim` | +| [getPwmInvestmentPlanAssetTrend()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5417) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/asset-trend` | +| [getPwmFundHistoricalNav()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5426) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/fund-nav` | +| [subscribePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5435) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/subscribe` | +| [investMorePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5444) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/invest-more` | +| [redeemPwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5453) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/redeem` | +| [getPwmInvestmentPlanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5462) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/order` | +| [getPwmSubscribableProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5471) | | GET | `/v5/earn/pwm/customize-plan/product` | +| [createPwmCustomizeInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5480) | :closed_lock_with_key: | POST | `/v5/earn/pwm/customize-plan/create` | +| [getPwmAllFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5495) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-funds` | +| [settlePwmFundProfit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5504) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/settle-profit` | +| [createPwmFund()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5513) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-fund` | +| [createPwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5522) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-investment-plan` | +| [getPwmAssetManagerInvestmentPlans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5536) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/get-investment-plan` | +| [managePwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5548) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-investment-plan` | +| [getPwmAllFundOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5562) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-order` | +| [managePwmFundOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5571) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-order` | +| [createPwmFundSubAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5580) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-sub-account` | +| [pwmFundTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5592) | :closed_lock_with_key: | POST | `/v5/earn/pwm/fund-transfer` | +| [getPwmFundTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5601) | :closed_lock_with_key: | GET | `/v5/earn/pwm/query-fund-transfer-result` | +| [queryCardAssetRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5616) | :closed_lock_with_key: | POST | `/v5/card/transaction/query-asset-records` | +| [queryCardPointsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5625) | :closed_lock_with_key: | POST | `/v5/card/reward/points/balance` | +| [queryCardPointsRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5632) | :closed_lock_with_key: | POST | `/v5/card/reward/points/records` | +| [queryCardPointsTier()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5641) | :closed_lock_with_key: | POST | `/v5/card/reward/points/tier` | +| [queryCardMallItemList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5648) | :closed_lock_with_key: | POST | `/v5/card/reward/mall/item/list` | +| [queryCardPointCashbackDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5657) | :closed_lock_with_key: | POST | `/v5/card/reward/point/cashback/detail` | +| [createRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5673) | :closed_lock_with_key: | POST | `/v5/rfq/create-rfq` | +| [getRFQConfig()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5684) | :closed_lock_with_key: | GET | `/v5/rfq/config` | +| [cancelRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5693) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-rfq` | +| [cancelAllRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5703) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-rfq` | +| [createRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5712) | :closed_lock_with_key: | POST | `/v5/rfq/create-quote` | +| [executeRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5723) | :closed_lock_with_key: | POST | `/v5/rfq/execute-quote` | +| [cancelRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5734) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-quote` | +| [cancelAllRFQQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5744) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-quotes` | +| [getRFQRealtimeInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5758) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-realtime` | +| [getRFQHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5770) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-list` | +| [getRFQRealtimeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5784) | :closed_lock_with_key: | GET | `/v5/rfq/quote-realtime` | +| [getRFQHistoryQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5799) | :closed_lock_with_key: | GET | `/v5/rfq/quote-list` | +| [getRFQTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5812) | :closed_lock_with_key: | GET | `/v5/rfq/trade-list` | +| [getRFQPublicTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5825) | :closed_lock_with_key: | GET | `/v5/rfq/public-trades` | +| [acceptNonLPQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5841) | :closed_lock_with_key: | POST | `/v5/rfq/accept-other-quote` | +| [getRFQDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5847) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-detail-list` | +| [getP2PAccountCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5872) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | +| [getP2POnlineAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5889) | :closed_lock_with_key: | POST | `/v5/p2p/item/online` | +| [createP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5898) | :closed_lock_with_key: | POST | `/v5/p2p/item/create` | +| [cancelP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5907) | :closed_lock_with_key: | POST | `/v5/p2p/item/cancel` | +| [updateP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5921) | :closed_lock_with_key: | POST | `/v5/p2p/item/update` | +| [getP2PPersonalAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5931) | :closed_lock_with_key: | POST | `/v5/p2p/item/personal/list` | +| [getP2PAdDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5940) | :closed_lock_with_key: | POST | `/v5/p2p/item/info` | +| [getP2POrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5955) | :closed_lock_with_key: | POST | `/v5/p2p/order/simplifyList` | +| [getP2POrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5965) | :closed_lock_with_key: | POST | `/v5/p2p/order/info` | +| [getP2PPendingOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5974) | :closed_lock_with_key: | POST | `/v5/p2p/order/pending/simplifyList` | +| [markP2POrderAsPaid()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5983) | :closed_lock_with_key: | POST | `/v5/p2p/order/pay` | +| [releaseP2POrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5992) | :closed_lock_with_key: | POST | `/v5/p2p/order/finish` | +| [reviewP2PSellerCancelOrderApply()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6004) | :closed_lock_with_key: | POST | `/v5/p2p/order/buyer/examine/sellerCancelOrderApply` | +| [sendP2POrderMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6016) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/send` | +| [getP2PChatSessions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6031) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/list_v1` | +| [getP2PChatSessionId()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6041) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/getSessionId` | +| [sendP2PChatMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6077) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/send_v1` | +| [getP2PChatMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6089) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/listpage_v1` | +| [getP2POrderMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6098) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/listpage` | +| [getP2PUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6112) | :closed_lock_with_key: | POST | `/v5/p2p/user/personal/info` | +| [getP2PCounterpartyUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6119) | :closed_lock_with_key: | POST | `/v5/p2p/user/order/personal/info` | +| [getP2PUserPayments()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6128) | :closed_lock_with_key: | POST | `/v5/p2p/user/payment/list` | +| [setApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6148) | :closed_lock_with_key: | POST | `/v5/apilimit/set` | +| [queryApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6177) | :closed_lock_with_key: | GET | `/v5/apilimit/query` | +| [getRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6196) | :closed_lock_with_key: | GET | `/v5/apilimit/query-cap` | +| [getAllRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6215) | :closed_lock_with_key: | GET | `/v5/apilimit/query-all` | +| [getLaunchpoolProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6238) | | GET | `/v5/spot-x/launchpool/project/list` | +| [getLaunchpoolUserActivityLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6244) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/activity-log` | +| [getLaunchpoolCurrentStaking()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6250) | :closed_lock_with_key: | GET | `/v5/spot-x/launchpool/user/current-staking` | +| [getLaunchpoolUserHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6256) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/history` | +| [getPuzzleProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6262) | | GET | `/v5/spot-x/puzzle/project/list` | +| [getTokenSplashProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6268) | | GET | `/v5/spot-x/token-splash/project/list` | +| [getTokenSplashUserActivityParams()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6274) | :closed_lock_with_key: | GET | `/v5/spot-x/token-splash/user/activity-params` | +| [getEventInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6297) | | GET | `/v5/event/instruments-info` | +| [getEventOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6308) | | GET | `/v5/event/orderbook` | +| [getEventOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6319) | :closed_lock_with_key: | GET | `/v5/event/order-list` | +| [getEventActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6330) | :closed_lock_with_key: | GET | `/v5/event/order-realtime` | +| [getEventPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6341) | :closed_lock_with_key: | GET | `/v5/event/positions` | +| [getEventTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6352) | :closed_lock_with_key: | GET | `/v5/event/trades` | +| [getEventSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6363) | :closed_lock_with_key: | GET | `/v5/event/settlements` | +| [submitEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6374) | :closed_lock_with_key: | POST | `/v5/event/quotes` | +| [cancelEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6385) | :closed_lock_with_key: | POST | `/v5/event/cancel` | +| [cancelAllEventQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6396) | :closed_lock_with_key: | POST | `/v5/event/cancel-all` | # websocket-api-client.ts diff --git a/llms.txt b/llms.txt index 83b44da9..968de5cf 100644 --- a/llms.txt +++ b/llms.txt @@ -2976,7 +2976,7 @@ getMergedOrderBook( symbol: string, scale?: number, limit?: number, -): Promise> + ): Promise> ⋮---- /** * @@ -2984,7 +2984,7 @@ getMergedOrderBook( * */ ⋮---- -getServerTime(): Promise< +getServerTime(): Promise<{ time_now: numberInString }> ================ File: src/websocket-api-client.ts @@ -3056,7 +3056,7 @@ constructor( options?: WSClientConfigurableOptions & Partial, logger?: DefaultLogger, -) + ) ⋮---- public getWSClient(): WebsocketClient ⋮---- @@ -3075,7 +3075,7 @@ public setTimeOffsetMs(newOffset: number): void */ submitNewOrder( params: OrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Amend an order @@ -3085,7 +3085,7 @@ submitNewOrder( */ amendOrder( params: AmendOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel an order @@ -3095,7 +3095,7 @@ amendOrder( */ cancelOrder( params: CancelOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Batch submit orders @@ -3114,15 +3114,7 @@ batchSubmitOrders( 'order.create-batch', BatchOrdersRetExtInfoV5 > - > { - return this.wsClient.sendWSAPIRequest( - WS_KEY_MAP.v5PrivateTrade, - 'order.create-batch', - { - category, - request: orders, - }, - ); + > ⋮---- /** * Batch amend orders @@ -3141,15 +3133,7 @@ batchAmendOrder( 'order.amend-batch', BatchOrdersRetExtInfoV5 > - > { - return this.wsClient.sendWSAPIRequest( - WS_KEY_MAP.v5PrivateTrade, - 'order.amend-batch', - { - category, - request: orders, - }, - ); + > ⋮---- /** * Batch cancel orders @@ -3168,15 +3152,7 @@ batchCancelOrder( 'order.cancel-batch', BatchOrdersRetExtInfoV5 > - > { - return this.wsClient.sendWSAPIRequest( - WS_KEY_MAP.v5PrivateTrade, - 'order.cancel-batch', - { - category, - request: orders, - }, - ); + > ⋮---- /** * @@ -4235,77 +4211,6 @@ export interface GetEarnTokenHistoryAprParamsV5 { ⋮---- /** 1 = 7d, 2 = 30d, 3 = 180d */ -================ -File: src/types/request/v5-event.ts -================ -export interface GetEventInstrumentsInfoParamsV5 { - symbol?: string; - status?: 'PreLaunch' | 'Trading' | 'Delivering' | 'Closed'; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetEventOrderbookParamsV5 { - symbol: string; -} -⋮---- -export interface GetEventOrderHistoryParamsV5 { - symbol?: string; - orderId?: string; - orderLinkId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetEventActiveOrdersParamsV5 { - symbol?: string; - orderId?: string; - orderLinkId?: string; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetEventPositionInfoParamsV5 { - symbol?: string; - baseCoin?: string; - settleCoin?: string; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetEventTradeHistoryParamsV5 { - symbol: string; - orderId?: string; - orderLinkId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetEventSettlementRecordsParamsV5 { - symbol: string; - orderId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface SubmitEventQuoteParamsV5 { - symbol: string; - orderLinkId: string; - grossPayoutRatio: string; - amount: string; -} -⋮---- -export interface CancelEventQuoteParamsV5 { - orderLinkId?: string; - orderId?: string; -} - ================ File: src/types/request/v5-position.ts ================ @@ -4772,333 +4677,133 @@ export interface GetTokenSplashUserActivityParamsV5 { } ================ -File: src/types/request/v5-spreadtrading.ts +File: src/types/request/v5-tax.ts ================ -export interface GetSpreadInstrumentsInfoParamsV5 { - symbol?: string; - baseCoin?: string; - limit?: number; - cursor?: string; -} +export type TaxReportTypeV5 = + | 'ALL' + | 'TRADE' + | 'P&L' + | 'EARN' + | 'DEPOSIT&WITHDRAWAL' + | 'BONUS' + | 'AIRDROP' + | 'CARD'; ⋮---- -/** GET /v5/spread/max-qty */ -export interface GetSpreadMaxQtyParamsV5 { - symbol: string; - /** 1: Buy, 2: Sell */ - side: '1' | '2'; - orderPrice: string; +export interface TaxBatchExportItemV5 { + type: TaxReportTypeV5; + /** Subcategory number. Required but ignored when type is ALL; pass "". */ + number: string; } ⋮---- -/** 1: Buy, 2: Sell */ +/** Subcategory number. Required but ignored when type is ALL; pass "". */ ⋮---- -export interface SubmitSpreadOrderParamsV5 { - symbol: string; - side: 'Buy' | 'Sell'; - orderType: 'Limit' | 'Market'; - qty: string; - price: string; - orderLinkId: string; - timeInForce: 'IOC' | 'FOK' | 'GTC' | 'PostOnly'; +/** POST /v5/fht/compliance/tax/private/batch_create */ +export interface CreateTaxBatchExportParamsV5 { + /** UNIX seconds. Must be within the last 18 months. */ + startTime: number; + /** UNIX seconds. Later than startTime, span at most 12 months. */ + endTime: number; + items: TaxBatchExportItemV5[]; + sourceInstitution?: string; + /** orc is the default when omitted */ + exportFileType?: 'orc' | 'csv'; } ⋮---- -export interface AmendSpreadOrderParamsV5 { - symbol: string; - orderId?: string; - orderLinkId?: string; - qty?: string; - price?: string; -} +/** UNIX seconds. Must be within the last 18 months. */ ⋮---- -export interface GetSpreadOpenOrdersParamsV5 { - symbol?: string; - baseCoin?: string; - orderId?: string; - orderLinkId?: string; - limit?: number; - cursor?: string; +/** UNIX seconds. Later than startTime, span at most 12 months. */ +⋮---- +/** orc is the default when omitted */ +⋮---- +/** GET /v5/fht/compliance/tax/private/batch_query */ +export interface GetTaxBatchExportParamsV5 { + batchId: string; } -export interface GetSpreadOrderHistoryParamsV5 { - symbol?: string; - baseCoin?: string; - orderId?: string; - orderLinkId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; + +================ +File: src/types/response/contract.ts +================ +/* eslint-disable @typescript-eslint/no-explicit-any */ +export interface PaginatedResult { + nextPageCursor: string; + list: TList[]; +} +export interface ContractListResult { + category: string; + list: TList[]; } ⋮---- -export interface GetSpreadTradeHistoryParamsV5 { - symbol?: string; - orderId?: string; - orderLinkId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface ContractHistoricOrder { + symbol: string; + orderId: string; + orderLinkId: string; + side: string; + orderType: string; + price: string; + iv: string; + qty: string; + timeInForce: string; + orderStatus: string; + positionIdx: number; + lastPriceOnCreated: string; + createdTime: string; + updatedTime: string; + cancelType: string; + rejectReason: string; + stopOrderType: string; + triggerDirection: number; + triggerBy: string; + triggerPrice: string; + cumExecValue: string; + cumExecFee: string; + cumExecQty: string; + leavesValue: string; + leavesQty: string; + takeProfit: string; + stopLoss: string; + tpslMode: string; + tpLimitPrice: string; + slLimitPrice: string; + tpTriggerBy: string; + slTriggerBy: string; + reduceOnly: boolean; + closeOnTrigger: boolean; + blockTradeId: string; + smpType: string; + smpGroup: string; + smpOrderId: string; +} +⋮---- +export interface ContractSymbolTicker { + symbol: string; + bidPrice: string; + askPrice: string; + lastPrice: string; + lastTickDirection: string; + prevPrice24h: string; + price24hPcnt: string; + highPrice24h: string; + lowPrice24h: string; + prevPrice1h: string; + markPrice: string; + indexPrice: string; + openInterest: string; + turnover24h: string; + volume24h: string; + fundingRate: string; + nextFundingTime: string; + predictedDeliveryPrice: string; + basisRate: string; + deliveryFeeRate: string; + deliveryTime: string; } ================ -File: src/types/request/v5-strategy.ts +File: src/types/response/v5-alpha-lp.ts ================ -import { - OrderSideV5, - PositionIdx, - PovModeV5, - StrategyCategoryV5, - StrategyPreferV5, - StrategyTypeV5, -} from '../shared-v5'; -⋮---- -/** POST /v5/strategy/create */ -export interface CreateStrategyOrderParamsV5 { - category: StrategyCategoryV5; - symbol: string; - side: OrderSideV5; - strategyType: StrategyTypeV5; - /** Total order quantity (coin). Either size or positionValue is required */ - size?: string; - /** Total order quantity (value). Either size or positionValue is required */ - positionValue?: string; - reduceOnly?: boolean; - positionIdx?: PositionIdx; - /** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ - leverageType?: 0 | 1; - /** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ - duration?: number; - /** TWAP / POV: sub-order placement interval (seconds) */ - interval?: 5 | 10 | 15 | 30 | 60 | 120; - /** TWAP: randomize each sub-order quantity by ±20% */ - isRandom?: boolean; - /** Advanced: activate when market price reaches this value */ - triggerPrice?: string; - /** Advanced: terminate when last traded price reaches this value */ - maxChasePrice?: string; - /** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ - chaseDistance?: string; - /** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ - chasePercentE4?: number; - /** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ - chasePrice?: string; - strategyPrefer?: StrategyPreferV5; - limitPrice?: string; - strategySl?: string; - strategyTp?: string; - /** Iceberg: 0 = taker allowed, 1 = post-only */ - postOnly?: 0 | 1; - isRebalance?: boolean; - /** 1: market, 2: limit */ - orderType?: 1 | 2; - orderPriceOffset?: string; - strategyName?: string; - /** POV execution mode */ - mode?: PovModeV5; - /** POV participation rate */ - participationRate?: string; - /** POV: historical traded volume window (seconds), range [60, 14400] */ - referenceWindow?: string; - /** POV: book depth reference levels [1, 10] */ - depthReference?: string; -} -⋮---- -/** Total order quantity (coin). Either size or positionValue is required */ -⋮---- -/** Total order quantity (value). Either size or positionValue is required */ -⋮---- -/** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ -⋮---- -/** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ -⋮---- -/** TWAP / POV: sub-order placement interval (seconds) */ -⋮---- -/** TWAP: randomize each sub-order quantity by ±20% */ -⋮---- -/** Advanced: activate when market price reaches this value */ -⋮---- -/** Advanced: terminate when last traded price reaches this value */ -⋮---- -/** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ -⋮---- -/** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ -⋮---- -/** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ -⋮---- -/** Iceberg: 0 = taker allowed, 1 = post-only */ -⋮---- -/** 1: market, 2: limit */ -⋮---- -/** POV execution mode */ -⋮---- -/** POV participation rate */ -⋮---- -/** POV: historical traded volume window (seconds), range [60, 14400] */ -⋮---- -/** POV: book depth reference levels [1, 10] */ -⋮---- -/** GET /v5/strategy/list */ -export interface GetStrategyListParamsV5 { - strategyId?: string; - symbol?: string; - /** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ - status?: '2' | '3' | '4' | '5' | '6'; - category?: StrategyCategoryV5; - strategyType?: StrategyTypeV5; - beginTimeE0?: number; - endTimeE0?: number; - pageSize?: number; - cursor?: string; -} -⋮---- -/** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ -⋮---- -/** GET /v5/strategy/order-list */ -export interface GetStrategyOrderListParamsV5 { - strategyId: string; - /** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ - status?: '2' | '3' | '4' | '5' | '6' | '7'; - symbol?: string; - strategyType?: StrategyTypeV5; - beginTimeE0?: number; - endTimeE0?: number; - pageSize?: number; - cursor?: string; -} -⋮---- -/** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ -⋮---- -/** POST /v5/strategy/stop */ -export interface StopStrategyParamsV5 { - strategyId: string; -} - -================ -File: src/types/request/v5-tax.ts -================ -export type TaxReportTypeV5 = - | 'ALL' - | 'TRADE' - | 'P&L' - | 'EARN' - | 'DEPOSIT&WITHDRAWAL' - | 'BONUS' - | 'AIRDROP' - | 'CARD'; -⋮---- -export interface TaxBatchExportItemV5 { - type: TaxReportTypeV5; - /** Subcategory number. Required but ignored when type is ALL; pass "". */ - number: string; -} -⋮---- -/** Subcategory number. Required but ignored when type is ALL; pass "". */ -⋮---- -/** POST /v5/fht/compliance/tax/private/batch_create */ -export interface CreateTaxBatchExportParamsV5 { - /** UNIX seconds. Must be within the last 18 months. */ - startTime: number; - /** UNIX seconds. Later than startTime, span at most 12 months. */ - endTime: number; - items: TaxBatchExportItemV5[]; - sourceInstitution?: string; - /** orc is the default when omitted */ - exportFileType?: 'orc' | 'csv'; -} -⋮---- -/** UNIX seconds. Must be within the last 18 months. */ -⋮---- -/** UNIX seconds. Later than startTime, span at most 12 months. */ -⋮---- -/** orc is the default when omitted */ -⋮---- -/** GET /v5/fht/compliance/tax/private/batch_query */ -export interface GetTaxBatchExportParamsV5 { - batchId: string; -} - -================ -File: src/types/response/contract.ts -================ -/* eslint-disable @typescript-eslint/no-explicit-any */ -export interface PaginatedResult { - nextPageCursor: string; - list: TList[]; -} -export interface ContractListResult { - category: string; - list: TList[]; -} -⋮---- -export interface ContractHistoricOrder { - symbol: string; - orderId: string; - orderLinkId: string; - side: string; - orderType: string; - price: string; - iv: string; - qty: string; - timeInForce: string; - orderStatus: string; - positionIdx: number; - lastPriceOnCreated: string; - createdTime: string; - updatedTime: string; - cancelType: string; - rejectReason: string; - stopOrderType: string; - triggerDirection: number; - triggerBy: string; - triggerPrice: string; - cumExecValue: string; - cumExecFee: string; - cumExecQty: string; - leavesValue: string; - leavesQty: string; - takeProfit: string; - stopLoss: string; - tpslMode: string; - tpLimitPrice: string; - slLimitPrice: string; - tpTriggerBy: string; - slTriggerBy: string; - reduceOnly: boolean; - closeOnTrigger: boolean; - blockTradeId: string; - smpType: string; - smpGroup: string; - smpOrderId: string; -} -⋮---- -export interface ContractSymbolTicker { - symbol: string; - bidPrice: string; - askPrice: string; - lastPrice: string; - lastTickDirection: string; - prevPrice24h: string; - price24hPcnt: string; - highPrice24h: string; - lowPrice24h: string; - prevPrice1h: string; - markPrice: string; - indexPrice: string; - openInterest: string; - turnover24h: string; - volume24h: string; - fundingRate: string; - nextFundingTime: string; - predictedDeliveryPrice: string; - basisRate: string; - deliveryFeeRate: string; - deliveryTime: string; -} - -================ -File: src/types/response/v5-alpha-lp.ts -================ -/** - * V5 private Alpha LP responses. - */ +/** + * V5 private Alpha LP responses. + */ ⋮---- export interface AlphaLPPoolV5 { poolAddress: string; @@ -6751,243 +6456,7 @@ export interface EarnTokenHistoryAprPointV5 { } ================ -File: src/types/response/v5-event.ts -================ -export type EventContractTypeV5 = 'Up_Down' | 'UpDown' | 'Target' | 'Range'; -export type EventContractDirectionV5 = - | 'UP' - | 'DOWN' - | 'ABOVE' - | 'BELOW' - | 'RANGE_IN' - | 'RANGE_OUT'; -⋮---- -export interface EventInstrumentFeeRateRuleV5 { - minSecToDelivery: number; - maxSecToDelivery: number; - baseMarkup: string; -} -⋮---- -export interface EventInstrumentQuotationLimitV5 { - minSecToDelivery: number; - maxSecToDelivery: number; - quoteMaxAmountPerUser: string; - quoteMinAmountPerUser: string; - quoteMinAmount: string; -} -⋮---- -export interface EventInstrumentLotSizeFilterV5 { - minOrderAmount: string; - maxOrderAmount: string; - orderAmountTickSize: string; - quoteMaxValidMs: number; - quoteMinIntervalPerUserMs: number; -} -⋮---- -export interface EventInstrumentInfoV5 { - symbol: string; - symbolId: number; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - eventContractType: EventContractTypeV5 | string; - durationWindow: string | number; - rvThreshold: string; - rebate: string; - takerFeeRate: string; - makerFeeRate: string; - launchTime: string; - deliveryTime: string; - status: string; - targetPrice: string; - lowerBound: string; - upperBound: string; - callOptionSymbolId: number; - putOptionSymbolId: number; - feeRateRule: EventInstrumentFeeRateRuleV5[]; - lotSizeFilter: EventInstrumentLotSizeFilterV5; - quotationLimit: EventInstrumentQuotationLimitV5[]; -} -⋮---- -export interface EventInstrumentInfoResultV5 { - nextPageCursor: string; - list: EventInstrumentInfoV5[]; -} -⋮---- -/** REST Get Orderbook: each entry is [payoutRatio, orderValue] */ -export type EventOrderbookLevelV5 = [string, string]; -⋮---- -export interface EventOrderbookV5 { - s: string; - r: EventOrderbookLevelV5[]; - ts: number; - u: number; - seq: number; - cts: number; -} -⋮---- -export interface EventOrderHistoryItemV5 { - orderId: string; - orderLinkId: string; - orderStatus: string; - symbol: string; - symbolId: string; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - ecDirection: EventContractDirectionV5 | string; - ecDurationWindow: string; - ecTargetPrice: string; - ecContractType: EventContractTypeV5 | string; - ecLowerBound: string; - ecUpperBound: string; - settleTimeMs: string; - ecOrderValue: string; - ecIndexPrice: string; - orderAvgPayoutRatio: string; - cumExecValue: string; - payoutRatio: string; - tradeFee: string; - transTime: string; - createTime: string; - updateTime: string; - cumPayout: string; - cumExecFee: string; - cancelType: string; - createType: string; - rejectReason: string; - extraFees: string; -} -⋮---- -export interface EventOrderHistoryResultV5 { - list: EventOrderHistoryItemV5[]; - cursor: string; -} -⋮---- -export interface EventActiveOrderV5 { - orderId: string; - orderLinkId: string; - symbol: string; - symbolId: string; - side: string; - orderStatus: string; - payoutRatio: string; - cumExecValue: string; - cumExecFee: string; - leavesValue: string; - ecContractType: EventContractTypeV5 | string; - ecDirection: EventContractDirectionV5 | string; - ecOrderValue: string; - ecSettleTime: string; - ecTargetPrice: string; - ecLowerBound: string; - ecUpperBound: string; - ecDurationWindow: string; - ecIndexPrice: string; - orderAvgPayoutRatio: string; - createType: string; - createdTime: string; - updatedTime: string; -} -⋮---- -export interface EventActiveOrdersResultV5 { - list: EventActiveOrderV5[]; - nextPageCursor: string; -} -⋮---- -export interface EventPositionV5 { - symbol: string; - baseCoin: string; - settleCoin: string; - side: string; - ecContractType: EventContractTypeV5 | string; - ecDirection: EventContractDirectionV5 | string; - avgPayoutRatio: string; - positionValue: string; - ecSettleTime: string; - cumClosedPnl: string; - createdTime: string; - updatedTime: string; - seq: number; -} -⋮---- -export interface EventPositionInfoResultV5 { - list: EventPositionV5[]; - nextPageCursor: string; -} -⋮---- -export interface EventTradeV5 { - orderId: string; - orderLinkId: string; - execId: string; - symbol: string; - baseCoin: string; - settleCoin: string; - side: string; - execType: string; - execPrice: string; - execValue: string; - execFee: string; - execFeeRate: string; - orderPrice: string; - feeCoin: string; - transTime: string; - timeInForce: string; - crossSeq: string; - ecPayout: string; - ecDurationWindow: string; - settleTimeMs: string; - ecOrderValue: string; - ecContractType: EventContractTypeV5 | string; - ecDirection: EventContractDirectionV5 | string; - ecTargetPrice: string; - ecLowerBound: string; - ecUpperBound: string; - extraFees: string; -} -⋮---- -export interface EventTradeHistoryResultV5 { - list: EventTradeV5[]; - cursor: string; -} -⋮---- -export interface EventSettlementV5 { - transId: string; - symbol: string; - symbolId: string; - baseCoin: string; - settleCoin: string; - side: string; - ecContractType: EventContractTypeV5 | string; - ecDirection: EventContractDirectionV5 | string; - settlePrice: string; - entryPrice: string; - grossPayoutRatio: string; - ecDurationWindow: string; - ecTargetPrice: string; - ecLowerBound: string; - ecUpperBound: string; - transTime: string; - crossSeq: string; - execFee: string; - execFeeRate: string; - payout: string; - sessionRpl: string; - orderId: string; -} -⋮---- -export interface EventSettlementRecordsResultV5 { - list: EventSettlementV5[]; - cursor: string; -} -⋮---- -export interface EventQuoteResultV5 { - orderLinkId: string; - orderId: string; -} - -================ -File: src/types/response/v5-rfq.ts +File: src/types/response/v5-rfq.ts ================ export interface RFQConfigV5 { deskCode: string; // Own deskCode, unique identification code @@ -8239,30 +7708,109 @@ export interface ReinvestLiquidityMiningParamsV5 { } ================ -File: src/types/request/v5-p2p-trading.ts +File: src/types/request/v5-event.ts ================ -export interface GetP2PAccountCoinsBalanceParamsV5 { - memberId?: string; - accountType: string; - coin?: string; - withBonus?: 0 | 1; +export interface GetEventInstrumentsInfoParamsV5 { + symbol?: string; + status?: 'PreLaunch' | 'Trading' | 'Delivering' | 'Closed'; + limit?: number; + cursor?: string; } ⋮---- -export interface GetP2POnlineAdsParamsV5 { - tokenId: string; - currencyId: string; - side: '0' | '1'; // 0: buy; 1: sell - page?: string; - size?: string; +export interface GetEventOrderbookParamsV5 { + symbol: string; } ⋮---- -side: '0' | '1'; // 0: buy; 1: sell -⋮---- -export interface P2PTradingPreferenceSetV5 { - hasUnPostAd?: 0 | 1; - isKyc?: 0 | 1; - isEmail?: 0 | 1; - isMobile?: 0 | 1; +export interface GetEventOrderHistoryParamsV5 { + symbol?: string; + orderId?: string; + orderLinkId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} +⋮---- +export interface GetEventActiveOrdersParamsV5 { + symbol?: string; + orderId?: string; + orderLinkId?: string; + limit?: number; + cursor?: string; +} +⋮---- +export interface GetEventPositionInfoParamsV5 { + symbol?: string; + baseCoin?: string; + settleCoin?: string; + limit?: number; + cursor?: string; +} +⋮---- +export interface GetEventTradeHistoryParamsV5 { + symbol: string; + orderId?: string; + orderLinkId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} +⋮---- +export interface GetEventSettlementRecordsParamsV5 { + symbol: string; + orderId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} +⋮---- +export interface SubmitEventQuoteParamsV5 { + symbol: string; + orderLinkId: string; + grossPayoutRatio: string; + amount: string; + /** Automatically cancel after this many milliseconds. 0 uses quoteMaxValidMs; non-zero values must not exceed quoteMaxValidMs */ + cancelAfterMs?: number; +} +⋮---- +/** Automatically cancel after this many milliseconds. 0 uses quoteMaxValidMs; non-zero values must not exceed quoteMaxValidMs */ +⋮---- +export interface CancelEventQuoteParamsV5 { + orderLinkId?: string; + orderId?: string; +} +⋮---- +export interface CancelAllEventQuotesParamsV5 { + symbol: string; +} + +================ +File: src/types/request/v5-p2p-trading.ts +================ +export interface GetP2PAccountCoinsBalanceParamsV5 { + memberId?: string; + accountType: string; + coin?: string; + withBonus?: 0 | 1; +} +⋮---- +export interface GetP2POnlineAdsParamsV5 { + tokenId: string; + currencyId: string; + side: '0' | '1'; // 0: buy; 1: sell + page?: string; + size?: string; +} +⋮---- +side: '0' | '1'; // 0: buy; 1: sell +⋮---- +export interface P2PTradingPreferenceSetV5 { + hasUnPostAd?: 0 | 1; + isKyc?: 0 | 1; + isEmail?: 0 | 1; + isMobile?: 0 | 1; hasRegisterTime?: 0 | 1; registerTimeThreshold?: number; orderFinishNumberDay30?: number; @@ -8443,156 +7991,280 @@ export interface GetP2PChatMessagesParamsV5 { /** AES encrypted session ID. */ ================ -File: src/types/request/v5-trade.ts +File: src/types/request/v5-spreadtrading.ts ================ -import { - CategoryV5, - OrderFilterV5, - OrderSideV5, - OrderSMPTypeV5, - OrderStatusV5, - OrderTimeInForceV5, - OrderTriggerByV5, - OrderTypeV5, - PositionIdx, - StopOrderTypeV5, -} from '../shared-v5'; +export interface GetSpreadInstrumentsInfoParamsV5 { + symbol?: string; + baseCoin?: string; + limit?: number; + cursor?: string; +} ⋮---- -export interface OrderParamsV5 { - category: CategoryV5; +/** GET /v5/spread/max-qty */ +export interface GetSpreadMaxQtyParamsV5 { symbol: string; - isLeverage?: 0 | 1; - side: OrderSideV5; - orderType: OrderTypeV5; - qty: string; - marketUnit?: 'baseCoin' | 'quoteCoin'; - slippageToleranceType?: string; - slippageTolerance?: string; - price?: string; - triggerDirection?: 1 | 2; - orderFilter?: OrderFilterV5; - triggerPrice?: string; - triggerBy?: OrderTriggerByV5; - orderIv?: string; - timeInForce?: OrderTimeInForceV5; - positionIdx?: PositionIdx; - orderLinkId?: string; - takeProfit?: string; - stopLoss?: string; - tpTriggerBy?: OrderTriggerByV5; - slTriggerBy?: OrderTriggerByV5; - reduceOnly?: boolean; - closeOnTrigger?: boolean; - smpType?: OrderSMPTypeV5; - mmp?: boolean; - tpslMode?: 'Full' | 'Partial'; - tpLimitPrice?: string; - slLimitPrice?: string; - tpOrderType?: OrderTypeV5; - slOrderType?: OrderTypeV5; - bboSideType?: 'Queue' | 'Counterparty'; - bboLevel?: '1' | '2' | '3' | '4' | '5'; - /** Limit IOC/FOK is supported when this is true. */ - rpiTakerAccess?: boolean; + /** 1: Buy, 2: Sell */ + side: '1' | '2'; + orderPrice: string; } ⋮---- -/** Limit IOC/FOK is supported when this is true. */ +/** 1: Buy, 2: Sell */ ⋮---- -export interface AmendOrderParamsV5 { - category: CategoryV5; +export interface SubmitSpreadOrderParamsV5 { symbol: string; - orderId?: string; - orderLinkId?: string; - orderIv?: string; - triggerPrice?: string; - qty?: string; - price?: string; - tpslMode?: 'Full' | 'Partial'; - takeProfit?: string; - stopLoss?: string; - tpTriggerBy?: OrderTriggerByV5; - slTriggerBy?: OrderTriggerByV5; - triggerBy?: OrderTriggerByV5; - tpLimitPrice?: string; - slLimitPrice?: string; + side: 'Buy' | 'Sell'; + orderType: 'Limit' | 'Market'; + qty: string; + price: string; + orderLinkId: string; + timeInForce: 'IOC' | 'FOK' | 'GTC' | 'PostOnly'; } ⋮---- -export interface CancelOrderParamsV5 { - category: CategoryV5; +export interface AmendSpreadOrderParamsV5 { symbol: string; orderId?: string; orderLinkId?: string; - orderFilter?: OrderFilterV5; + qty?: string; + price?: string; } ⋮---- -export interface GetAccountOrdersParamsV5 { - category: CategoryV5; +export interface GetSpreadOpenOrdersParamsV5 { symbol?: string; baseCoin?: string; - settleCoin?: string; orderId?: string; orderLinkId?: string; - openOnly?: 0 | 1 | 2; - orderFilter?: OrderFilterV5; - orderStatus?: OrderStatusV5; limit?: number; cursor?: string; } -⋮---- -export interface GetAccountHistoricOrdersParamsV5 { - category: CategoryV5; +export interface GetSpreadOrderHistoryParamsV5 { symbol?: string; baseCoin?: string; - settleCoin?: string; orderId?: string; orderLinkId?: string; - orderFilter?: OrderFilterV5; - orderStatus?: OrderStatusV5; + /** + * Filter by order status. Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 + */ + orderStatus?: 'Rejected' | 'Cancelled' | 'Filled'; startTime?: number; endTime?: number; limit?: number; cursor?: string; } ⋮---- -export interface CancelAllOrdersParamsV5 { - category: CategoryV5; +/** + * Filter by order status. Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 + */ +⋮---- +export interface GetSpreadTradeHistoryParamsV5 { symbol?: string; - baseCoin?: string; - settleCoin?: string; - orderFilter?: OrderFilterV5; - stopOrderType?: StopOrderTypeV5; + orderId?: string; + orderLinkId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } + +================ +File: src/types/request/v5-strategy.ts +================ +import { + OrderSideV5, + PositionIdx, + PovModeV5, + StrategyCategoryV5, + StrategyPreferV5, + StrategyTypeV5, +} from '../shared-v5'; ⋮---- -export interface BatchOrderParamsV5 { +/** POST /v5/strategy/create */ +export interface CreateStrategyOrderParamsV5 { + category: StrategyCategoryV5; symbol: string; side: OrderSideV5; - isLeverage?: 0 | 1; - orderType: OrderTypeV5; - qty: string; - price?: string; - triggerDirection?: 1 | 2; - triggerBy?: OrderTriggerByV5; - orderIv?: string; - timeInForce?: OrderTimeInForceV5; - positionIdx?: PositionIdx; - orderLinkId?: string; - takeProfit?: string; - stopLoss?: string; - tpTriggerBy?: OrderTriggerByV5; - slTriggerBy?: OrderTriggerByV5; + strategyType: StrategyTypeV5; + /** Total order quantity (coin). Either size or positionValue is required */ + size?: string; + /** Total order quantity (value). Either size or positionValue is required */ + positionValue?: string; reduceOnly?: boolean; - closeOnTrigger?: boolean; - smpType?: OrderSMPTypeV5; - mmp?: boolean; - tpslMode?: 'Full' | 'Partial'; - tpLimitPrice?: string; - slLimitPrice?: string; - tpOrderType?: OrderTypeV5; - slOrderType?: OrderTypeV5; -} -⋮---- -export interface BatchAmendOrderParamsV5 { - symbol: string; + positionIdx?: PositionIdx; + /** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ + leverageType?: 0 | 1; + /** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ + duration?: number; + /** TWAP / POV: sub-order placement interval (seconds) */ + interval?: 5 | 10 | 15 | 30 | 60 | 120; + /** TWAP: randomize each sub-order quantity by ±20% */ + isRandom?: boolean; + /** Advanced: activate when market price reaches this value */ + triggerPrice?: string; + /** Advanced: terminate when last traded price reaches this value */ + maxChasePrice?: string; + /** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ + chaseDistance?: string; + /** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ + chasePercentE4?: number; + /** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ + chasePrice?: string; + strategyPrefer?: StrategyPreferV5; + limitPrice?: string; + strategySl?: string; + strategyTp?: string; + /** Iceberg: 0 = taker allowed, 1 = post-only */ + postOnly?: 0 | 1; + isRebalance?: boolean; + /** 1: market, 2: limit */ + orderType?: 1 | 2; + orderPriceOffset?: string; + strategyName?: string; + /** POV execution mode */ + mode?: PovModeV5; + /** POV participation rate */ + participationRate?: string; + /** POV: historical traded volume window (seconds), range [60, 14400] */ + referenceWindow?: string; + /** POV: book depth reference levels [1, 10] */ + depthReference?: string; +} +⋮---- +/** Total order quantity (coin). Either size or positionValue is required */ +⋮---- +/** Total order quantity (value). Either size or positionValue is required */ +⋮---- +/** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ +⋮---- +/** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ +⋮---- +/** TWAP / POV: sub-order placement interval (seconds) */ +⋮---- +/** TWAP: randomize each sub-order quantity by ±20% */ +⋮---- +/** Advanced: activate when market price reaches this value */ +⋮---- +/** Advanced: terminate when last traded price reaches this value */ +⋮---- +/** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ +⋮---- +/** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ +⋮---- +/** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ +⋮---- +/** Iceberg: 0 = taker allowed, 1 = post-only */ +⋮---- +/** 1: market, 2: limit */ +⋮---- +/** POV execution mode */ +⋮---- +/** POV participation rate */ +⋮---- +/** POV: historical traded volume window (seconds), range [60, 14400] */ +⋮---- +/** POV: book depth reference levels [1, 10] */ +⋮---- +/** + * GET /v5/strategy/list + * The range between beginTimeE0 and endTimeE0 (Unix timestamps in seconds) cannot exceed one year. + */ +export interface GetStrategyListParamsV5 { + strategyId?: string; + symbol?: string; + /** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ + status?: '2' | '3' | '4' | '5' | '6'; + category?: StrategyCategoryV5; + strategyType?: StrategyTypeV5; + beginTimeE0?: number; + endTimeE0?: number; + pageSize?: number; + cursor?: string; +} +⋮---- +/** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ +⋮---- +/** + * GET /v5/strategy/order-list + * The range between beginTimeE0 and endTimeE0 (Unix timestamps in seconds) cannot exceed one year. + */ +export interface GetStrategyOrderListParamsV5 { + strategyId: string; + /** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ + status?: '2' | '3' | '4' | '5' | '6' | '7'; + symbol?: string; + strategyType?: StrategyTypeV5; + beginTimeE0?: number; + endTimeE0?: number; + pageSize?: number; + cursor?: string; +} +⋮---- +/** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ +⋮---- +/** POST /v5/strategy/stop */ +export interface StopStrategyParamsV5 { + strategyId: string; +} + +================ +File: src/types/request/v5-trade.ts +================ +import { + CategoryV5, + OrderFilterV5, + OrderSideV5, + OrderSMPTypeV5, + OrderStatusV5, + OrderTimeInForceV5, + OrderTriggerByV5, + OrderTypeV5, + PositionIdx, + StopOrderTypeV5, +} from '../shared-v5'; +⋮---- +export interface OrderParamsV5 { + category: CategoryV5; + symbol: string; + isLeverage?: 0 | 1; + side: OrderSideV5; + orderType: OrderTypeV5; + qty: string; + marketUnit?: 'baseCoin' | 'quoteCoin'; + slippageToleranceType?: string; + slippageTolerance?: string; + price?: string; + triggerDirection?: 1 | 2; + orderFilter?: OrderFilterV5; + triggerPrice?: string; + triggerBy?: OrderTriggerByV5; + orderIv?: string; + timeInForce?: OrderTimeInForceV5; + positionIdx?: PositionIdx; + orderLinkId?: string; + takeProfit?: string; + stopLoss?: string; + tpTriggerBy?: OrderTriggerByV5; + slTriggerBy?: OrderTriggerByV5; + reduceOnly?: boolean; + closeOnTrigger?: boolean; + smpType?: OrderSMPTypeV5; + mmp?: boolean; + tpslMode?: 'Full' | 'Partial'; + tpLimitPrice?: string; + slLimitPrice?: string; + tpOrderType?: OrderTypeV5; + slOrderType?: OrderTypeV5; + bboSideType?: 'Queue' | 'Counterparty'; + bboLevel?: '1' | '2' | '3' | '4' | '5'; + /** Limit IOC/FOK is supported when this is true. */ + rpiTakerAccess?: boolean; +} +⋮---- +/** Limit IOC/FOK is supported when this is true. */ +⋮---- +export interface AmendOrderParamsV5 { + category: CategoryV5; + symbol: string; orderId?: string; orderLinkId?: string; orderIv?: string; @@ -8609,67 +8281,403 @@ export interface BatchAmendOrderParamsV5 { slLimitPrice?: string; } ⋮---- -export interface BatchCancelOrderParamsV5 { +export interface CancelOrderParamsV5 { + category: CategoryV5; symbol: string; orderId?: string; orderLinkId?: string; -} - -================ -File: src/types/response/v5-earn-liquidity-mining.ts -================ -export interface LiquidityMiningApyBreakdownV5 { - coin: string; - apy: string; -} -⋮---- -export interface LiquidityMiningProductV5 { - productId: string; - baseCoin: string; - quoteCoin: string; - status: 'Available' | 'NotAvailable' | string; - maxLeverage: number; - minInvestmentQuote: string; - minInvestmentBase: string; - maxInvestmentQuote: string; - maxInvestmentBase: string; - minWithdrawalAmount: string; - minReinvestAmount: string; - baseCoinPrecision: number; - quoteCoinPrecision: number; - yieldCoins: string[]; - apyE8: string; - apy7dE8: string; - poolLiquidityValue: string; - dailyYield: string; - slippageRateE8List: string[]; - apyBreakdown: LiquidityMiningApyBreakdownV5[]; - apy7dBreakdown: LiquidityMiningApyBreakdownV5[]; - slippage_levels?: string[]; + orderFilter?: OrderFilterV5; } ⋮---- -export interface LiquidityMiningProductResultV5 { - products: LiquidityMiningProductV5[]; +export interface GetAccountOrdersParamsV5 { + category: CategoryV5; + symbol?: string; + baseCoin?: string; + settleCoin?: string; + orderId?: string; + orderLinkId?: string; + openOnly?: 0 | 1 | 2; + orderFilter?: OrderFilterV5; + orderStatus?: OrderStatusV5; + limit?: number; + cursor?: string; } ⋮---- -export interface ReinvestLiquidityMiningResultV5 { - orderId: string; - orderLinkId: string; +export interface GetAccountHistoricOrdersParamsV5 { + category: CategoryV5; + symbol?: string; + baseCoin?: string; + settleCoin?: string; + orderId?: string; + orderLinkId?: string; + orderFilter?: OrderFilterV5; + orderStatus?: OrderStatusV5; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } - -================ -File: src/types/response/v5-p2p-trading.ts -================ -import { P2PTradingPreferenceSetV5 } from '../request/v5-p2p-trading'; ⋮---- -export interface P2PCoinBalanceV5 { - coin: string; - transferBalance: string; - walletBalance: string; - bonus: string; +export interface CancelAllOrdersParamsV5 { + category: CategoryV5; + symbol?: string; + baseCoin?: string; + settleCoin?: string; + orderFilter?: OrderFilterV5; + stopOrderType?: StopOrderTypeV5; } ⋮---- -export interface P2PAccountCoinsBalanceV5 { +export interface BatchOrderParamsV5 { + symbol: string; + side: OrderSideV5; + isLeverage?: 0 | 1; + orderType: OrderTypeV5; + qty: string; + price?: string; + triggerDirection?: 1 | 2; + triggerBy?: OrderTriggerByV5; + orderIv?: string; + timeInForce?: OrderTimeInForceV5; + positionIdx?: PositionIdx; + orderLinkId?: string; + takeProfit?: string; + stopLoss?: string; + tpTriggerBy?: OrderTriggerByV5; + slTriggerBy?: OrderTriggerByV5; + reduceOnly?: boolean; + closeOnTrigger?: boolean; + smpType?: OrderSMPTypeV5; + mmp?: boolean; + tpslMode?: 'Full' | 'Partial'; + tpLimitPrice?: string; + slLimitPrice?: string; + tpOrderType?: OrderTypeV5; + slOrderType?: OrderTypeV5; +} +⋮---- +export interface BatchAmendOrderParamsV5 { + symbol: string; + orderId?: string; + orderLinkId?: string; + orderIv?: string; + triggerPrice?: string; + qty?: string; + price?: string; + tpslMode?: 'Full' | 'Partial'; + takeProfit?: string; + stopLoss?: string; + tpTriggerBy?: OrderTriggerByV5; + slTriggerBy?: OrderTriggerByV5; + triggerBy?: OrderTriggerByV5; + tpLimitPrice?: string; + slLimitPrice?: string; +} +⋮---- +export interface BatchCancelOrderParamsV5 { + symbol: string; + orderId?: string; + orderLinkId?: string; +} + +================ +File: src/types/response/v5-earn-liquidity-mining.ts +================ +export interface LiquidityMiningApyBreakdownV5 { + coin: string; + apy: string; +} +⋮---- +export interface LiquidityMiningProductV5 { + productId: string; + baseCoin: string; + quoteCoin: string; + status: 'Available' | 'NotAvailable' | string; + maxLeverage: number; + minInvestmentQuote: string; + minInvestmentBase: string; + maxInvestmentQuote: string; + maxInvestmentBase: string; + minWithdrawalAmount: string; + minReinvestAmount: string; + baseCoinPrecision: number; + quoteCoinPrecision: number; + yieldCoins: string[]; + apyE8: string; + apy7dE8: string; + poolLiquidityValue: string; + dailyYield: string; + slippageRateE8List: string[]; + apyBreakdown: LiquidityMiningApyBreakdownV5[]; + apy7dBreakdown: LiquidityMiningApyBreakdownV5[]; + slippage_levels?: string[]; +} +⋮---- +export interface LiquidityMiningProductResultV5 { + products: LiquidityMiningProductV5[]; +} +⋮---- +export interface ReinvestLiquidityMiningResultV5 { + orderId: string; + orderLinkId: string; +} + +================ +File: src/types/response/v5-event.ts +================ +export type EventContractTypeV5 = 'Up_Down' | 'UpDown' | 'Target' | 'Range'; +export type EventContractDirectionV5 = + | 'UP' + | 'DOWN' + | 'ABOVE' + | 'BELOW' + | 'RANGE_IN' + | 'RANGE_OUT'; +⋮---- +export interface EventInstrumentFeeRateRuleV5 { + minSecToDelivery: number; + maxSecToDelivery: number; + baseMarkup: string; +} +⋮---- +export interface EventInstrumentQuotationLimitV5 { + minSecToDelivery: number; + maxSecToDelivery: number; + quoteMaxAmountPerUser: string; + quoteMinAmountPerUser: string; + quoteMinAmount: string; +} +⋮---- +export interface EventInstrumentLotSizeFilterV5 { + minOrderAmount: string; + maxOrderAmount: string; + orderAmountTickSize: string; + quoteMaxValidMs: number; + quoteMinIntervalPerUserMs: number; +} +⋮---- +export interface EventInstrumentInfoV5 { + symbol: string; + symbolId: number; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + eventContractType: EventContractTypeV5 | string; + durationWindow: string | number; + rvThreshold: string; + rebate: string; + takerFeeRate: string; + makerFeeRate: string; + launchTime: string; + deliveryTime: string; + status: string; + targetPrice: string; + lowerBound: string; + upperBound: string; + callOptionSymbolId: number; + putOptionSymbolId: number; + feeRateRule: EventInstrumentFeeRateRuleV5[]; + lotSizeFilter: EventInstrumentLotSizeFilterV5; + quotationLimit: EventInstrumentQuotationLimitV5[]; +} +⋮---- +export interface EventInstrumentInfoResultV5 { + nextPageCursor: string; + list: EventInstrumentInfoV5[]; +} +⋮---- +/** REST Get Orderbook: each entry is [payoutRatio, orderValue] */ +export type EventOrderbookLevelV5 = [string, string]; +⋮---- +export interface EventOrderbookV5 { + s: string; + r: EventOrderbookLevelV5[]; + ts: number; + u: number; + seq: number; + cts: number; +} +⋮---- +export interface EventOrderHistoryItemV5 { + orderId: string; + orderLinkId: string; + orderStatus: string; + symbol: string; + symbolId: string; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + ecDirection: EventContractDirectionV5 | string; + ecDurationWindow: string; + ecTargetPrice: string; + ecContractType: EventContractTypeV5 | string; + ecLowerBound: string; + ecUpperBound: string; + settleTimeMs: string; + ecOrderValue: string; + ecIndexPrice: string; + orderAvgPayoutRatio: string; + cumExecValue: string; + payoutRatio: string; + tradeFee: string; + transTime: string; + createTime: string; + updateTime: string; + cumPayout: string; + cumExecFee: string; + cancelType: string; + createType: string; + rejectReason: string; + extraFees: string; +} +⋮---- +export interface EventOrderHistoryResultV5 { + list: EventOrderHistoryItemV5[]; + cursor: string; +} +⋮---- +export interface EventActiveOrderV5 { + orderId: string; + orderLinkId: string; + symbol: string; + symbolId: string; + side: string; + orderStatus: string; + payoutRatio: string; + cumExecValue: string; + cumExecFee: string; + leavesValue: string; + ecContractType: EventContractTypeV5 | string; + ecDirection: EventContractDirectionV5 | string; + ecOrderValue: string; + ecSettleTime: string; + ecTargetPrice: string; + ecLowerBound: string; + ecUpperBound: string; + ecDurationWindow: string; + ecIndexPrice: string; + orderAvgPayoutRatio: string; + createType: string; + createdTime: string; + updatedTime: string; +} +⋮---- +export interface EventActiveOrdersResultV5 { + list: EventActiveOrderV5[]; + nextPageCursor: string; +} +⋮---- +export interface EventPositionV5 { + symbol: string; + baseCoin: string; + settleCoin: string; + side: string; + ecContractType: EventContractTypeV5 | string; + ecDirection: EventContractDirectionV5 | string; + avgPayoutRatio: string; + positionValue: string; + ecSettleTime: string; + cumClosedPnl: string; + createdTime: string; + updatedTime: string; + seq: number; +} +⋮---- +export interface EventPositionInfoResultV5 { + list: EventPositionV5[]; + nextPageCursor: string; +} +⋮---- +export interface EventTradeV5 { + orderId: string; + orderLinkId: string; + execId: string; + symbol: string; + baseCoin: string; + settleCoin: string; + side: string; + execType: string; + execPrice: string; + execValue: string; + execFee: string; + execFeeRate: string; + orderPrice: string; + feeCoin: string; + transTime: string; + timeInForce: string; + crossSeq: string; + ecPayout: string; + ecDurationWindow: string; + settleTimeMs: string; + ecOrderValue: string; + ecContractType: EventContractTypeV5 | string; + ecDirection: EventContractDirectionV5 | string; + ecTargetPrice: string; + ecLowerBound: string; + ecUpperBound: string; + extraFees: string; +} +⋮---- +export interface EventTradeHistoryResultV5 { + list: EventTradeV5[]; + cursor: string; +} +⋮---- +export interface EventSettlementV5 { + transId: string; + symbol: string; + symbolId: string; + baseCoin: string; + settleCoin: string; + side: string; + ecContractType: EventContractTypeV5 | string; + ecDirection: EventContractDirectionV5 | string; + settlePrice: string; + entryPrice: string; + grossPayoutRatio: string; + ecDurationWindow: string; + ecTargetPrice: string; + ecLowerBound: string; + ecUpperBound: string; + transTime: string; + crossSeq: string; + execFee: string; + execFeeRate: string; + payout: string; + sessionRpl: string; + orderId: string; +} +⋮---- +export interface EventSettlementRecordsResultV5 { + list: EventSettlementV5[]; + cursor: string; +} +⋮---- +export interface EventQuoteResultV5 { + orderLinkId: string; + orderId: string; +} +⋮---- +export interface CancelAllEventQuotesResultV5 { + list: EventQuoteResultV5[]; + /** 1: success; 0: failed */ + success: '1' | '0'; +} +⋮---- +/** 1: success; 0: failed */ + +================ +File: src/types/response/v5-p2p-trading.ts +================ +import { P2PTradingPreferenceSetV5 } from '../request/v5-p2p-trading'; +⋮---- +export interface P2PCoinBalanceV5 { + coin: string; + transferBalance: string; + walletBalance: string; + bonus: string; +} +⋮---- +export interface P2PAccountCoinsBalanceV5 { memberId: string; accountType: string; balance: P2PCoinBalanceV5[]; @@ -10241,216 +10249,54 @@ export interface RepayCollateralFixedParamsV5 { ⋮---- export interface GetRepaymentHistoryFixedParamsV5 { repayId?: string; - loanCurrency?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface RenewBorrowOrderFixedParamsV5 { - loanId: string; - collateralList?: { - currency?: string; - amount?: string; - }[]; -} -⋮---- -export interface GetRenewOrderInfoFixedParamsV5 { - orderId?: string; - orderCurrency?: string; - limit?: string; - cursor?: string; -} -⋮---- -// Max Loan Amount Request Types -⋮---- -export interface GetMaxLoanAmountParamsV5 { - currency: string; // Coin to borrow - collateralList?: { - ccy: string; // Collateral coin - amount: string; // Collateral amount - }[]; -} -⋮---- -currency: string; // Coin to borrow -⋮---- -ccy: string; // Collateral coin -amount: string; // Collateral amount -⋮---- -// Institutional Loan Request Types -⋮---- -export interface GetCoinDeltaAmountParamsV5 { - coin?: string; -} -⋮---- -export interface RepayInstitutionalLoanParamsV5 { - token: string; // Coin name - quantity: string; // The qty to be repaid -} -⋮---- -token: string; // Coin name -quantity: string; // The qty to be repaid - -================ -File: src/types/request/v5-spot-leverage-token.ts -================ -import { LTOrderTypeV5 } from '../shared-v5'; -⋮---- -export interface PurchaseSpotLeveragedTokenParamsV5 { - ltCoin: string; - amount: string; - serialNo?: string; -} -⋮---- -export interface RedeemSpotLeveragedTokenParamsV5 { - ltCoin: string; - quantity: string; - serialNo?: string; -} -⋮---- -export interface GetSpotLeveragedTokenOrderHistoryParamsV5 { - ltCoin?: string; - orderId?: string; - startTime?: number; - endTime?: number; - limit?: number; - ltOrderType?: LTOrderTypeV5; - serialNo?: string; -} -⋮---- -export interface GetVIPMarginDataParamsV5 { - vipLevel?: string; - currency?: string; -} -⋮---- -export interface GetSpotMarginCurrencyDataParamsV5 { - currency?: string; -} -⋮---- -// Spot Margin Trade (UTA) endpoints -export interface ManualBorrowParamsV5 { - coin: string; - amount: string; -} -⋮---- -export interface GetMaxBorrowableAmountParamsV5 { - currency: string; -} -⋮---- -export interface GetPositionTiersParamsV5 { - currency?: string; -} -⋮---- -export interface GetCoinStateParamsV5 { - currency?: string; -} -⋮---- -export interface GetAvailableAmountToRepayParamsV5 { - currency: string; -} -⋮---- -export interface SetSpotMarginLeverageParamsV5 { - leverage: string; - currency?: string; -} -⋮---- -export interface ManualRepayWithoutConversionParamsV5 { - coin: string; - amount?: string; - /** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - */ - repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; -} -⋮---- -/** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - */ -⋮---- -export interface GetAutoRepayModeParamsV5 { - currency?: string; // Coin name, uppercase only. If not passed, returns all currencies -} -⋮---- -currency?: string; // Coin name, uppercase only. If not passed, returns all currencies -⋮---- -export interface SetAutoRepayModeParamsV5 { - currency?: string; // Coin name, uppercase only. If not passed, enables for all currencies - autoRepayMode: '0' | '1'; // 0: Off, 1: On -} -⋮---- -currency?: string; // Coin name, uppercase only. If not passed, enables for all currencies -autoRepayMode: '0' | '1'; // 0: Off, 1: On -⋮---- -export interface GetSpotMarginLiabilityInfoParamsV5 { - currency: string; -} -⋮---- -export interface FixedRateBorrowParamsV5 { - orderCurrency: string; - orderAmount: string; - /** e.g. 0.02 = 2% p.a. */ - annualRate: string; - /** 7, 14, 30, 90, 180 (days) */ - term: string; - /** 1: auto repayment; 2: transfer to flexible loan */ - repayType?: '1' | '2'; -} -⋮---- -/** e.g. 0.02 = 2% p.a. */ -⋮---- -/** 7, 14, 30, 90, 180 (days) */ -⋮---- -/** 1: auto repayment; 2: transfer to flexible loan */ -⋮---- -export interface GetFixedRateBorrowOrderInfoParamsV5 { - orderId?: string; - orderCurrency?: string; - state?: string; - term?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface GetFixedRateBorrowContractInfoParamsV5 { - orderId?: string; - orderCurrency?: string; - term?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface GetFixedRateBorrowOrderQuoteParamsV5 { - orderCurrency: string; - term?: string; - orderBy?: 'apy' | 'term' | 'quantity'; - sort?: 0 | 1; - limit?: number; + loanCurrency?: string; + limit?: string; + cursor?: string; } ⋮---- -export interface RenewFixedRateBorrowParamsV5 { +export interface RenewBorrowOrderFixedParamsV5 { loanId: string; - qty?: string; + collateralList?: { + currency?: string; + amount?: string; + }[]; } ⋮---- -export interface GetFixedRateBorrowInterestAccruedParamsV5 { +export interface GetRenewOrderInfoFixedParamsV5 { orderId?: string; orderCurrency?: string; limit?: string; cursor?: string; } ⋮---- -export interface CancelFixedRateBorrowOrderParamsV5 { - orderId: string; +// Max Loan Amount Request Types +⋮---- +export interface GetMaxLoanAmountParamsV5 { + currency: string; // Coin to borrow + collateralList?: { + ccy: string; // Collateral coin + amount: string; // Collateral amount + }[]; } ⋮---- -export interface GetFlexibleAvailableInventoryParamsV5 { - currency: string; +currency: string; // Coin to borrow +⋮---- +ccy: string; // Collateral coin +amount: string; // Collateral amount +⋮---- +// Institutional Loan Request Types +⋮---- +export interface GetCoinDeltaAmountParamsV5 { + coin?: string; } ⋮---- -export interface GetFixedRateAvailableInventoryParamsV5 { - currency: string; - term: string; - annualRate: string; +export interface RepayInstitutionalLoanParamsV5 { + token: string; // Coin name + quantity: string; // The qty to be repaid } +⋮---- +token: string; // Coin name +quantity: string; // The qty to be repaid ================ File: src/types/request/v5-user.ts @@ -11238,7 +11084,7 @@ public subscribeV5( wsTopics: WsTopic[] | WsTopic, category: WSCategoryV5, isPrivateTopic?: boolean, -): Promise[] + ): Promise[] ⋮---- // Sort into per-WsKey batches, in case there is a mix of topics here ⋮---- @@ -11262,7 +11108,7 @@ public unsubscribeV5( wsTopics: WsTopic[] | WsTopic, category: WSCategoryV5, isPrivateTopic?: boolean, -): Promise[] + ): Promise[] ⋮---- // Sort into per-WsKey batches, in case there is a mix of topics here ⋮---- @@ -11289,7 +11135,7 @@ public subscribe( | (WsTopicRequest | WsTopic) | (WsTopicRequest | WsTopic)[], requestedWsKey?: WsKey, -) + ) ⋮---- // Batch sub topics per ws key ⋮---- @@ -11305,7 +11151,7 @@ public unsubscribe( | (WsTopicRequest | WsTopic) | (WsTopicRequest | WsTopic)[], wsKey?: WsKey, -) + ) ⋮---- // Batch sub topics per ws key ⋮---- @@ -11389,7 +11235,7 @@ async sendWSAPIRequest< operation: TWSOperation, params: TWSParams, requestFlags?: WSAPIRequestFlags, -): Promise + ): Promise ⋮---- // Some commands don't require authentication. ⋮---- @@ -11439,21 +11285,21 @@ private async signMessage( secret: string, method?: 'hex' | 'base64', algorithm: SignAlgorithm = 'SHA-256', -): Promise + ): Promise ⋮---- protected async getWsAuthRequestEvent( wsKey: WsKey, -): Promise> + ): Promise> ⋮---- private async getWsAuthSignature( wsKey: WsKey, -): Promise< + ): Promise<{ expiresAt: number; signature: string }> ⋮---- undefined, // Let the function automatically determine encoding based on key type ⋮---- private async signWSAPIRequest( requestEvent: WSAPIRequest, -): Promise> + ): Promise> ⋮---- // Not needed for Bybit. Auth happens only on connection open, automatically. ⋮---- @@ -11475,7 +11321,7 @@ protected async getWsRequestEvents( requests: WsTopicRequest[], // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars _wsKey: WsKey, -): Promise>[]> + ): Promise>[]> ⋮---- // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars ⋮---- @@ -11506,7 +11352,7 @@ protected isWsPong(msg: any): boolean protected resolveEmittableEvents( wsKey: WsKey, event: MessageEventLike, -): EmittableEvent[] + ): EmittableEvent[] ⋮---- // this.logger.trace('resolveEmittableEvents', { // ...WS_LOGGER_CATEGORY, @@ -11653,729 +11499,639 @@ export interface GetHoldToEarnAirdropYieldHistoryParamsV5 { /** Pagination cursor from previous `nextCursor` */ ================ -File: src/types/response/v5-account.ts +File: src/types/request/v5-spot-leverage-token.ts ================ -import { - AccountMarginModeV5, - AccountTypeV5, - CategoryV5, - TransactionTypeV5, - UnifiedUpdateStatusV5, -} from '../shared-v5'; -⋮---- -export interface WalletBalanceV5Coin { - coin: string; - equity: string; - usdValue: string; - walletBalance: string; - free: string; // spot only - locked: string; // spot only - borrowAmount: string; - availableToBorrow: string; // deprecated field - availableToWithdraw: string; - accruedInterest: string; - totalOrderIM: string; - totalPositionIM: string; - totalPositionMM: string; - unrealisedPnl: string; - cumRealisedPnl: string; - bonus: string; - marginCollateral: boolean; - collateralSwitch: boolean; - spotBorrow: string; - colRes?: string; -} -⋮---- -free: string; // spot only -locked: string; // spot only -⋮---- -availableToBorrow: string; // deprecated field -⋮---- -export interface WalletBalanceV5 { - accountType: AccountTypeV5; - accountLTV: string; - accountIMRate: string; - accountMMRate: string; - accountIMRateByMp: string; - accountMMRateByMp: string; - totalInitialMarginByMp: string; - totalMaintenanceMarginByMp: string; - totalEquity: string; - totalWalletBalance: string; - totalMarginBalance: string; - totalAvailableBalance: string; - totalPerpUPL: string; - totalInitialMargin: string; - totalMaintenanceMargin: string; - coin: WalletBalanceV5Coin[]; -} -⋮---- -export interface UnifiedAccountUpgradeResultV5 { - unifiedUpdateStatus: UnifiedUpdateStatusV5; - unifiedUpdateMsg: { - msg: string[] | null; - }; -} +import { LTOrderTypeV5 } from '../shared-v5'; ⋮---- -export interface BorrowHistoryRecordV5 { - currency: string; - createdTime: number; - borrowCost: string; - hourlyBorrowRate: string; - InterestBearingBorrowSize: string; - costExemption: string; - borrowAmount: string; - unrealisedLoss: string; - freeBorrowedAmount: string; +export interface PurchaseSpotLeveragedTokenParamsV5 { + ltCoin: string; + amount: string; + serialNo?: string; } ⋮---- -export interface CollateralInfoV5 { - currency: string; - hourlyBorrowRate: string; - maxBorrowingAmount: string; - freeBorrowAmount: string; - freeBorrowingLimit: string; - borrowAmount: string; - availableToBorrow: string; - borrowable: boolean; - borrowUsageRate: string; - marginCollateral: boolean; - collateralSwitch: boolean; - collateralRatio: string; +export interface RedeemSpotLeveragedTokenParamsV5 { + ltCoin: string; + quantity: string; + serialNo?: string; } ⋮---- -export interface CoinGreeksV5 { - baseCoin: string; - totalDelta: string; - totalGamma: string; - totalVega: string; - totalTheta: string; +export interface GetSpotLeveragedTokenOrderHistoryParamsV5 { + ltCoin?: string; + orderId?: string; + startTime?: number; + endTime?: number; + limit?: number; + ltOrderType?: LTOrderTypeV5; + serialNo?: string; } ⋮---- -export interface FeeRateV5 { - symbol: string; - baseCoin: string; - takerFeeRate: string; - makerFeeRate: string; - rpiMakerFeeRate?: string; +export interface GetVIPMarginDataParamsV5 { + vipLevel?: string; + currency?: string; } ⋮---- -export interface AccountInfoV5 { - unifiedMarginStatus: number; - marginMode: AccountMarginModeV5; - isMasterTrader: boolean; - spotHedgingStatus: string; - updatedTime: string; +export interface GetSpotMarginCurrencyDataParamsV5 { + currency?: string; } ⋮---- -/** - * Get Trade Behaviour Config / `getLimitPriceAction()` — `/v5/account/user-setting-config` - */ -export interface UserSettingConfigV5 { - lpaSpot: boolean; - lpaPerp: boolean; - /** Spot MNT fee deduction enabled. */ - smsef?: boolean; - /** Futures MNT fee deduction enabled. */ - fmsef?: boolean; - /** Delta Neutral mode; may be absent on older API responses. */ - deltaEnable?: boolean; - smpType?: '0' | '1' | '2' | '3' | string; +// Spot Margin Trade (UTA) endpoints +export interface ManualBorrowParamsV5 { + coin: string; + amount: string; } ⋮---- -/** Spot MNT fee deduction enabled. */ -⋮---- -/** Futures MNT fee deduction enabled. */ -⋮---- -/** Delta Neutral mode; may be absent on older API responses. */ -⋮---- -export interface TransactionLogV5 { - symbol: string; - category: CategoryV5; - side: string; - transactionTime: string; - type: TransactionTypeV5; - qty: string; - size: string; +export interface GetMaxBorrowableAmountParamsV5 { currency: string; - tradePrice: string; - funding: string; - fee: string; - cashFlow: string; - change: string; - cashBalance: string; - feeRate: string; - bonusChange: string; - tradeId: string; - orderId: string; - orderLinkId: string; - extraFees: string; - transSubType: string; - displayType?: string; -} -⋮---- -export interface MMPStateV5 { - baseCoin: string; - mmpEnabled: boolean; - window: string; - frozenPeriod: string; - qtyLimit: string; - deltaLimit: string; - vegaLimit?: string; - mmpFrozenUntil: string; - mmpFrozen: boolean; -} -⋮---- -export interface RepayLiabilityResultV5 { - coin: string; - repaymentQty: string; } ⋮---- -export interface DCPInfoV5 { - product: 'SPOT' | 'DERIVATIVES' | 'OPTIONS'; - dcpStatus: 'ON'; - timeWindow: string; +export interface GetPositionTiersParamsV5 { + currency?: string; } ⋮---- -export interface ManualRepayResultV5 { - resultStatus: 'P' | 'SU' | 'FA'; +export interface GetCoinStateParamsV5 { + currency?: string; } ⋮---- -/** GET /v5/account/option-asset-info — response `result` wraps a nested `result` array. */ -export interface OptionAssetInfoRowV5 { - coin: string; - totalDelta: string; - totalRPL: string; - totalUPL: string; - assetIM: string; - assetMM: string; - sendTime: number; +export interface GetAvailableAmountToRepayParamsV5 { + currency: string; } ⋮---- -export interface OptionAssetInfoNestedResultV5 { - result: OptionAssetInfoRowV5[]; +export interface SetSpotMarginLeverageParamsV5 { + leverage: string; + currency?: string; } ⋮---- -/** GET /v5/account/pay-info */ -export interface PayInfoCollateralItemV5 { +export interface ManualRepayWithoutConversionParamsV5 { coin: string; - availableSize: string; - availableValue: string; - coinScale: number; - borrowSize: string; - spotHedgeAmount: string; - assetFrozen: string; + amount?: string; + /** + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. + */ + repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; } ⋮---- -export interface PayInfoBorrowBlockV5 { - coin?: string; - borrowSize: string; - borrowValue?: string; - assetFrozen: string; - availableBalance: string; -} +/** + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. + */ ⋮---- -export interface PayInfoResultV5 { - collateralInfo: { - collateralList: PayInfoCollateralItemV5[]; - }; - borrowInfo: PayInfoBorrowBlockV5; +export interface GetAutoRepayModeParamsV5 { + currency?: string; // Coin name, uppercase only. If not passed, returns all currencies } ⋮---- -/** GET /v5/account/trade-info-for-analysis */ -export interface TradeInfoAnalysisDailyV5 { - day: string; - sumBuyExecValue: string; - sumSellExecValue: string; - sumExecValue: string; -} +currency?: string; // Coin name, uppercase only. If not passed, returns all currencies ⋮---- -export interface TradeInfoForAnalysisResultV5 { - symbolRnl: string; - netExecQty: string; - sumExecValue: string; - sumExecQty: string; - avgBuyExecPrice: string; - sumBuyExecValue: string; - sumBuyExecQty: string; - sumBuyExecFee: string; - sumBuyOrderQty: string; - avgSellExecPrice: string; - sumSellExecValue: string; - sumSellExecQty: string; - sumSellExecFee: string; - sumSellOrderQty: string; - maxMarginVersion: number; - baseCoin: string; - settleCoin: string; - sumPriceList?: TradeInfoAnalysisDailyV5[]; +export interface SetAutoRepayModeParamsV5 { + /** Coin name, uppercase only. If omitted, sets the global switch; when enabled, includes currencies that become borrowable later */ + currency?: string; + autoRepayMode: '0' | '1'; // 0: Off, 1: On } - -================ -File: src/types/response/v5-position.ts -================ -import { - CategoryV5, - ExecTypeV5, - OrderSideV5, - OrderTypeV5, - PositionIdx, - PositionSideV5, - PositionStatusV5, - StopOrderTypeV5, - TPSLModeV5, - TradeModeV5, -} from '../shared-v5'; ⋮---- -export interface FuturesLeverageItemV5 { - symbol: string; - leverage: string; - side: OrderSideV5 | ''; - positionIdx: PositionIdx; +/** Coin name, uppercase only. If omitted, sets the global switch; when enabled, includes currencies that become borrowable later */ +⋮---- +autoRepayMode: '0' | '1'; // 0: Off, 1: On +⋮---- +export interface SetTradeAutoRepayParamsV5 { + /** 1: enable trade auto repayment; 0: disable */ + autoRepay: '0' | '1'; } ⋮---- -export interface FuturesLeverageResultV5 { - category: 'linear' | 'inverse'; - list: FuturesLeverageItemV5[]; +/** 1: enable trade auto repayment; 0: disable */ +⋮---- +export interface GetSpotMarginLiabilityInfoParamsV5 { + currency: string; } ⋮---- -export interface PositionV5 { - positionIdx: PositionIdx; - riskId: number; - riskLimitValue: string; - symbol: string; - side: PositionSideV5; - size: string; - avgPrice: string; - positionValue: string; - tradeMode: TradeModeV5; - autoAddMargin?: number; - positionStatus: PositionStatusV5; - leverage?: string; - breakEvenPrice?: string; // Break even price, only for linear & inverse - markPrice: string; - liqPrice: string | ''; - bustPrice?: string; - positionIM?: string; - positionMM?: string; - positionBalance?: string; - tpslMode?: TPSLModeV5; - takeProfit?: string; - stopLoss?: string; - trailingStop?: string; - sessionAvgPrice: string | ''; - delta?: string; - gamma?: string; - vega?: string; - theta?: string; - unrealisedPnl: string; - curRealisedPnl: string; - cumRealisedPnl: string; - adlRankIndicator: number; - isReduceOnly: boolean; - mmrSysUpdatedTime: string | ''; - leverageSysUpdatedTime: string | ''; - createdTime: string; - updatedTime: string; - /** Position open timestamp (ms). Default `0` when not set. */ - openTime: number; - positionIMByMp: string; - positionMMByMp: string; - seq: number; - netDeltaRatio?: string; +export interface FixedRateBorrowParamsV5 { + orderCurrency: string; + orderAmount: string; + /** e.g. 0.02 = 2% p.a. */ + annualRate: string; + /** 7, 14, 30, 90, 180 (days) */ + term: string; + /** 1: auto repayment; 2: transfer to flexible loan */ + repayType?: '1' | '2'; } ⋮---- -breakEvenPrice?: string; // Break even price, only for linear & inverse +/** e.g. 0.02 = 2% p.a. */ ⋮---- -/** Position open timestamp (ms). Default `0` when not set. */ +/** 7, 14, 30, 90, 180 (days) */ ⋮---- -export interface SetRiskLimitResultV5 { - category: CategoryV5; - riskId: number; - riskLimitValue: string; +/** 1: auto repayment; 2: transfer to flexible loan */ +⋮---- +export interface GetFixedRateBorrowOrderInfoParamsV5 { + orderId?: string; + orderCurrency?: string; + state?: string; + term?: string; + limit?: string; + cursor?: string; } ⋮---- -export interface AddOrReduceMarginResultV5 { - category: CategoryV5; - symbol: string; - positionIdx: PositionIdx; - riskId: number; - riskLimitValue: string; - size: string; - avgPrice: string; - liqPrice: string; - bustPrice: string; - markPrice: string; - positionValue: string; - leverage: string; - autoAddMargin: 0 | 1; - positionStatus: PositionStatusV5; - positionIM: string; - positionMM: string; - takeProfit: string; - stopLoss: string; - trailingStop: string; - unrealisedPnl: string; - cumRealisedPnl: string; - createdTime: string; - updatedTime: string; +export interface GetFixedRateBorrowContractInfoParamsV5 { + orderId?: string; + orderCurrency?: string; + term?: string; + limit?: string; + cursor?: string; } ⋮---- -export interface ExecutionV5 { - symbol: string; - orderId: string; - orderLinkId: string; - side: OrderSideV5; - orderPrice: string; - orderQty: string; - leavesQty: string; - orderType: OrderTypeV5; - stopOrderType?: StopOrderTypeV5; - execFee: string; - execFeeV2: string; - feeCurrency: string; // Trading fee currency - execId: string; - execPrice: string; - execQty: string; - execType: ExecTypeV5; - execValue: string; - execTime: string; - isMaker: boolean; - feeRate: string; - tradeIv?: string; - markIv?: string; - markPrice: string; - indexPrice: string; - underlyingPrice?: string; - blockTradeId?: string; - closedSize?: string; - seq: number; - extraFees: string; +export interface GetFixedRateBorrowOrderQuoteParamsV5 { + orderCurrency: string; + term?: string; + orderBy?: 'apy' | 'term' | 'quantity'; + sort?: 0 | 1; + limit?: number; } ⋮---- -feeCurrency: string; // Trading fee currency +export interface RenewFixedRateBorrowParamsV5 { + loanId: string; + qty?: string; +} ⋮---- -export interface ClosedPnLV5 { - symbol: string; - orderId: string; - side: string; - qty: string; - orderPrice: string; - orderType: OrderTypeV5; - execType: ExecTypeV5; - closedSize: string; - openFee: string; - closeFee: string; - cumEntryValue: string; - avgEntryPrice: string; - cumExitValue: string; - avgExitPrice: string; - closedPnl: string; - fillCount: string; - leverage: string; - createdTime: string; - updatedTime: string; +export interface GetFixedRateBorrowInterestAccruedParamsV5 { + orderId?: string; + orderCurrency?: string; + limit?: string; + cursor?: string; } ⋮---- -export interface MovePositionResultV5 { - blockTradeId: string; - status: 'Processing' | 'Rejected'; - rejectParty: '' | 'Taker' | 'Maker' | 'bybit'; +export interface CancelFixedRateBorrowOrderParamsV5 { + orderId: string; } ⋮---- -export interface MovePositionHistoryV5 { - blockTradeId: string; - category: 'linear' | 'spot' | 'option'; - orderId: string; - userId: number; - symbol: string; - side: 'Buy' | 'Sell'; - price: string; - qty: string; - execFee: string; - status: 'Processing' | 'Filled' | 'Rejected'; - execId: string; - resultCode: number; - resultMessage: string; - createdAt: number; - updatedAt: number; - rejectParty: '' | 'Taker' | 'Maker' | 'bybit'; +export interface GetFlexibleAvailableInventoryParamsV5 { + currency: string; } ⋮---- -export interface ClosedOptionsPositionV5 { - symbol: string; - side: 'Buy' | 'Sell'; - totalOpenFee: string; - deliveryFee: string; - totalCloseFee: string; - qty: string; - closeTime: number; - avgExitPrice: string; - deliveryPrice: string; - openTime: number; - avgEntryPrice: string; - totalPnl: string; +export interface GetFixedRateAvailableInventoryParamsV5 { + currency: string; + term: string; + annualRate: string; } ================ -File: src/types/response/v5-spot-leverage-token.ts +File: src/types/response/v5-account.ts ================ import { - LeverageTokenStatusV5, - LTOrderStatusV5, - LTOrderTypeV5, + AccountMarginModeV5, + AccountTypeV5, + CategoryV5, + TransactionTypeV5, + UnifiedUpdateStatusV5, } from '../shared-v5'; ⋮---- -export interface LeverageTokenInfoV5 { - ltCoin: string; - ltName: string; - maxPurchase: string; - minPurchase: string; - maxPurchaseDaily: string; - maxRedeem: string; - minRedeem: string; - maxRedeemDaily: string; - purchaseFeeRate: string; - redeemFeeRate: string; - ltStatus: LeverageTokenStatusV5; - fundFee: string; - fundFeeTime: string; - manageFeeRate: string; - manageFeeTime: string; - value: string; - netValue: string; - total: string; +export interface WalletBalanceV5Coin { + coin: string; + equity: string; + usdValue: string; + walletBalance: string; + free: string; // spot only + locked: string; // spot only + borrowAmount: string; + availableToBorrow: string; // deprecated field + availableToWithdraw: string; + accruedInterest: string; + totalOrderIM: string; + totalPositionIM: string; + totalPositionMM: string; + unrealisedPnl: string; + cumRealisedPnl: string; + bonus: string; + marginCollateral: boolean; + collateralSwitch: boolean; + spotBorrow: string; + colRes?: string; } ⋮---- -export interface LeveragedTokenMarketResultV5 { - ltCoin: string; - nav: string; - navTime: string; - circulation: string; - basket: string; - leverage: string; +free: string; // spot only +locked: string; // spot only +⋮---- +availableToBorrow: string; // deprecated field +⋮---- +export interface WalletBalanceV5 { + accountType: AccountTypeV5; + accountLTV: string; + accountIMRate: string; + accountMMRate: string; + accountIMRateByMp: string; + accountMMRateByMp: string; + totalInitialMarginByMp: string; + totalMaintenanceMarginByMp: string; + totalEquity: string; + totalWalletBalance: string; + totalMarginBalance: string; + totalAvailableBalance: string; + totalPerpUPL: string; + totalInitialMargin: string; + totalMaintenanceMargin: string; + coin: WalletBalanceV5Coin[]; } ⋮---- -export interface PurchaseSpotLeveragedTokenResultV5 { - ltCoin: string; - ltOrderStatus: LTOrderStatusV5; - execQty: string; - execAmt: string; - amount: string; - purchaseId: string; - serialNo: string; - valueCoin: string; +export interface UnifiedAccountUpgradeResultV5 { + unifiedUpdateStatus: UnifiedUpdateStatusV5; + unifiedUpdateMsg: { + msg: string[] | null; + }; } -export interface RedeemSpotLeveragedTokenResultV5 { - ltCoin: string; - ltOrderStatus: LTOrderStatusV5; - quantity: string; - execQty: string; - execAmt: string; - redeemId: string; - serialNo: string; - valueCoin: string; +⋮---- +export interface BorrowHistoryRecordV5 { + currency: string; + createdTime: number; + borrowCost: string; + hourlyBorrowRate: string; + InterestBearingBorrowSize: string; + costExemption: string; + borrowAmount: string; + unrealisedLoss: string; + freeBorrowedAmount: string; } ⋮---- -export interface SpotLeveragedTokenOrderHistoryV5 { - ltCoin: string; - orderId: string; - ltOrderType: LTOrderTypeV5; - orderTime: number; - updateTime: number; - ltOrderStatus: LTOrderStatusV5; +export interface CollateralInfoV5 { + currency: string; + hourlyBorrowRate: string; + maxBorrowingAmount: string; + freeBorrowAmount: string; + freeBorrowingLimit: string; + borrowAmount: string; + availableToBorrow: string; + borrowable: boolean; + borrowUsageRate: string; + marginCollateral: boolean; + collateralSwitch: boolean; + collateralRatio: string; +} +⋮---- +export interface CoinGreeksV5 { + baseCoin: string; + totalDelta: string; + totalGamma: string; + totalVega: string; + totalTheta: string; +} +⋮---- +export interface FeeRateV5 { + symbol: string; + baseCoin: string; + takerFeeRate: string; + makerFeeRate: string; + rpiMakerFeeRate?: string; +} +⋮---- +export interface AccountInfoV5 { + unifiedMarginStatus: number; + marginMode: AccountMarginModeV5; + isMasterTrader: boolean; + spotHedgingStatus: string; + updatedTime: string; +} +⋮---- +/** + * Get Trade Behaviour Config / `getLimitPriceAction()` — `/v5/account/user-setting-config` + */ +export interface UserSettingConfigV5 { + lpaSpot: boolean; + lpaPerp: boolean; + /** Spot MNT fee deduction enabled. */ + smsef?: boolean; + /** Futures MNT fee deduction enabled. */ + fmsef?: boolean; + /** Delta Neutral mode; may be absent on older API responses. */ + deltaEnable?: boolean; + smpType?: '0' | '1' | '2' | '3' | string; +} +⋮---- +/** Spot MNT fee deduction enabled. */ +⋮---- +/** Futures MNT fee deduction enabled. */ +⋮---- +/** Delta Neutral mode; may be absent on older API responses. */ +⋮---- +export interface TransactionLogV5 { + symbol: string; + category: CategoryV5; + side: string; + transactionTime: string; + type: TransactionTypeV5; + qty: string; + size: string; + currency: string; + tradePrice: string; + funding: string; fee: string; - amount: string; - value: string; - valueCoin: string; - serialNo: string; + cashFlow: string; + change: string; + cashBalance: string; + feeRate: string; + bonusChange: string; + tradeId: string; + orderId: string; + orderLinkId: string; + extraFees: string; + transSubType: string; + displayType?: string; +} +⋮---- +export interface MMPStateV5 { + baseCoin: string; + mmpEnabled: boolean; + window: string; + frozenPeriod: string; + qtyLimit: string; + deltaLimit: string; + vegaLimit?: string; + mmpFrozenUntil: string; + mmpFrozen: boolean; } ⋮---- -export interface VIPMarginDataV5 { - vipCoinList: { - list: { - borrowable: boolean; - collateralRatio: string; - currency: string; - hourlyBorrowRate: string; - liquidationOrder: string; - marginCollateral: boolean; - maxBorrowingAmount: string; - }[]; - vipLevel: string; - }[]; +export interface RepayLiabilityResultV5 { + coin: string; + repaymentQty: string; } ⋮---- -export interface SpotMarginCurrencyDataV5 { - currency: string; - flexibleManualBorrowable: boolean; - minFlexibleManualBorrowQty: string; - flexibleManualBorrowAccuracy: string; - fixedManualBorrowable: boolean; - minFixedManualBorrowQty: string; - fixedManualBorrowAccuracy: string; - fixedInterestRateAccuracy: string; - minFixedInterestRate: string; - maxFixedInterestRate: string; +export interface DCPInfoV5 { + product: 'SPOT' | 'DERIVATIVES' | 'OPTIONS'; + dcpStatus: 'ON'; + timeWindow: string; } ⋮---- -export interface SpotMarginStateV5 { - spotLeverage: string; - spotMarginMode: '1' | '0'; - effectiveLeverage: string; +export interface ManualRepayResultV5 { + resultStatus: 'P' | 'SU' | 'FA'; } ⋮---- -// Spot Margin Trade (UTA) response types -export interface ManualBorrowResultV5 { +/** GET /v5/account/option-asset-info — response `result` wraps a nested `result` array. */ +export interface OptionAssetInfoRowV5 { coin: string; - amount: string; + totalDelta: string; + totalRPL: string; + totalUPL: string; + assetIM: string; + assetMM: string; + sendTime: number; } ⋮---- -export interface MaxBorrowableAmountV5 { - currency: string; - /** - * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or - * when no collateral coins are enabled. The app can still show a borrow - * amount after a collateral coin is selected. Undocumented; Bybit API staff - * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, - * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and - * `toggleSpotMarginTrade()` first. - */ - maxLoan: string; +export interface OptionAssetInfoNestedResultV5 { + result: OptionAssetInfoRowV5[]; } ⋮---- -/** - * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or - * when no collateral coins are enabled. The app can still show a borrow - * amount after a collateral coin is selected. Undocumented; Bybit API staff - * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, - * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and - * `toggleSpotMarginTrade()` first. - */ +/** GET /v5/account/pay-info */ +export interface PayInfoCollateralItemV5 { + coin: string; + availableSize: string; + availableValue: string; + coinScale: number; + borrowSize: string; + spotHedgeAmount: string; + assetFrozen: string; +} ⋮---- -export interface PositionTierV5 { - tier: string; - borrowLimit: string; - positionMMR: string; - positionIMR: string; - maxLeverage: string; +export interface PayInfoBorrowBlockV5 { + coin?: string; + borrowSize: string; + borrowValue?: string; + assetFrozen: string; + availableBalance: string; } ⋮---- -export interface CurrencyPositionTiersV5 { - currency: string; - positionTiersRatioList: PositionTierV5[]; +export interface PayInfoResultV5 { + collateralInfo: { + collateralList: PayInfoCollateralItemV5[]; + }; + borrowInfo: PayInfoBorrowBlockV5; } ⋮---- -export interface CoinStateV5 { - currency: string; - spotLeverage: string; +/** GET /v5/account/trade-info-for-analysis */ +export interface TradeInfoAnalysisDailyV5 { + day: string; + sumBuyExecValue: string; + sumSellExecValue: string; + sumExecValue: string; } ⋮---- -export interface AvailableAmountToRepayV5 { - currency: string; - lossLessRepaymentAmount: string; +export interface TradeInfoForAnalysisResultV5 { + symbolRnl: string; + netExecQty: string; + sumExecValue: string; + sumExecQty: string; + avgBuyExecPrice: string; + sumBuyExecValue: string; + sumBuyExecQty: string; + sumBuyExecFee: string; + sumBuyOrderQty: string; + avgSellExecPrice: string; + sumSellExecValue: string; + sumSellExecQty: string; + sumSellExecFee: string; + sumSellOrderQty: string; + maxMarginVersion: number; + baseCoin: string; + settleCoin: string; + sumPriceList?: TradeInfoAnalysisDailyV5[]; } + +================ +File: src/types/response/v5-position.ts +================ +import { + CategoryV5, + ExecTypeV5, + OrderSideV5, + OrderTypeV5, + PositionIdx, + PositionSideV5, + PositionStatusV5, + StopOrderTypeV5, + TPSLModeV5, + TradeModeV5, +} from '../shared-v5'; ⋮---- -export interface ManualRepayWithoutConversionResultV5 { - /** - * Result status: - * - P: Processing - * - SU: Success - * - FA: Failed - */ - resultStatus: 'P' | 'SU' | 'FA'; +export interface FuturesLeverageItemV5 { + symbol: string; + leverage: string; + side: OrderSideV5 | ''; + positionIdx: PositionIdx; } ⋮---- -/** - * Result status: - * - P: Processing - * - SU: Success - * - FA: Failed - */ +export interface FuturesLeverageResultV5 { + category: 'linear' | 'inverse'; + list: FuturesLeverageItemV5[]; +} ⋮---- -export interface AutoRepayModeItemV5 { - currency: string; // Coin name, uppercase only - autoRepayMode: '0' | '1'; // 0: Off, 1: On +export interface PositionV5 { + positionIdx: PositionIdx; + riskId: number; + riskLimitValue: string; + symbol: string; + side: PositionSideV5; + size: string; + avgPrice: string; + positionValue: string; + tradeMode: TradeModeV5; + autoAddMargin?: number; + positionStatus: PositionStatusV5; + leverage?: string; + breakEvenPrice?: string; // Break even price, only for linear & inverse + markPrice: string; + liqPrice: string | ''; + bustPrice?: string; + positionIM?: string; + positionMM?: string; + positionBalance?: string; + tpslMode?: TPSLModeV5; + takeProfit?: string; + stopLoss?: string; + trailingStop?: string; + sessionAvgPrice: string | ''; + delta?: string; + gamma?: string; + vega?: string; + theta?: string; + unrealisedPnl: string; + curRealisedPnl: string; + cumRealisedPnl: string; + adlRankIndicator: number; + isReduceOnly: boolean; + mmrSysUpdatedTime: string | ''; + leverageSysUpdatedTime: string | ''; + createdTime: string; + updatedTime: string; + /** Position open timestamp (ms). Default `0` when not set. */ + openTime: number; + positionIMByMp: string; + positionMMByMp: string; + seq: number; + netDeltaRatio?: string; } ⋮---- -currency: string; // Coin name, uppercase only -autoRepayMode: '0' | '1'; // 0: Off, 1: On +breakEvenPrice?: string; // Break even price, only for linear & inverse ⋮---- -export interface AutoRepayModeResultV5 { - data: AutoRepayModeItemV5[]; -} +/** Position open timestamp (ms). Default `0` when not set. */ ⋮---- -export interface SpotMarginLiabilityInfoV5 { - currency: string; - totalBorrowAmount: string; - fixedBorrowAmount: string; - flexibleBorrowAmount: string; - spotTotalBorrow: string; - derivativesBorrow: string; +export interface SetRiskLimitResultV5 { + category: CategoryV5; + riskId: number; + riskLimitValue: string; } ⋮---- -export interface FixedRateBorrowResultV5 { - orderId: string; +export interface AddOrReduceMarginResultV5 { + category: CategoryV5; + symbol: string; + positionIdx: PositionIdx; + riskId: number; + riskLimitValue: string; + size: string; + avgPrice: string; + liqPrice: string; + bustPrice: string; + markPrice: string; + positionValue: string; + leverage: string; + autoAddMargin: 0 | 1; + positionStatus: PositionStatusV5; + positionIM: string; + positionMM: string; + takeProfit: string; + stopLoss: string; + trailingStop: string; + unrealisedPnl: string; + cumRealisedPnl: string; + createdTime: string; + updatedTime: string; } ⋮---- -export interface FixedRateBorrowOrderInfoV5 { - annualRate: string; +export interface ExecutionV5 { + symbol: string; orderId: string; - orderTime: string; - filledQty: string; + orderLinkId: string; + side: OrderSideV5; + orderPrice: string; orderQty: string; - orderCurrency: string; - state: number; - term: number; - repayType: string; - strategyType: 'PARTIAL' | 'FULL'; + leavesQty: string; + orderType: OrderTypeV5; + stopOrderType?: StopOrderTypeV5; + execFee: string; + execFeeV2: string; + feeCurrency: string; // Trading fee currency + execId: string; + execPrice: string; + execQty: string; + execType: ExecTypeV5; + execValue: string; + execTime: string; + isMaker: boolean; + feeRate: string; + tradeIv?: string; + markIv?: string; + markPrice: string; + indexPrice: string; + underlyingPrice?: string; + blockTradeId?: string; + closedSize?: string; + seq: number; + extraFees: string; } ⋮---- -export interface FixedRateBorrowContractInfoV5 { - annualRate: string; - borrowCurrency: string; - borrowTime: string; - interestPaid: string; - loanId: string; - orderId: string; - repaymentTime: string; - residualPenaltyInterest: string; - residualPrincipal: string; - status: number; - term: string; - repayType: string; - strategyType: 'PARTIAL' | 'FULL'; -} +feeCurrency: string; // Trading fee currency ⋮---- -export interface FixedRateBorrowQuoteV5 { - orderCurrency: string; - term: number; - annualRate: string; +export interface ClosedPnLV5 { + symbol: string; + orderId: string; + side: string; qty: string; + orderPrice: string; + orderType: OrderTypeV5; + execType: ExecTypeV5; + closedSize: string; + openFee: string; + closeFee: string; + cumEntryValue: string; + avgEntryPrice: string; + cumExitValue: string; + avgExitPrice: string; + closedPnl: string; + fillCount: string; + leverage: string; + createdTime: string; + updatedTime: string; } ⋮---- -export interface FixedRateBorrowInterestAccruedV5 { - refId: string; - currency: string; - orderId: string; - loanAmt: string; - interest: string; - interestRate: string; - ts: string; +export interface MovePositionResultV5 { + blockTradeId: string; + status: 'Processing' | 'Rejected'; + rejectParty: '' | 'Taker' | 'Maker' | 'bybit'; } ⋮---- -export interface FlexibleAvailableInventoryV5 { - currency: string; - availableInventory: string; - updateTime: string; +export interface MovePositionHistoryV5 { + blockTradeId: string; + category: 'linear' | 'spot' | 'option'; + orderId: string; + userId: number; + symbol: string; + side: 'Buy' | 'Sell'; + price: string; + qty: string; + execFee: string; + status: 'Processing' | 'Filled' | 'Rejected'; + execId: string; + resultCode: number; + resultMessage: string; + createdAt: number; + updatedAt: number; + rejectParty: '' | 'Taker' | 'Maker' | 'bybit'; } ⋮---- -export interface FixedRateAvailableInventoryV5 { - currency: string; - term: string; - annualRate: string; - availableInventory: string; - updateTime: string; +export interface ClosedOptionsPositionV5 { + symbol: string; + side: 'Buy' | 'Sell'; + totalOpenFee: string; + deliveryFee: string; + totalCloseFee: string; + qty: string; + closeTime: number; + avgExitPrice: string; + deliveryPrice: string; + openTime: number; + avgEntryPrice: string; + totalPnl: string; } ================ @@ -12782,3817 +12538,4094 @@ import { RestClientV5 } from '../../src/index'; // siteId: 'ARG_BTL', ================ -File: src/types/response/v5-asset.ts +File: src/types/response/v5-earn.ts ================ -import { AccountTypeV5, OrderSideV5, WithdrawalTypeV5 } from '../shared-v5'; -⋮---- -export interface CoinExchangeRecordV5 { - fromCoin: string; - fromAmount: string; - toCoin: string; - toAmount: string; - exchangeRate: string; - createdTime: string; - exchangeTxId: string; -} -⋮---- -export interface DeliveryRecordV5 { - deliveryTime: number; - symbol: string; - side: OrderSideV5; - position: string; - deliveryPrice: string; - strike: string; - fee: string; - deliveryRpl: string; - entryPrice: string; -} -⋮---- -export interface SettlementRecordV5 { - symbol: string; - side: string; - size: number; - sessionAvgPrice: string; - markPrice: string; - realisedPnl: string; - createdTime: string; -} -⋮---- -export interface AssetInfoAssetV5 { - coin: string; - frozen: string; - free: string; - withdraw: string; -} -⋮---- -export interface AssetInfoV5 { - status: 'ACCOUNT_STATUS_NORMAL' | 'ACCOUNT_STATUS_UNSPECIFIED'; - assets: AssetInfoAssetV5[]; -} -⋮---- -export interface CoinBalanceV5 { - coin: string; - walletBalance: string; - transferBalance: string; - bonus?: string; -} -⋮---- -export interface AllCoinsBalanceV5 { - accountType: AccountTypeV5; - memberId?: string; - balance: CoinBalanceV5[]; -} -⋮---- -export interface AccountCoinBalanceV5 { - accountType: AccountTypeV5; - bizType: number; - accountId: string; - memberId: string; - balance: { - coin: string; - walletBalance: string; - transferBalance: string; - bonus: string; - transferSafeAmount: string; - ltvTransferSafeAmount: string; - }; -} -⋮---- -export interface InternalTransferRecordV5 { - transferId: string; - coin: string; - amount: string; - fromAccountType: AccountTypeV5; - toAccountType: AccountTypeV5; - timestamp: string; - status: string; -} -⋮---- -export interface UniversalTransferRecordV5 { - transferId: string; - coin: string; - amount: string; - fromMemberId: string; - toMemberId: string; - fromAccountType: AccountTypeV5; - toAccountType: AccountTypeV5; - timestamp: string; - status: string; - withdrawReqId?: string; - depositReqId?: string; -} -⋮---- -export interface AllowedDepositCoinInfoV5 { +export interface EarnInterestCardV5 { + awardId: number; + specCode: string; coin: string; - chain: string; - coinShowName: string; - chainType: string; - blockConfirmNumber: number; - minDepositAmount: string; + apy: string; + duration: number; + claimedAt: number; + expireAt: number; + usedAt: number; + status: 'InUse' | 'NotUse' | 'Expired' | 'AlreadyUsed' | string; + currentPnl: string; + limitPnl: string; + positionEffectiveAmount: string; + productId: number; + category: 'FlexibleSaving' | 'DualAssets' | string; } ⋮---- -export interface DepositRecordV5 { - id: string; - coin: string; - chain: string; +export interface EarnAwardCardV5 { + awardId: number; + specCode: string; + claimedAt: number; + usedAt: number; + expireAt: number; + status: 'InUse' | 'NotUse' | 'Expired' | 'AlreadyUsed' | string; amount: string; - txID: string; - status: number; - toAddress: string; - tag: string; - depositFee: string; - successAt: string; - confirmations: string; - txIndex: string; - blockHash: string; - batchReleaseLimit: string; - depositType: string; - fromAddress: string; - travelRuleStatus?: string; + limitPnlPercentage: string; + baseCoin: string; + quoteCoin: string; + direction: 1 | 2; + category: 'FlexibleSaving' | 'DualAssets' | string; } ⋮---- -export interface SubmitDepositOriginatorInfoResultV5 { - travelRuleStatus: number; +export interface EarnCouponListResultV5 { + interestCards: EarnInterestCardV5[]; + awardCards: EarnAwardCardV5[]; } ⋮---- -export interface InternalDepositRecordV5 { - id: string; - type: 1; +export interface FlexibleSavingAutoSavingsCoinV5 { coin: string; - amount: string; - status: 1 | 2 | 3; - address: string; - createdTime: string; - txID: string; - complianceStatus?: string; + isSelected: boolean; + maxStakingAmount: string; + apr: string; } ⋮---- -export interface DepositAddressChainV5 { - chainType: string; - addressDeposit: string; - tagDeposit: string; - chain: string; - batchReleaseLimit: string; - contractAddress: string; +export interface FlexibleSavingAutoSavingsV5 { + selectedAll: boolean; + coins: FlexibleSavingAutoSavingsCoinV5[]; } ⋮---- -export interface DepositAddressResultV5 { +export interface EarnProductV5 { + category: string; + estimateApr: string; coin: string; - chains: DepositAddressChainV5[]; + minStakeAmount: string; + maxStakeAmount: string; + precision: string; + productId: string; + status: 'Available' | 'NotAvailable'; } ⋮---- -export interface CoinInfoV5 { - name: string; +export interface EarnOrderHistoryV5 { coin: string; - /** @deprecated Use `chains[].withdrawMax` instead */ - remainAmount: string; - chains: { - chain: string; - chainType: string; - confirmation: string; - withdrawFee: string; - depositMin: string; - withdrawMin: string; - minAccuracy: string; - chainDeposit: string; - chainWithdraw: string; - withdrawPercentageFee: string; - contractAddress: string; - safeConfirmNumber: string; - /** Max withdraw amount per transaction per chain. `-1` means no limit */ - withdrawMax: string; - }[]; + orderValue: string; + orderType: 'Redeem' | 'Stake'; + orderId: string; + orderLinkId: string; + status: 'Success' | 'Fail' | 'Pending'; + createdAt: string; + productId: string; + updatedAt: string; + swapOrderValue: string; + estimateRedeemTime: string; + estimateStakeTime: string; } ⋮---- -/** @deprecated Use `chains[].withdrawMax` instead */ -⋮---- -/** Max withdraw amount per transaction per chain. `-1` means no limit */ +export interface EarnPositionFreezeDetailV5 { + amount: string; + description: string; +} ⋮---- -export interface WithdrawalRecordV5 { - withdrawId: string; - txID: string; - withdrawType: WithdrawalTypeV5; +export interface EarnPositionV5 { coin: string; - chain: string; + productId: string; amount: string; - withdrawFee: string; - status: string; - toAddress: string; - tag: string; - createTime: string; - updateTime: string; + totalPnl: string; + claimableYield: string; + id?: string; + status?: string; + orderId?: string; + estimateRedeemTime?: string; + estimateStakeTime?: string; + estimateInterestCalculationTime?: string; + settlementTime?: string; + autoReinvest?: string; + /** Redeemable amount */ + availableAmount: string; + freezeDetails: EarnPositionFreezeDetailV5[]; } ⋮---- -export interface WithdrawalAddressV5 { +/** Redeemable amount */ +⋮---- +export interface EarnYieldHistoryV5 { + productId: string; coin: string; - chain: string; - address: string; - tag: string; - remark: string; - status: number; - addressType: number; - verified: number; + id: string; + amount: string; + yieldType: string; + distributionMode: string; + effectiveStakingAmount: string; + orderId: string; + status: 'Pending' | 'Success' | 'Fail'; createdAt: string; } ⋮---- -export interface WithdrawableAccountSliceV5 { +export interface EarnHourlyYieldHistoryV5 { + productId: string; coin: string; - withdrawableAmount: string; - availableBalance: string; -} -⋮---- -/** - * GET /v5/asset/withdraw/withdrawable-amount. Only keys with data are returned - * (e.g. UTA, FUND, EARN; EARN when the coin can be withdrawn from Earn; SPOT if present). - */ -export interface WithdrawableAmountV5 { - limitAmountUsd: string; - withdrawableAmount: { - SPOT?: WithdrawableAccountSliceV5; - FUND?: WithdrawableAccountSliceV5; - UTA?: WithdrawableAccountSliceV5; - EARN?: WithdrawableAccountSliceV5; - }; -} -⋮---- -export interface VaspEntityV5 { - vaspEntityId: string; - vaspName: string; + id: string; + amount: string; + effectiveStakingAmount: string; + status: 'Pending' | 'Success' | 'Fail'; + hourlyDate: string; + createdAt: string; } ⋮---- -export interface ConvertCoinSpecV5 { - coin: string; - fullName: string; - icon: string; - iconNight: string; - accuracyLength: number; - coinType: string; - balance: string; - uBalance: string; - singleFromMinLimit: string; - singleFromMaxLimit: string; - disableFrom: boolean; - disableTo: boolean; - timePeriod: number; - singleToMinLimit: string; - singleToMaxLimit: string; - dailyFromMinLimit: string; - dailyFromMaxLimit: string; - dailyToMinLimit: string; - dailyToMaxLimit: string; +export interface EarnAprHistoryPointV5 { + timestamp: string; + apr: string; } ⋮---- -export interface ConvertQuoteV5 { - quoteTxId: string; - exchangeRate: string; - fromCoin: string; - fromCoinType: string; - toCoin: string; - toCoinType: string; - fromAmount: string; - toAmount: string; - expiredTime: string; - requestId: string; - extTaxAndFee: string[]; +/** + * Advanced Earn — Dual Asset product (GET /v5/earn/advance/product). + */ +export interface AdvanceEarnDualAssetProductV5 { + category: string; + productId: string; + baseCoin: string; + quoteCoin: string; + expectReceiveAt: string; + duration: string; + status: 'Available' | 'NotAvailable'; + isVipProduct: boolean; + subscribeStartAt: string; + subscribeEndAt: string; + applyStartAt: string; + settlementTime: string; + minPurchaseQuoteAmount: string; + minPurchaseBaseAmount: string; + remainingAmountQuote: string; + remainingAmountBase: string; + orderPrecisionDigitalQuote: number; + orderPrecisionDigitalBase: number; } -⋮---- -export interface ConvertStatusV5 { - accountType: string; - exchangeTxId: string; - userId: string; - fromCoin: string; - fromCoinType: string; - toCoin: string; - toCoinType: string; - fromAmount: string; - toAmount: string; - exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; - extInfo: { paramType: string; paramValue: string }; - convertRate: string; - createdAt: string; +⋮---- +export interface AdvanceEarnDualAssetProductInfoV5 { + category: string; + list: AdvanceEarnDualAssetProductV5[]; } ⋮---- -export interface ConvertHistoryRecordV5 { - accountType: string; - exchangeTxId: string; - userId: string; - fromCoin: string; - fromCoinType: string; - toCoin: string; - toCoinType: string; - fromAmount: string; - toAmount: string; - exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; - extInfo: { paramType: string; paramValue: string }; - convertRate: string; - createdAt: string; +/** + * Advanced Earn — Double Win (GET /v5/earn/advance/product?category=DoubleWin). + */ +export interface AdvanceEarnDoubleWinProductV5 { + category: string; + productId: string; + investCoin: string; + underlyingAsset: string; + duration: string; + subscribeStartAt: string; + subscribeEndAt: string; + settlementTime: string; + expectReceiveAt: string; + minPurchaseAmount: string; + orderPrecisionDigital: number; + isRfqProduct: boolean; + lowerPriceBuffer: string; + upperPriceBuffer: string; + minDeviationRatio: string; + maxDeviationRatio: string; + priceTickSize: string; } ⋮---- -export interface SmallBalanceCoinV5 { - fromCoin: string; // Source currency - supportConvert: 1 | 2; // 1: support, 2: not supported - availableBalance: string; // Available balance - baseValue: string; // USDT equivalent value - toAmount: string; // Reserved field - exchangeRate: string; // Reserved field - feeInfo: null; // Reserved field - taxFeeInfo: null; // Reserved field +/** + * Advanced Earn — Smart Leverage (GET /v5/earn/advance/product?category=SmartLeverage). + */ +export interface AdvanceEarnSmartLeverageProductV5 { + category: string; + productId: string; + investCoin: string; + underlyingAsset: string; + direction: 'Long' | 'Short'; + leverage: string; + duration: string; + subscribeStartAt: string; + subscribeEndAt: string; + settlementTime: string; + expectReceiveAt: string; + minPurchaseAmount: string; + remainingAmount: string; + orderPrecisionDigital: number; } ⋮---- -fromCoin: string; // Source currency -supportConvert: 1 | 2; // 1: support, 2: not supported -availableBalance: string; // Available balance -baseValue: string; // USDT equivalent value -toAmount: string; // Reserved field -exchangeRate: string; // Reserved field -feeInfo: null; // Reserved field -taxFeeInfo: null; // Reserved field +/** + * Advanced Earn — Discount Buy (GET /v5/earn/advance/product?category=DiscountBuy). + */ +export interface AdvanceEarnDiscountBuyProductV5 { + category: string; + productId: string; + coin: string; + underlyingAsset: string; + settlementTime: string; + duration: string; + isVipProduct: boolean; + subscribeStartAt: string; + subscribeEndAt: string; + minPurchaseAmount: string; + remainingAmount: string; + orderPrecisionDigital: number; + expectReceiveAt: string; +} ⋮---- -export interface SmallBalanceListV5 { - smallAssetCoins: SmallBalanceCoinV5[]; // Small balance info - supportToCoins: string[]; // Supported target coins (e.g., ["MNT","USDT","USDC"]) +export type AdvanceEarnAdvanceProductListItemV5 = + | AdvanceEarnDualAssetProductV5 + | AdvanceEarnDoubleWinProductV5 + | AdvanceEarnSmartLeverageProductV5 + | AdvanceEarnDiscountBuyProductV5; +⋮---- +export interface AdvanceEarnAdvanceProductInfoV5 { + category: string; + list: AdvanceEarnAdvanceProductListItemV5[]; } ⋮---- -smallAssetCoins: SmallBalanceCoinV5[]; // Small balance info -supportToCoins: string[]; // Supported target coins (e.g., ["MNT","USDT","USDC"]) +/** GET /v5/earn/hold-to-earn/product — Hold to Earn airdrop products */ +export type HoldToEarnAirdropProductStatusV5 = + | 'NotStarted' + | 'Online' + | 'Ended'; ⋮---- -export interface FiatCoinInfoV5 { - coin: string; // Fiat coin code - fullName: string; // Fiat full coin name - icon: string; // Coin icon url - iconNight: string; // Coin icon url (dark mode) - precision: number; // Fiat precision - disable: boolean; // true: the coin is disabled, false: the coin is allowed - singleFromMinLimit: string; // For buy side, minimum amount of fiatCoin per transaction - singleFromMaxLimit: string; // For buy side, maximum amount of fiatCoin per transaction +export interface HoldToEarnAirdropProductYieldV5 { + coinName: string; + /** Yesterday's APR for display, e.g. "10%", "0%" */ + apy: string; + personalApy?: string; + multiplier?: string; } ⋮---- -coin: string; // Fiat coin code -fullName: string; // Fiat full coin name -icon: string; // Coin icon url -iconNight: string; // Coin icon url (dark mode) -precision: number; // Fiat precision -disable: boolean; // true: the coin is disabled, false: the coin is allowed -singleFromMinLimit: string; // For buy side, minimum amount of fiatCoin per transaction -singleFromMaxLimit: string; // For buy side, maximum amount of fiatCoin per transaction +/** Yesterday's APR for display, e.g. "10%", "0%" */ ⋮---- -export interface CryptoCoinInfoV5 { - coin: string; // Crypto coin code - fullName: string; // Crypto full coin name - icon: string; // Coin icon url - iconNight: string; // Coin icon url (dark mode) - precision: number; // Crypto precision - disable: boolean; // true: the coin is disabled, false: the coin is allowed - singleFromMinLimit: string; // For sell side, minimum amount of cryptoCoin per transaction - singleFromMaxLimit: string; // For sell side, maximum amount of cryptoCoin per transaction +export interface HoldToEarnAirdropProductV5 { + coinName: string; + yields: HoldToEarnAirdropProductYieldV5[]; + status: HoldToEarnAirdropProductStatusV5; + announcementUrl: string; + /** Yesterday's avg APR across yield coins */ + apy: string; + personalApy?: string; } ⋮---- -coin: string; // Crypto coin code -fullName: string; // Crypto full coin name -icon: string; // Coin icon url -iconNight: string; // Coin icon url (dark mode) -precision: number; // Crypto precision -disable: boolean; // true: the coin is disabled, false: the coin is allowed -singleFromMinLimit: string; // For sell side, minimum amount of cryptoCoin per transaction -singleFromMaxLimit: string; // For sell side, maximum amount of cryptoCoin per transaction +/** Yesterday's avg APR across yield coins */ ⋮---- -export interface FiatTradingPairListV5 { - fiats: FiatCoinInfoV5[]; // Fiat coin list - cryptos: CryptoCoinInfoV5[]; // Crypto coin list +export interface HoldToEarnAirdropProductsResultV5 { + products: HoldToEarnAirdropProductV5[]; } ⋮---- -fiats: FiatCoinInfoV5[]; // Fiat coin list -cryptos: CryptoCoinInfoV5[]; // Crypto coin list +/** GET /v5/earn/hold-to-earn/yield-history */ +export interface HoldToEarnAirdropDailyPnlV5 { + coinName: string; + yieldCoinName: string; + effectiveAmount: string; + pnl: string; + apy: string; + createdAt: number; +} ⋮---- -export interface FundingAccountTransactionRecordV5 { - memberId: string; - currency: string; - ioDirection: string; - txnAmt: string; - afterAmt: string; - createTime: string; - showBusiType: string; - showBusiTypeEn: string; - description: string; - descriptionEn: string; - currcCursor?: string; +export interface HoldToEarnAirdropYieldHistoryResultV5 { + nextCursor: string; + airdropDailyPnls: HoldToEarnAirdropDailyPnlV5[]; } + +================ +File: src/types/response/v5-spot-leverage-token.ts +================ +import { + LeverageTokenStatusV5, + LTOrderStatusV5, + LTOrderTypeV5, +} from '../shared-v5'; ⋮---- -/** When accountType=Alpha and category is farm, under `coinDetail` in sub-categories. */ -export interface AssetOverviewCoinExtMapV5 { - priceUpper?: string; - priceLower?: string; - equityUnit?: string; +export interface LeverageTokenInfoV5 { + ltCoin: string; + ltName: string; + maxPurchase: string; + minPurchase: string; + maxPurchaseDaily: string; + maxRedeem: string; + minRedeem: string; + maxRedeemDaily: string; + purchaseFeeRate: string; + redeemFeeRate: string; + ltStatus: LeverageTokenStatusV5; + fundFee: string; + fundFeeTime: string; + manageFeeRate: string; + manageFeeTime: string; + value: string; + netValue: string; + total: string; } ⋮---- -export interface AssetOverviewCoinDetailV5 { - coin: string; - equity: string; - extMap?: AssetOverviewCoinExtMapV5; +export interface LeveragedTokenMarketResultV5 { + ltCoin: string; + nav: string; + navTime: string; + circulation: string; + basket: string; + leverage: string; } ⋮---- -export interface AssetOverviewCategoryV5 { - category: string; - equity: string; - coinDetail: AssetOverviewCoinDetailV5[]; +export interface PurchaseSpotLeveragedTokenResultV5 { + ltCoin: string; + ltOrderStatus: LTOrderStatusV5; + execQty: string; + execAmt: string; + amount: string; + purchaseId: string; + serialNo: string; + valueCoin: string; +} +export interface RedeemSpotLeveragedTokenResultV5 { + ltCoin: string; + ltOrderStatus: LTOrderStatusV5; + quantity: string; + execQty: string; + execAmt: string; + redeemId: string; + serialNo: string; + valueCoin: string; } ⋮---- -export interface AssetOverviewAccountItemV5 { - accountType: string; - totalEquity: string; - valuationCurrency: string; - snapshotTime: string; - coinDetail?: AssetOverviewCoinDetailV5[]; - categories?: AssetOverviewCategoryV5[]; +export interface SpotLeveragedTokenOrderHistoryV5 { + ltCoin: string; + orderId: string; + ltOrderType: LTOrderTypeV5; + orderTime: number; + updateTime: number; + ltOrderStatus: LTOrderStatusV5; + fee: string; + amount: string; + value: string; + valueCoin: string; + serialNo: string; } ⋮---- -export interface AssetOverviewResultV5 { - totalEquity: string; - list: AssetOverviewAccountItemV5[]; +export interface VIPMarginDataV5 { + vipCoinList: { + list: { + borrowable: boolean; + collateralRatio: string; + currency: string; + hourlyBorrowRate: string; + liquidationOrder: string; + marginCollateral: boolean; + maxBorrowingAmount: string; + }[]; + vipLevel: string; + }[]; } ⋮---- -// --- GET /v5/asset/portfolio-margin (portfolio margin P&L ranges) --- -⋮---- -export interface PortfolioMarginWalletV5 { - equity: string; - cashBalance: string; - marginBalance: string; - availableBalance: string; - accountIM: string; - accountMM: string; - accountMMRate: string; - accountIMRate: string; +export interface SpotMarginCurrencyDataV5 { + currency: string; + flexibleManualBorrowable: boolean; + minFlexibleManualBorrowQty: string; + flexibleManualBorrowAccuracy: string; + fixedManualBorrowable: boolean; + minFixedManualBorrowQty: string; + fixedManualBorrowAccuracy: string; + fixedInterestRateAccuracy: string; + minFixedInterestRate: string; + maxFixedInterestRate: string; } ⋮---- -export interface PortfolioMarginPnlRangePointV5 { - priceScale: string; - pnls: string[]; +export interface SpotMarginStateV5 { + spotLeverage: string; + spotMarginMode: '1' | '0'; + effectiveLeverage: string; } ⋮---- -export interface PortfolioMarginContractBucketPnlV5 { - pnlRanges: PortfolioMarginPnlRangePointV5[]; +// Spot Margin Trade (UTA) response types +export interface ManualBorrowResultV5 { + coin: string; + amount: string; } ⋮---- -export interface PortfolioMarginTotalPnlRangesV5 { - ALL?: PortfolioMarginContractBucketPnlV5; - PERPETUAL?: PortfolioMarginContractBucketPnlV5; - OPTION?: PortfolioMarginContractBucketPnlV5; +export interface MaxBorrowableAmountV5 { + currency: string; + /** + * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or + * when no collateral coins are enabled. The app can still show a borrow + * amount after a collateral coin is selected. Undocumented; Bybit API staff + * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, + * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and + * `toggleSpotMarginTrade()` first. + */ + maxLoan: string; } ⋮---- -export interface PortfolioMarginPerpPositionPnlV5 { - symbolName: string; - position: string; - pnlRanges: PortfolioMarginPnlRangePointV5[]; - sessionAvgPrice: string; - markPrice: string; - orderSize: string; - contractType: number; - settleCoin: string; - symbolAlias?: string; -} +/** + * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or + * when no collateral coins are enabled. The app can still show a borrow + * amount after a collateral coin is selected. Undocumented; Bybit API staff + * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, + * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and + * `toggleSpotMarginTrade()` first. + */ ⋮---- -export interface PortfolioMarginOptionPositionPnlV5 { - symbolName: string; - position: string; - pnlRanges: PortfolioMarginPnlRangePointV5[]; - sessionAvgPrice: string; - markPrice: string; - orderSize: string; - contractType: number; - settleCoin: string; +export interface PositionTierV5 { + tier: string; + borrowLimit: string; + positionMMR: string; + positionIMR: string; + maxLeverage: string; } ⋮---- -export interface PortfolioMarginOptionExpiryPnlV5 { - expiryDateRepresentation: string; - pnlRanges: PortfolioMarginPnlRangePointV5[]; - optionPositionPnlRanges: PortfolioMarginOptionPositionPnlV5[]; +export interface CurrencyPositionTiersV5 { + currency: string; + positionTiersRatioList: PositionTierV5[]; } ⋮---- -export interface PortfolioMarginContingencyV5 { - optionContingency: string; - futureDeltaContingency: string; - optionVegaContingency: string; - contingencyComponents: string; - usdtUsdcContingency: string; - futureContingency: string; +export interface CoinStateV5 { + currency: string; + spotLeverage: string; } ⋮---- -export interface PortfolioMarginAssetBlockV5 { - coin: string; - assetIM: string; - assetMM: string; +export interface AvailableAmountToRepayV5 { + currency: string; + lossLessRepaymentAmount: string; } ⋮---- -export interface PortfolioMarginSpotHedgeInfoV5 { - hedgeSpotSize: string; - walletBalance: string; - usdIndexPrice: string; - pnlRanges: PortfolioMarginPnlRangePointV5[]; +export interface ManualRepayWithoutConversionResultV5 { + /** + * Result status: + * - P: Processing + * - SU: Success + * - FA: Failed + */ + resultStatus: 'P' | 'SU' | 'FA'; } ⋮---- -export interface PortfolioMarginByBaseCoinV5 { - baseCoin: string; - totalPnlRanges: PortfolioMarginTotalPnlRangesV5; - perpPositionPnlRanges: PortfolioMarginPerpPositionPnlV5[]; - optionExpiryDatePnlRanges: PortfolioMarginOptionExpiryPnlV5[]; - contingency: PortfolioMarginContingencyV5; - asset: PortfolioMarginAssetBlockV5; - maxLossPriceMove: string; - maxLossIvShock: string; - totalClosePzFee: string; - spotHedgeInfo: PortfolioMarginSpotHedgeInfoV5; - maxLossIvShockList: string[]; -} +/** + * Result status: + * - P: Processing + * - SU: Success + * - FA: Failed + */ ⋮---- -export interface PortfolioMarginInfoResultV5 { - wallet: PortfolioMarginWalletV5; - assetPnlRange: PortfolioMarginByBaseCoinV5[]; +export interface AutoRepayModeItemV5 { + currency: string; // Coin name, uppercase only + autoRepayMode: '0' | '1'; // 0: Off, 1: On } ⋮---- -// --- GET /v5/asset/total-members-assets --- +currency: string; // Coin name, uppercase only +autoRepayMode: '0' | '1'; // 0: Off, 1: On ⋮---- -export interface TotalMembersAccountBreakdownItemV5 { - type: string; - origb: string; - quoteb: string; - stat: number; +export interface AutoRepayModeResultV5 { + data: AutoRepayModeItemV5[]; } ⋮---- -export interface TotalMembersMemberEntryV5 { - uid: number; - isM?: boolean; - type?: number; - stat: number; - origb: string; - quoteb?: string; - items: TotalMembersAccountBreakdownItemV5[]; +export interface TradeAutoRepayResultV5 { + /** Saved switch state. 1: enabled; 0: disabled */ + autoRepay: '0' | '1'; } ⋮---- -export interface TotalMembersAssetsResultV5 { - total: string; - quoteTotal: string; - stat: number; - list: TotalMembersMemberEntryV5[]; +/** Saved switch state. 1: enabled; 0: disabled */ +⋮---- +export interface SpotMarginLiabilityInfoV5 { + currency: string; + totalBorrowAmount: string; + fixedBorrowAmount: string; + flexibleBorrowAmount: string; + spotTotalBorrow: string; + derivativesBorrow: string; } - -================ -File: src/types/response/v5-earn.ts -================ -export interface EarnInterestCardV5 { - awardId: number; - specCode: string; - coin: string; - apy: string; - duration: number; - claimedAt: number; - expireAt: number; - usedAt: number; - status: 'InUse' | 'NotUse' | 'Expired' | 'AlreadyUsed' | string; - currentPnl: string; - limitPnl: string; - positionEffectiveAmount: string; - productId: number; - category: 'FlexibleSaving' | 'DualAssets' | string; +⋮---- +export interface FixedRateBorrowResultV5 { + orderId: string; } ⋮---- -export interface EarnAwardCardV5 { - awardId: number; - specCode: string; - claimedAt: number; - usedAt: number; - expireAt: number; - status: 'InUse' | 'NotUse' | 'Expired' | 'AlreadyUsed' | string; - amount: string; - limitPnlPercentage: string; - baseCoin: string; - quoteCoin: string; - direction: 1 | 2; - category: 'FlexibleSaving' | 'DualAssets' | string; +export interface FixedRateBorrowOrderInfoV5 { + annualRate: string; + orderId: string; + orderTime: string; + filledQty: string; + orderQty: string; + orderCurrency: string; + state: number; + term: number; + repayType: string; + strategyType: 'PARTIAL' | 'FULL'; } ⋮---- -export interface EarnCouponListResultV5 { - interestCards: EarnInterestCardV5[]; - awardCards: EarnAwardCardV5[]; +export interface FixedRateBorrowContractInfoV5 { + annualRate: string; + borrowCurrency: string; + borrowTime: string; + interestPaid: string; + loanId: string; + orderId: string; + repaymentTime: string; + residualPenaltyInterest: string; + residualPrincipal: string; + status: number; + term: string; + repayType: string; + strategyType: 'PARTIAL' | 'FULL'; } ⋮---- -export interface FlexibleSavingAutoSavingsCoinV5 { - coin: string; - isSelected: boolean; - maxStakingAmount: string; - apr: string; +export interface FixedRateBorrowQuoteV5 { + orderCurrency: string; + term: number; + annualRate: string; + qty: string; } ⋮---- -export interface FlexibleSavingAutoSavingsV5 { - selectedAll: boolean; - coins: FlexibleSavingAutoSavingsCoinV5[]; +export interface FixedRateBorrowInterestAccruedV5 { + refId: string; + currency: string; + orderId: string; + loanAmt: string; + interest: string; + interestRate: string; + ts: string; } ⋮---- -export interface EarnProductV5 { - category: string; - estimateApr: string; - coin: string; - minStakeAmount: string; - maxStakeAmount: string; - precision: string; - productId: string; - status: 'Available' | 'NotAvailable'; +export interface FlexibleAvailableInventoryV5 { + currency: string; + availableInventory: string; + updateTime: string; } ⋮---- -export interface EarnOrderHistoryV5 { - coin: string; - orderValue: string; - orderType: 'Redeem' | 'Stake'; - orderId: string; - orderLinkId: string; - status: 'Success' | 'Fail' | 'Pending'; - createdAt: string; - productId: string; - updatedAt: string; - swapOrderValue: string; - estimateRedeemTime: string; - estimateStakeTime: string; +export interface FixedRateAvailableInventoryV5 { + currency: string; + term: string; + annualRate: string; + availableInventory: string; + updateTime: string; } + +================ +File: src/types/websockets/ws-events.ts +================ +import WebSocket from 'isomorphic-ws'; ⋮---- -export interface EarnPositionFreezeDetailV5 { - amount: string; - description: string; +import { + RFQItemV5, + RFQPublicTradeV5, + RFQQuoteItemV5, + RFQTradeV5, +} from '../response/v5-rfq'; +import { + CategoryV5, + ExecTypeV5, + OCOTriggerTypeV5, + OrderCancelTypeV5, + OrderCreateTypeV5, + OrderRejectReasonV5, + OrderSideV5, + OrderSMPTypeV5, + OrderStatusV5, + OrderTimeInForceV5, + OrderTriggerByV5, + OrderTypeV5, + PositionIdx, + PositionSideV5, + PositionStatusV5, + StopOrderTypeV5, + SystemStatusItemV5, + TPSLModeV5, + TradeModeV5, +} from '../shared-v5'; +import { WsKey } from './ws-general'; +⋮---- +export interface MessageEventLike { + target: WebSocket; + type: 'message'; + data: string; } ⋮---- -export interface EarnPositionV5 { - coin: string; - productId: string; - amount: string; - totalPnl: string; - claimableYield: string; +export function isMessageEvent(msg: unknown): msg is MessageEventLike +⋮---- +export interface WSPublicTopicEventV5 { id?: string; - status?: string; - orderId?: string; - estimateRedeemTime?: string; - estimateStakeTime?: string; - estimateInterestCalculationTime?: string; - settlementTime?: string; - autoReinvest?: string; - /** Redeemable amount */ - availableAmount: string; - freezeDetails: EarnPositionFreezeDetailV5[]; + topic: TTopic; + type: TType; + /** Cross sequence */ + cs?: number; + /** Event timestamp */ + ts: number; + data: TData; + /** + * matching engine timestamp (correlated with T from public trade channel) + */ + cts: number; + /** + * Internal reference, can be used to determine if this is spot/linear/inverse/etc + */ + wsKey: WsKey; } ⋮---- -/** Redeemable amount */ +/** Cross sequence */ ⋮---- -export interface EarnYieldHistoryV5 { - productId: string; - coin: string; - id: string; - amount: string; - yieldType: string; - distributionMode: string; - effectiveStakingAmount: string; - orderId: string; - status: 'Pending' | 'Success' | 'Fail'; - createdAt: string; +/** Event timestamp */ +⋮---- +/** + * matching engine timestamp (correlated with T from public trade channel) + */ +⋮---- +/** + * Internal reference, can be used to determine if this is spot/linear/inverse/etc + */ +⋮---- +export interface WSPrivateTopicEventV5 { + id?: string; + topic: TTopic; + creationTime: number; + data: TData; + wsKey: WsKey; } ⋮---- -export interface EarnHourlyYieldHistoryV5 { - productId: string; - coin: string; - id: string; - amount: string; - effectiveStakingAmount: string; - status: 'Pending' | 'Success' | 'Fail'; - hourlyDate: string; - createdAt: string; +export interface WSOrderbookV5 { + /** Symbol */ + s: string; + /** [price, qty][] */ + b: [string, string][]; + /** [price, qty][] */ + a: [string, string][]; + /** Update ID */ + u: number; + /** Cross sequence */ + seq: number; } ⋮---- -export interface EarnAprHistoryPointV5 { - timestamp: string; - apr: string; +/** Symbol */ +⋮---- +/** [price, qty][] */ +⋮---- +/** [price, qty][] */ +⋮---- +/** Update ID */ +⋮---- +/** Cross sequence */ +⋮---- +export type WSOrderbookEventV5 = WSPublicTopicEventV5< + string, + 'delta' | 'snapshot', + WSOrderbookV5 +>; +⋮---- +export interface WSTradeV5 { + T: number; + s: string; + S: OrderSideV5; + v: string; + p: string; + L?: string; + i: string; + BT: boolean; + RPI?: boolean; + mP?: string; + iP?: string; + mIv?: string; + iv?: string; } ⋮---- -/** - * Advanced Earn — Dual Asset product (GET /v5/earn/advance/product). - */ -export interface AdvanceEarnDualAssetProductV5 { - category: string; - productId: string; - baseCoin: string; - quoteCoin: string; - expectReceiveAt: string; - duration: string; - status: 'Available' | 'NotAvailable'; - isVipProduct: boolean; - subscribeStartAt: string; - subscribeEndAt: string; - applyStartAt: string; - settlementTime: string; - minPurchaseQuoteAmount: string; - minPurchaseBaseAmount: string; - remainingAmountQuote: string; - remainingAmountBase: string; - orderPrecisionDigitalQuote: number; - orderPrecisionDigitalBase: number; +export type WSTradeEventV5 = WSPublicTopicEventV5< + string, + 'snapshot', + WSTradeV5[] +>; +⋮---- +export interface WSEventOrderbookV5 { + s: string; + r: [string, string][]; + u: number; + seq: number; } ⋮---- -export interface AdvanceEarnDualAssetProductInfoV5 { - category: string; - list: AdvanceEarnDualAssetProductV5[]; +export type WSEventOrderbookEventV5 = WSPublicTopicEventV5< + string, + 'delta' | 'snapshot', + WSEventOrderbookV5 +>; +⋮---- +export interface WSEventPublicTradeV5 { + T: number; + s: string; + r: string; + a: string; + i: string; + seq: number; } ⋮---- +export type WSEventPublicTradeEventV5 = WSPublicTopicEventV5< + string, + 'snapshot', + WSEventPublicTradeV5[] +>; +⋮---- /** - * Advanced Earn — Double Win (GET /v5/earn/advance/product?category=DoubleWin). - */ -export interface AdvanceEarnDoubleWinProductV5 { - category: string; - productId: string; - investCoin: string; - underlyingAsset: string; - duration: string; - subscribeStartAt: string; - subscribeEndAt: string; - settlementTime: string; - expectReceiveAt: string; - minPurchaseAmount: string; - orderPrecisionDigital: number; - isRfqProduct: boolean; - lowerPriceBuffer: string; - upperPriceBuffer: string; - minDeviationRatio: string; - maxDeviationRatio: string; - priceTickSize: string; + * WSTickerV5 is the data structure for the "linear" ticker channel + * */ +export interface WSTickerV5 { + symbol: string; + tickDirection: string; + price24hPcnt: string; + lastPrice: string; + prevPrice24h: string; + highPrice24h: string; + lowPrice24h: string; + prevPrice1h: string; + markPrice: string; + indexPrice: string; + openInterest: string; + openInterestValue: string; + singleOpenInterest?: string; + singleOpenInterestValue?: string; + turnover24h: string; + volume24h: string; + nextFundingTime: string; + fundingRate: string; + bid1Price: string; + bid1Size: string; + ask1Price: string; + ask1Size: string; + deliveryTime?: string; + basisRate?: string; + deliveryFeeRate?: string; + predictedDeliveryPrice?: string; + preOpenPrice?: string; + preQty?: string; + curPreListingPhase?: string; + fundingIntervalHour?: string; + fundingCap?: string; + basisRateYear?: string; } ⋮---- -/** - * Advanced Earn — Smart Leverage (GET /v5/earn/advance/product?category=SmartLeverage). - */ -export interface AdvanceEarnSmartLeverageProductV5 { - category: string; - productId: string; - investCoin: string; - underlyingAsset: string; - direction: 'Long' | 'Short'; - leverage: string; - duration: string; - subscribeStartAt: string; - subscribeEndAt: string; - settlementTime: string; - expectReceiveAt: string; - minPurchaseAmount: string; - remainingAmount: string; - orderPrecisionDigital: number; +export interface WSTickerOptionV5 { + symbol: string; + bidPrice: string; + bidSize: string; + bidIv: string; + askPrice: string; + askSize: string; + askIv: string; + lastPrice: string; + highPrice24h: string; + lowPrice24h: string; + markPrice: string; + indexPrice: string; + markPriceIv: string; + underlyingPrice: string; + openInterest: string; + turnover24h: string; + volume24h: string; + totalVolume: string; + totalTurnover: string; + delta: string; + gamma: string; + vega: string; + theta: string; + predictedDeliveryPrice: string; + change24h: string; } ⋮---- -/** - * Advanced Earn — Discount Buy (GET /v5/earn/advance/product?category=DiscountBuy). - */ -export interface AdvanceEarnDiscountBuyProductV5 { - category: string; - productId: string; - coin: string; - underlyingAsset: string; - settlementTime: string; - duration: string; - isVipProduct: boolean; - subscribeStartAt: string; - subscribeEndAt: string; - minPurchaseAmount: string; - remainingAmount: string; - orderPrecisionDigital: number; - expectReceiveAt: string; +export interface WSTickerSpotV5 { + symbol: string; + lastPrice: string; + highPrice24h: string; + lowPrice24h: string; + prevPrice24h: string; + volume24h: string; + turnover24h: string; + price24hPcnt: string; + usdIndexPrice: string; } ⋮---- -export type AdvanceEarnAdvanceProductListItemV5 = - | AdvanceEarnDualAssetProductV5 - | AdvanceEarnDoubleWinProductV5 - | AdvanceEarnSmartLeverageProductV5 - | AdvanceEarnDiscountBuyProductV5; +export type WSTickerEventV5 = WSPublicTopicEventV5< + string, + 'snapshot' | 'delta', + WSTickerV5 | WSTickerOptionV5 | WSTickerSpotV5 +>; ⋮---- -export interface AdvanceEarnAdvanceProductInfoV5 { - category: string; - list: AdvanceEarnAdvanceProductListItemV5[]; +export interface WSKlineV5 { + start: number; + end: number; + interval: string; + open: string; + close: string; + high: string; + low: string; + volume: string; + turnover: string; + confirm: boolean; + timestamp: number; } ⋮---- -/** GET /v5/earn/hold-to-earn/product — Hold to Earn airdrop products */ -export type HoldToEarnAirdropProductStatusV5 = - | 'NotStarted' - | 'Online' - | 'Ended'; +export type WSKlineEventV5 = WSPublicTopicEventV5< + string, + 'snapshot', + WSKlineV5[] +>; ⋮---- -export interface HoldToEarnAirdropProductYieldV5 { - coinName: string; - /** Yesterday's APR for display, e.g. "10%", "0%" */ - apy: string; - personalApy?: string; - multiplier?: string; +export interface WSLiquidationV5 { + T: number; + s: string; + S: OrderSideV5; + v: string; + p: string; } ⋮---- -/** Yesterday's APR for display, e.g. "10%", "0%" */ +export type WSLiquidationEventV5 = WSPublicTopicEventV5< + string, + 'snapshot', + WSLiquidationV5[] +>; ⋮---- -export interface HoldToEarnAirdropProductV5 { - coinName: string; - yields: HoldToEarnAirdropProductYieldV5[]; - status: HoldToEarnAirdropProductStatusV5; - announcementUrl: string; - /** Yesterday's avg APR across yield coins */ - apy: string; - personalApy?: string; +export interface WSPositionV5 { + category: string; + symbol: string; + side: PositionSideV5; + size: string; + positionIdx: PositionIdx; + tradeMode: TradeModeV5; + positionValue: string; + riskId: number; + riskLimitValue: string; + entryPrice: string; + markPrice: string; + leverage: string; + breakEvenPrice?: string; // Break even price, only for linear & inverse + positionBalance: string; + autoAddMargin: number; + positionMM: string; + positionIM: string; + positionIMByMp: string; + positionMMByMp: string; + liqPrice: string; + bustPrice: string; + tpslMode: string; + takeProfit: string; + stopLoss: string; + trailingStop: string; + unrealisedPnl: string; + curRealisedPnl: string; + sessionAvgPrice: string; + delta: string; + gamma: string; + vega: string; + theta: string; + cumRealisedPnl: string; + positionStatus: PositionStatusV5; + adlRankIndicator: number; + isReduceOnly: boolean; + mmrSysUpdatedTime: string; + leverageSysUpdatedTime: string; + createdTime: string; + updatedTime: string; + /** Position open timestamp (ms). Default `0` when not set. */ + openTime: number; + seq: number; + netDeltaRatio?: string; } ⋮---- -/** Yesterday's avg APR across yield coins */ +breakEvenPrice?: string; // Break even price, only for linear & inverse ⋮---- -export interface HoldToEarnAirdropProductsResultV5 { - products: HoldToEarnAirdropProductV5[]; -} +/** Position open timestamp (ms). Default `0` when not set. */ ⋮---- -/** GET /v5/earn/hold-to-earn/yield-history */ -export interface HoldToEarnAirdropDailyPnlV5 { - coinName: string; - yieldCoinName: string; - effectiveAmount: string; - pnl: string; - apy: string; - createdAt: number; -} +export type WSPositionEventV5 = WSPrivateTopicEventV5< + 'position', + WSPositionV5[] +>; ⋮---- -export interface HoldToEarnAirdropYieldHistoryResultV5 { - nextCursor: string; - airdropDailyPnls: HoldToEarnAirdropDailyPnlV5[]; +export interface WSEventPositionV5 { + symbol: string; + baseCoin: string; + settleCoin: string; + side: string; + ecContractType: string; + ecDirection: string; + avgPayoutRatio: string; + positionValue: string; + ecSettleTime: string; + cumClosedPnl: string; + createdTime: string; + updatedTime: string; + seq: number; } - -================ -File: src/types/response/v5-user.ts -================ -import { - ReferralFriendStatusV5, - ReferralProductLineV5, -} from '../request/v5-user'; -import { PermissionsV5 } from '../shared-v5'; ⋮---- -export interface CreateSubMemberResultV5 { - uid: string; - username: string; - memberType: number; - status: number; - remark: string; -} +export type WSEventPositionEventV5 = WSPrivateTopicEventV5< + 'position.event', + WSEventPositionV5[] +>; ⋮---- -export interface CreateSubApiKeyResultV5 { - id: string; - note: string; - apiKey: string; - readOnly: number; - secret: string; - permissions: PermissionsV5; +export interface WSAccountOrderV5 { + category: CategoryV5; + orderId: string; + orderLinkId: string; + parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) + isLeverage: string; + blockTradeId: string; + symbol: string; + price: string; + qty: string; + side: OrderSideV5; + positionIdx: PositionIdx; + orderStatus: OrderStatusV5; + createType: OrderCreateTypeV5; + cancelType: OrderCancelTypeV5; + rejectReason?: OrderRejectReasonV5; + avgPrice?: string; + leavesQty?: string; + leavesValue?: string; + cumExecQty: string; + cumExecValue: string; + cumExecFee: string; + closedPnl: string; + feeCurrency: string; + timeInForce: OrderTimeInForceV5; + orderType: OrderTypeV5; + stopOrderType: StopOrderTypeV5; + ocoTriggerType?: OCOTriggerTypeV5; + orderIv: string; + marketUnit?: 'baseCoin' | 'quoteCoin'; + triggerPrice: string; + takeProfit: string; + stopLoss: string; + tpslMode?: TPSLModeV5; + tpLimitPrice?: string; + slLimitPrice?: string; + tpTriggerBy: string; + slTriggerBy: string; + triggerDirection: number; + triggerBy: OrderTriggerByV5; + lastPriceOnCreated: string; + reduceOnly: boolean; + closeOnTrigger: boolean; + placeType: string; + smpType: OrderSMPTypeV5; + smpGroup: string; + smpOrderId: string; + createdTime: string; + updatedTime: string; + cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency + rpiTakerAccess?: boolean; + rpiMatchedQty?: string; } ⋮---- -export interface SubMemberV5 { - uid: string; - username: string; - memberType: number; - status: number; - accountMode: number; - remark: string; -} -export type ApiKeyType = 1 | 2; +parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) ⋮---- -export interface ApiKeyPermissionsV5 { - ContractTrade: string[]; - Spot: string[]; - Wallet: string[]; - Options: string[]; - Derivatives: string[]; - CopyTrading: string[]; - BlockTrade: string[]; - Exchange: string[]; - NFT: string[]; - Affiliate: string[]; - Earn?: string[]; - FiatP2P?: string[]; - FiatBitPay?: string[]; - FiatConvertBroker?: string[]; - /** @deprecated */ - FiatGlobalPay?: string[]; - BitCard?: string[]; - ByXPost?: string[]; +cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +⋮---- +export type WSAccountOrderEventV5 = WSPrivateTopicEventV5< + 'order', + WSAccountOrderV5[] +>; +⋮---- +export interface WSEventOrderV5 { + category: 'event' | string; + orderId: string; + orderLinkId: string; + symbol: string; + symbolId: number; + side: string; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + orderStatus: string; + ecContractType: string; + ecDirection: string; + ecDurationWindow: number; + ecTargetPrice: string; + ecLowerBound: string; + ecUpperBound: string; + ecOrderValue: string; + ecIndexPrice: string; + ecSettleTime: string; + payoutRatio: string; + orderAvgPayoutRatio: string; + cumExecValue: string; + cumExecFee: string; + leavesValue: string; + cumPayout: string; + createType: number; + cancelType: string; + rejectReason: string; + extraFees: unknown[]; + transTime: string; + createdTime: string; + updatedTime: string; } ⋮---- -/** @deprecated */ +export type WSEventOrderEventV5 = WSPrivateTopicEventV5< + 'order' | 'order.event', + WSEventOrderV5[] +>; ⋮---- -export interface ApiKeyInfoV5 { - id: string; - note: string; - apiKey: string; - readOnly: 0 | 1; - secret: string; - permissions: ApiKeyPermissionsV5; - ips: string[]; - type: 1 | 2; // 1: personal, 2: connected to third-party app - deadlineDay: number; - expiredAt: string; - createdAt: string; - /** @deprecated */ - unified: number; - uta: 0 | 1; // 0: regular account, 1: unified trade account - userID: number; - inviterID: number; - vipLevel: string; - mktMakerLevel: string; - affiliateID: number; - rsaPublicKey: string; - isMaster: boolean; - parentUid: string; - kycLevel: 'LEVEL_DEFAULT' | 'LEVEL_1' | 'LEVEL_2'; - kycRegion: string; - isFixApi?: boolean; +export interface WSExecutionV5 { + category: CategoryV5; + symbol: string; + isLeverage: string; + orderId: string; + orderLinkId: string; + side: OrderSideV5; + orderPrice: string; + orderQty: string; + leavesQty: string; + createType: OrderCreateTypeV5; + orderType: OrderTypeV5; + stopOrderType: StopOrderTypeV5; + execFee: string; + feeCurrency: string; // Trading fee currency + execId: string; + execPrice: string; + execQty: string; + execPnl: string; + execType: ExecTypeV5; + execValue: string; + execTime: string; + isMaker: boolean; + feeRate: string; + tradeIv: string; + markIv: string; + markPrice: string; + indexPrice: string; + underlyingPrice: string; + blockTradeId: string; + closedSize: string; + extraFees: string; + seq: number; + marketUnit: string; } ⋮---- -type: 1 | 2; // 1: personal, 2: connected to third-party app +feeCurrency: string; // Trading fee currency ⋮---- -/** @deprecated */ +export type WSExecutionEventV5 = WSPrivateTopicEventV5< + 'execution', + WSExecutionV5[] +>; ⋮---- -uta: 0 | 1; // 0: regular account, 1: unified trade account +export interface WSEventExecutionV5 { + category: 'event' | string; + transId: string; + execId: string; + orderId: string; + orderLinkId: string; + symbol: string; + symbolId: number; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + side: string; + feeCoin: string; + execType: string; + execPrice: string; + execValue: string; + execFee: string; + execFeeRate: string; + orderPrice: string; + ecContractType: number | string; + ecDirection: number | string; + ecDurationWindow: number; + ecTargetPrice: string; + ecLowerBound: string; + ecUpperBound: string; + ecOrderValue: string; + ecIndexPrice?: string; + ecPayout: string; + entryPrice: string; + settlePrice: string; + grossPayoutRatio: string; + sessionRpl: string; + transTime: string; + settleTimeMs: string; + crossSeq: string; + timeInForce: string; + extraFees: unknown[]; +} ⋮---- -export interface UpdateApiKeyResultV5 { - id: string; - note: string; - apiKey: string; - readOnly: 0 | 1; - secret: string; - permissions: PermissionsV5; - ips: string[]; +export type WSEventExecutionEventV5 = WSPrivateTopicEventV5< + 'execution' | 'execution.event', + WSEventExecutionV5[] +>; +⋮---- +export interface WSExecutionFastV5 { + category: CategoryV5; + symbol: string; + execId: string; + execPrice: string; + execQty: string; + orderId: string; + isMaker: boolean; + orderLinkId: string; + side: OrderSideV5; + execTime: string; + seq: number; + liquidity?: string; } ⋮---- -export interface SubAccountAllApiKeysResultV5 { - result: { - id: string; - ips?: string[]; - apiKey: string; - note: string; - status: number; - expiredAt?: string; - createdAt: string; - type: ApiKeyType; - permissions: PermissionsV5; - secret: string; - readOnly: 0 | 1; - deadlineDay?: number; - flag: string; - }[]; - nextPageCursor: string; +export type WSExecutionFastEventV5 = WSPrivateTopicEventV5< + 'execution.fast', + WSExecutionFastV5[] +>; +⋮---- +export interface WSCoinV5 { + coin: string; + equity: string; + usdValue: string; + walletBalance: string; + free?: string; + locked: string; + spotHedgingQty: string; + borrowAmount: string; + availableToBorrow: string; + availableToWithdraw: string; + accruedInterest: string; + totalOrderIM: string; + totalPositionIM: string; + totalPositionMM: string; + unrealisedPnl: string; + cumRealisedPnl: string; + bonus: string; + collateralSwitch: boolean; + marginCollateral: boolean; + spotBorrow: string; + colRes?: string; } ⋮---- -export interface AffiliateUserListItemV5 { - userId: string; - registerTime: string; - source: string; - remarks: string; - isKyc: boolean; - takerVol30Day: string; - makerVol30Day: string; - tradeVol30Day: string; - depositAmount30Day: string; - takerVol365Day: string; - makerVol365Day: string; - tradeVol365Day: string; - depositAmount365Day: string; - takerVol: string; - makerVol: string; - tradeVol: string; - startDate: string; - endDate: string; - /** tradfi trade volume in [startDate, endDate] when startDate/endDate in params */ - tradfiTradeVol?: string; - /** tradfi trade volume in last 30 days. 0 when startDate/endDate in params */ - tradfiTradeVol30Day?: string; - /** tradfi trade volume in past year. 0 when startDate/endDate in params */ - tradfiTradeVol365Day?: string; - /** Commission between startDate and endDate when startDate/endDate in params. Coin -> amount */ - commissionsVol?: Record; - /** Commission in last 30 days. Coin -> amount */ - commissions30Day?: Record; - /** Commission in past year. Coin -> amount */ - commissions365Day?: Record; +export interface WSWalletV5 { + accountType: string; + accountLTV: string; + accountIMRate: string; + accountMMRate: string; + accountIMRateByMp: string; + accountMMRateByMp: string; + totalInitialMarginByMp: string; + totalMaintenanceMarginByMp: string; + totalEquity: string; + totalWalletBalance: string; + totalMarginBalance: string; + totalAvailableBalance: string; + totalPerpUPL: string; + totalInitialMargin: string; + totalMaintenanceMargin: string; + coin: WSCoinV5[]; } ⋮---- -/** tradfi trade volume in [startDate, endDate] when startDate/endDate in params */ +export type WSWalletEventV5 = WSPrivateTopicEventV5<'wallet', WSWalletV5[]>; ⋮---- -/** tradfi trade volume in last 30 days. 0 when startDate/endDate in params */ +export interface WSGreeksV5 { + baseCoin: string; + totalDelta: string; + totalGamma: string; + totalVega: string; + totalTheta: string; +} ⋮---- -/** tradfi trade volume in past year. 0 when startDate/endDate in params */ +export type WSGreeksEventV5 = WSPrivateTopicEventV5<'greeks', WSGreeksV5[]>; ⋮---- -/** Commission between startDate and endDate when startDate/endDate in params. Coin -> amount */ +export interface WSSpreadOrderV5 { + category: 'combination' | 'spot_leg' | 'future_leg'; + symbol: string; + parentOrderId: string; + orderId: string; + orderLinkId: string; + side: OrderSideV5; + orderStatus: OrderStatusV5; + cancelType: OrderCancelTypeV5; + rejectReason: OrderRejectReasonV5; + timeInForce: OrderTimeInForceV5; + price: string; + qty: string; + avgPrice: string; + leavesQty: string; + leavesValue: string; + cumExecQty: string; + cumExecValue: string; + cumExecFee: string; + orderType: OrderTypeV5; + isLeverage: string; + createdTime: string; + updatedTime: string; + feeCurrency: string; + createType: OrderCreateTypeV5; + closedPnl: string; + cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +} ⋮---- -/** Commission in last 30 days. Coin -> amount */ +cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency ⋮---- -/** Commission in past year. Coin -> amount */ +export type WSSpreadOrderEventV5 = WSPrivateTopicEventV5< + 'spread.order', + WSSpreadOrderV5[] +>; ⋮---- -export interface AffiliateUserInfoV5 { - uid: string; - vipLevel: string; - takerVol30Day: string; - makerVol30Day: string; - tradeVol30Day: string; - depositAmount30Day: string; - takerVol365Day: string; - makerVol365Day: string; - tradeVol365Day: string; - depositAmount365Day: string; - totalWalletBalance: '1' | '2' | '3' | '4'; - depositUpdateTime: string; - volUpdateTime: string; - KycLevel: 0 | 1 | 2; - /** tradfi trade volume in last 30 days (USDT) */ - tradfiTradeVol30Day?: string; - /** tradfi trade volume in past year (USDT) */ - tradfiTradeVol365Day?: string; - /** tradfi commissions in last 30 days. Coin -> amount */ - commissions30Day?: Record; - /** tradfi commissions in past year. Coin -> amount */ - commissions365Day?: Record; - /** Payment amount in the last 30 days */ - paySendAmount30Day: string; - /** Pay first transaction amount */ - payFtt: string; - /** Card first-time transaction amount */ - cardFtt: string; +export interface WSSpreadExecutionV5 { + category: 'combination' | 'spot_leg' | 'future_leg'; + symbol: string; + isLeverage: string; + orderId: string; + orderLinkId: string; + side: OrderSideV5; + orderPrice: string; + orderQty: string; + leavesQty: string; + createType: OrderCreateTypeV5; + orderType: OrderTypeV5; + execFee: string; + execFeeV2: string; + feeCurrency: string; // Trading fee currency + parentExecId: string; + execId: string; + execPrice: string; + execQty: string; + execPnl: string; + execType: ExecTypeV5; + execValue: string; + execTime: string; + isMaker: boolean; + feeRate: string; + markPrice: string; + closedSize: string; + seq: number; } ⋮---- -/** tradfi trade volume in last 30 days (USDT) */ -⋮---- -/** tradfi trade volume in past year (USDT) */ -⋮---- -/** tradfi commissions in last 30 days. Coin -> amount */ -⋮---- -/** tradfi commissions in past year. Coin -> amount */ -⋮---- -/** Payment amount in the last 30 days */ -⋮---- -/** Pay first transaction amount */ +feeCurrency: string; // Trading fee currency ⋮---- -/** Card first-time transaction amount */ +export type WSSpreadExecutionEventV5 = WSPrivateTopicEventV5< + 'spread.execution', + WSSpreadExecutionV5[] +>; ⋮---- -export interface AffiliateSubAffiliateListItemV5 { - subAffId: string; - userId: string; - name: string; - email: string; - /** Commission per currency (BTC, ETH, MNT, USDC, USDT) for the queried date range */ - commissionsVol: Record; - commissionsForUsdt: string; - becameAffTime: string; - startDate: string; - endDate: string; +export interface WSInsuranceV5 { + coin: string; + symbols: string; + balance: string; + updateTime: string; } ⋮---- -/** Commission per currency (BTC, ETH, MNT, USDC, USDT) for the queried date range */ -⋮---- -export interface AffiliateSubAffiliateListResultV5 { - list: AffiliateSubAffiliateListItemV5[]; - nextPageCursor: string; -} +export type WSInsuranceEventV5 = WSPublicTopicEventV5< + 'insurance.USDT' | 'insurance.USDC' | 'insurance.inverse', + 'snapshot' | 'delta', + WSInsuranceV5[] +>; ⋮---- -export interface FriendReferralRecordV5 { - id: string; - inviteeUid: string; - status: number; - createdAt: string; - updatedAt: string; +export interface WSPriceLimitV5 { + symbol: string; + buyLmt: string; + sellLmt: string; } ⋮---- -export interface ReferralCodeItemV5 { - referralCode: string; - referralLink: string; - scene: number; -} +export type WSPriceLimitEventV5 = WSPublicTopicEventV5< + string, + 'snapshot', + WSPriceLimitV5 +>; ⋮---- -export interface ReferralCodesResultV5 { - referralCodes: ReferralCodeItemV5[]; +export interface WSADLAlertV5 { + c: string; // Token of the insurance pool + s: string; // Trading pair name + b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) + mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours + i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL + pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped + adl_tt: string; // Trigger threshold for contract PnL drawdown ADL + adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL } ⋮---- -/** 0 unknown, 1 awaiting credit, 2 settled. Unrecognized values are returned as 0. */ -export type ReferralCommissionStatusV5 = 0 | 1 | 2; +c: string; // Token of the insurance pool +s: string; // Trading pair name +b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) +mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours +i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL +pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped +adl_tt: string; // Trigger threshold for contract PnL drawdown ADL +adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL ⋮---- -export interface ReferralCommissionRecordV5 { - /** Masked invitee ID: first character + `***` + last character. */ - userId: string; - /** Commission payment time, Unix seconds. */ - paymentTime: number; - /** Commission rate. */ - rate: string; - businessUnit: ReferralProductLineV5; - commissionOriginCoin: string; - /** Commission amount in the original currency. */ - commissionOriginAmount: string; - /** Commission value in USDT. */ - commissionUsdtAmount: string; - commissionStatus: ReferralCommissionStatusV5; - /** - * Whether the invitee is a Boost user. May be omitted. - */ - isBoostM2?: boolean; -} +export type WSADLAlertEventV5 = WSPublicTopicEventV5< + 'adlAlert.USDT' | 'adlAlert.USDC' | 'adlAlert.inverse', + 'snapshot', + WSADLAlertV5[] +>; ⋮---- -/** Masked invitee ID: first character + `***` + last character. */ +export type WSSystemStatusEventV5 = WSPublicTopicEventV5< + 'system.status', + 'snapshot', + SystemStatusItemV5[] +>; ⋮---- -/** Commission payment time, Unix seconds. */ +/** + * RFQ WebSocket Events + */ ⋮---- -/** Commission rate. */ +/** + * RFQ Inquiry Channel + * Private push for RFQ inquiries sent or received by the user + * Topics: rfq.open.rfqs, rfq.site.rfqs + */ +export type WSRFQInquiryEventV5 = WSPrivateTopicEventV5< + 'rfq.open.rfqs' | 'rfq.site.rfqs', + RFQItemV5[] +>; ⋮---- -/** Commission amount in the original currency. */ +/** + * RFQ Quote Channel + * Private push for quotes sent or received by the user + * Topics: rfq.open.quotes, rfq.site.quotes + */ +export type WSRFQQuoteEventV5 = WSPrivateTopicEventV5< + 'rfq.open.quotes' | 'rfq.site.quotes', + RFQQuoteItemV5[] +>; ⋮---- -/** Commission value in USDT. */ +/** + * RFQ Trade Channel + * Private push for block trades executed by the user + * Topics: rfq.open.trades, rfq.site.trades + */ +export type WSRFQTradeEventV5 = WSPrivateTopicEventV5< + 'rfq.open.trades' | 'rfq.site.trades', + RFQTradeV5[] +>; ⋮---- /** - * Whether the invitee is a Boost user. May be omitted. - */ + * RFQ Public Trade Channel + * Public push for all block trades + * Topics: rfq.open.public.trades, rfq.site.public.trades + */ +export type WSRFQPublicTradeEventV5 = WSPublicTopicEventV5< + 'rfq.open.public.trades' | 'rfq.site.public.trades', + 'snapshot', + RFQPublicTradeV5[] +>; + +================ +File: src/types/request/index.ts +================ + + +================ +File: src/types/response/index.ts +================ + + +================ +File: src/types/response/v5-asset.ts +================ +import { AccountTypeV5, OrderSideV5, WithdrawalTypeV5 } from '../shared-v5'; ⋮---- -export interface ReferralCommissionRecordsResultV5 { - records: ReferralCommissionRecordV5[]; - total: number; +export interface CoinExchangeRecordV5 { + fromCoin: string; + fromAmount: string; + toCoin: string; + toAmount: string; + exchangeRate: string; + createdTime: string; + exchangeTxId: string; } ⋮---- -export interface ReferralRebateRatioRuleV5 { - /** Referral commission rate, from 0 to 100. */ - rebateRatio: number; - /** Required number of qualified invitees. */ - referralCount: number; - /** Whether the tier requires trading volume. */ - hasTradeCondition: boolean; - /** Trading-volume threshold for the tier. */ - tradeAmountCondition: number; +export interface DeliveryRecordV5 { + deliveryTime: number; + symbol: string; + side: OrderSideV5; + position: string; + deliveryPrice: string; + strike: string; + fee: string; + deliveryRpl: string; + entryPrice: string; } ⋮---- -/** Referral commission rate, from 0 to 100. */ -⋮---- -/** Required number of qualified invitees. */ -⋮---- -/** Whether the tier requires trading volume. */ -⋮---- -/** Trading-volume threshold for the tier. */ +export interface SettlementRecordV5 { + symbol: string; + side: string; + size: number; + sessionAvgPrice: string; + markPrice: string; + realisedPnl: string; + createdTime: string; +} ⋮---- -export interface ReferralRebateRuleV5 { - /** Deposit threshold. Currency and precision are not specified. */ - depositAmount: number; - /** Trading threshold. Currency and precision are not specified. */ - tradeAmount: number; - rebateRatioRules: ReferralRebateRatioRuleV5[]; - /** Number of days that the referral commission lasts. */ - rebateDurationDays: number; - /** - * Currently not populated. A default of `0` does not confirm a threshold. - */ - tradefiDepositAmount?: number; - /** - * Currently not populated. A default of `0` does not confirm a threshold. - */ - tradefiTradeAmount?: number; +export interface AssetInfoAssetV5 { + coin: string; + frozen: string; + free: string; + withdraw: string; +} +⋮---- +export interface AssetInfoV5 { + status: 'ACCOUNT_STATUS_NORMAL' | 'ACCOUNT_STATUS_UNSPECIFIED'; + assets: AssetInfoAssetV5[]; } ⋮---- -/** Deposit threshold. Currency and precision are not specified. */ +export interface CoinBalanceV5 { + coin: string; + walletBalance: string; + transferBalance: string; + bonus?: string; +} ⋮---- -/** Trading threshold. Currency and precision are not specified. */ +export interface AllCoinsBalanceV5 { + accountType: AccountTypeV5; + memberId?: string; + balance: CoinBalanceV5[]; +} ⋮---- -/** Number of days that the referral commission lasts. */ +export interface AccountCoinBalanceV5 { + accountType: AccountTypeV5; + bizType: number; + accountId: string; + memberId: string; + balance: { + coin: string; + walletBalance: string; + transferBalance: string; + bonus: string; + transferSafeAmount: string; + ltvTransferSafeAmount: string; + }; +} ⋮---- -/** - * Currently not populated. A default of `0` does not confirm a threshold. - */ +export interface InternalTransferRecordV5 { + transferId: string; + coin: string; + amount: string; + fromAccountType: AccountTypeV5; + toAccountType: AccountTypeV5; + timestamp: string; + status: string; +} ⋮---- -/** - * Currently not populated. A default of `0` does not confirm a threshold. - */ +export interface UniversalTransferRecordV5 { + transferId: string; + coin: string; + amount: string; + fromMemberId: string; + toMemberId: string; + fromAccountType: AccountTypeV5; + toAccountType: AccountTypeV5; + timestamp: string; + status: string; + withdrawReqId?: string; + depositReqId?: string; +} ⋮---- -/** - * Task reward type. See Bybit enum `awardType`. - * `100` loads reward-packet details. Types `95` and `97` do not currently - * include assembled reward details. - */ -export type ReferralAwardTypeV5 = - | 0 - | 1 - | 2 - | 3 - | 4 - | 5 - | 6 - | 7 - | 8 - | 9 - | 10 - | 11 - | 12 - | 13 - | 14 - | 15 - | 16 - | 17 - | 18 - | 19 - | 95 - | 96 - | 97 - | 98 - | 99 - | 100; +export interface AllowedDepositCoinInfoV5 { + coin: string; + chain: string; + coinShowName: string; + chainType: string; + blockConfirmNumber: number; + minDepositAmount: string; +} ⋮---- -export interface ReferralCampaignAwardV5 { - /** Regular reward ID or reward packet ID. */ - id: number; - /** - * English reward name. Reward packets use `UP TO ` or - * `EARN `. - */ - name: string; - /** English reward type. Always `Packet` for reward packets. */ - type: string; - /** English product type. Empty for reward packets. */ - productLine: string; - /** UTC RFC 3339. Empty when unavailable or for reward packets. */ - startTime: string; - /** UTC RFC 3339. Empty when unavailable. */ - endTime: string; +export interface DepositRecordV5 { + id: string; + requestId?: string; + coin: string; + chain: string; + amount: string; + txID: string; + status: number; + toAddress: string; + tag: string; + depositFee: string; + successAt: string; + confirmations: string; + txIndex: string; + blockHash: string; + batchReleaseLimit: string; + depositType: string; + fromAddress: string; + travelRuleStatus?: string; } ⋮---- -/** Regular reward ID or reward packet ID. */ +export interface SubmitDepositOriginatorInfoResultV5 { + travelRuleStatus: number; +} ⋮---- -/** - * English reward name. Reward packets use `UP TO ` or - * `EARN `. - */ +export interface InternalDepositRecordV5 { + id: string; + type: 1; + coin: string; + amount: string; + status: 1 | 2 | 3; + address: string; + createdTime: string; + txID: string; + complianceStatus?: string; +} ⋮---- -/** English reward type. Always `Packet` for reward packets. */ +export interface DepositAddressChainV5 { + chainType: string; + addressDeposit: string; + tagDeposit: string; + chain: string; + batchReleaseLimit: string; + contractAddress: string; +} ⋮---- -/** English product type. Empty for reward packets. */ +export interface DepositAddressResultV5 { + coin: string; + chains: DepositAddressChainV5[]; +} ⋮---- -/** UTC RFC 3339. Empty when unavailable or for reward packets. */ +export interface CoinInfoV5 { + name: string; + coin: string; + /** @deprecated Use `chains[].withdrawMax` instead */ + remainAmount: string; + chains: { + chain: string; + chainType: string; + confirmation: string; + withdrawFee: string; + depositMin: string; + withdrawMin: string; + minAccuracy: string; + chainDeposit: string; + chainWithdraw: string; + withdrawPercentageFee: string; + contractAddress: string; + safeConfirmNumber: string; + /** Max withdraw amount per transaction per chain. `-1` means no limit */ + withdrawMax: string; + }[]; +} ⋮---- -/** UTC RFC 3339. Empty when unavailable. */ +/** @deprecated Use `chains[].withdrawMax` instead */ ⋮---- -/** One configured task inside a parsed campaign JSON string. */ -export interface ReferralCampaignTaskItemV5 { - id: number; - awardType: ReferralAwardTypeV5; - /** English title of each valid rule. `null` when there are no valid rules. */ - ruleTitle: string[] | null; - /** English description of each valid rule. Same index as `ruleTitle`. */ - ruleDescription: string[] | null; - /** First parameter of each valid rule. Same index as `ruleTitle`. */ - ruleParam: string[] | null; - taskAwards: ReferralCampaignAwardV5[]; - /** M1 rewards with `UserRelateType=REFERRAL`. */ - m1Awards: ReferralCampaignAwardV5[]; +/** Max withdraw amount per transaction per chain. `-1` means no limit */ +⋮---- +export interface WithdrawalRecordV5 { + withdrawId: string; + txID: string; + withdrawType: WithdrawalTypeV5; + coin: string; + chain: string; + amount: string; + withdrawFee: string; + status: string; + toAddress: string; + tag: string; + createTime: string; + updateTime: string; } ⋮---- -/** English title of each valid rule. `null` when there are no valid rules. */ +export interface WithdrawalAddressV5 { + coin: string; + chain: string; + address: string; + tag: string; + remark: string; + status: number; + addressType: number; + verified: number; + createdAt: string; +} ⋮---- -/** English description of each valid rule. Same index as `ruleTitle`. */ +export interface WithdrawableAccountSliceV5 { + coin: string; + withdrawableAmount: string; + availableBalance: string; +} ⋮---- -/** First parameter of each valid rule. Same index as `ruleTitle`. */ +/** + * GET /v5/asset/withdraw/withdrawable-amount. Only keys with data are returned + * (e.g. UTA, FUND, EARN; EARN when the coin can be withdrawn from Earn; SPOT if present). + */ +export interface WithdrawableAmountV5 { + limitAmountUsd: string; + withdrawableAmount: { + SPOT?: WithdrawableAccountSliceV5; + FUND?: WithdrawableAccountSliceV5; + UTA?: WithdrawableAccountSliceV5; + EARN?: WithdrawableAccountSliceV5; + }; +} ⋮---- -/** M1 rewards with `UserRelateType=REFERRAL`. */ +export interface VaspEntityV5 { + vaspEntityId: string; + vaspName: string; +} ⋮---- -/** - * Parsed shape of one `ReferralCampaignRewardsResultV5.tasks` string. - * `schemaVersion` is `2`. This is campaign configuration, not the user's - * task progress or a claimed reward. - */ -export interface ReferralCampaignTaskPayloadV5 { - schemaVersion: 2; - source: 'base' | 'fiat' | 'earn'; - /** Campaign configuration ID, not a user reward-record ID. */ - campaignId: string; - /** May be empty if task details cannot be assembled. */ - tasks: ReferralCampaignTaskItemV5[]; +export interface ConvertCoinSpecV5 { + coin: string; + fullName: string; + icon: string; + iconNight: string; + accuracyLength: number; + coinType: string; + balance: string; + uBalance: string; + singleFromMinLimit: string; + singleFromMaxLimit: string; + disableFrom: boolean; + disableTo: boolean; + timePeriod: number; + singleToMinLimit: string; + singleToMaxLimit: string; + dailyFromMinLimit: string; + dailyFromMaxLimit: string; + dailyToMinLimit: string; + dailyToMaxLimit: string; } ⋮---- -/** Campaign configuration ID, not a user reward-record ID. */ +export interface ConvertQuoteV5 { + quoteTxId: string; + exchangeRate: string; + fromCoin: string; + fromCoinType: string; + toCoin: string; + toCoinType: string; + fromAmount: string; + toAmount: string; + expiredTime: string; + requestId: string; + extTaxAndFee: string[]; +} ⋮---- -/** May be empty if task details cannot be assembled. */ +export interface ConvertStatusV5 { + accountType: string; + exchangeTxId: string; + userId: string; + fromCoin: string; + fromCoinType: string; + toCoin: string; + toCoinType: string; + fromAmount: string; + toAmount: string; + exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; + extInfo: { paramType: string; paramValue: string }; + convertRate: string; + createdAt: string; +} ⋮---- -export interface ReferralCampaignRewardsResultV5 { - /** - * Site referral rules. This does not indicate the tier matched by the - * current user. - */ - rebateRule: ReferralRebateRuleV5; - /** - * Campaign JSON strings, in base, fiat, then earn order when active. - * Parse each string as `ReferralCampaignTaskPayloadV5`. - */ - tasks: string[]; +export interface ConvertHistoryRecordV5 { + accountType: string; + exchangeTxId: string; + userId: string; + fromCoin: string; + fromCoinType: string; + toCoin: string; + toCoinType: string; + fromAmount: string; + toAmount: string; + exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; + extInfo: { paramType: string; paramValue: string }; + convertRate: string; + createdAt: string; } ⋮---- -/** - * Site referral rules. This does not indicate the tier matched by the - * current user. - */ +export interface SmallBalanceCoinV5 { + fromCoin: string; // Source currency + supportConvert: 1 | 2; // 1: support, 2: not supported + availableBalance: string; // Available balance + baseValue: string; // USDT equivalent value + toAmount: string; // Reserved field + exchangeRate: string; // Reserved field + feeInfo: null; // Reserved field + taxFeeInfo: null; // Reserved field +} ⋮---- -/** - * Campaign JSON strings, in base, fiat, then earn order when active. - * Parse each string as `ReferralCampaignTaskPayloadV5`. - */ +fromCoin: string; // Source currency +supportConvert: 1 | 2; // 1: support, 2: not supported +availableBalance: string; // Available balance +baseValue: string; // USDT equivalent value +toAmount: string; // Reserved field +exchangeRate: string; // Reserved field +feeInfo: null; // Reserved field +taxFeeInfo: null; // Reserved field ⋮---- -export interface ReferralCommissionInfoV5 { - totalCommission: string; - yesterdayCommission: string; - totalFriends: number; - /** Number of invitees eligible for commission. */ - qualifiedFriends: number; - walletBalance: string; - /** Current-quarter trading volume of qualified invitees. */ - qualifiedFriendsQuarterTotalTradeVolume: string; - /** - * Active invitees in the current quarter. May be `0` when the source - * value is `0`. - */ - curQuarterActiveFriendsCount: number; - /** Legacy referral-commission programme indicator. */ - hasOldReferral: number; - /** - * 0 unknown or not downgraded, 1 downgraded due to active invitee count, - * 2 downgraded due to invitee trading volume. - */ - degradeType: 0 | 1 | 2; - commissionRate: string; - /** 0 unknown, 1 upgraded, 2 upgrading, 3 not upgraded. */ - upgradeUnifiedAccount: 0 | 1 | 2 | 3; - /** - * 1 enabled, 2 disabled. May be `0` when the source value is `0`. - */ - withdrawalSwitch: 0 | 1 | 2; - /** - * Qualified invitees in the previous quarter. May be `0` when the source - * value is `0`. - */ - lastQuarterQualifiedFriendsCount: number; +export interface SmallBalanceListV5 { + smallAssetCoins: SmallBalanceCoinV5[]; // Small balance info + supportToCoins: string[]; // Supported target coins (e.g., ["MNT","USDT","USDC"]) } ⋮---- -/** Number of invitees eligible for commission. */ +smallAssetCoins: SmallBalanceCoinV5[]; // Small balance info +supportToCoins: string[]; // Supported target coins (e.g., ["MNT","USDT","USDC"]) ⋮---- -/** Current-quarter trading volume of qualified invitees. */ +export interface FiatCoinInfoV5 { + coin: string; // Fiat coin code + fullName: string; // Fiat full coin name + icon: string; // Coin icon url + iconNight: string; // Coin icon url (dark mode) + precision: number; // Fiat precision + disable: boolean; // true: the coin is disabled, false: the coin is allowed + singleFromMinLimit: string; // For buy side, minimum amount of fiatCoin per transaction + singleFromMaxLimit: string; // For buy side, maximum amount of fiatCoin per transaction +} ⋮---- -/** - * Active invitees in the current quarter. May be `0` when the source - * value is `0`. - */ +coin: string; // Fiat coin code +fullName: string; // Fiat full coin name +icon: string; // Coin icon url +iconNight: string; // Coin icon url (dark mode) +precision: number; // Fiat precision +disable: boolean; // true: the coin is disabled, false: the coin is allowed +singleFromMinLimit: string; // For buy side, minimum amount of fiatCoin per transaction +singleFromMaxLimit: string; // For buy side, maximum amount of fiatCoin per transaction ⋮---- -/** Legacy referral-commission programme indicator. */ +export interface CryptoCoinInfoV5 { + coin: string; // Crypto coin code + fullName: string; // Crypto full coin name + icon: string; // Coin icon url + iconNight: string; // Coin icon url (dark mode) + precision: number; // Crypto precision + disable: boolean; // true: the coin is disabled, false: the coin is allowed + singleFromMinLimit: string; // For sell side, minimum amount of cryptoCoin per transaction + singleFromMaxLimit: string; // For sell side, maximum amount of cryptoCoin per transaction +} ⋮---- -/** - * 0 unknown or not downgraded, 1 downgraded due to active invitee count, - * 2 downgraded due to invitee trading volume. - */ +coin: string; // Crypto coin code +fullName: string; // Crypto full coin name +icon: string; // Coin icon url +iconNight: string; // Coin icon url (dark mode) +precision: number; // Crypto precision +disable: boolean; // true: the coin is disabled, false: the coin is allowed +singleFromMinLimit: string; // For sell side, minimum amount of cryptoCoin per transaction +singleFromMaxLimit: string; // For sell side, maximum amount of cryptoCoin per transaction ⋮---- -/** 0 unknown, 1 upgraded, 2 upgrading, 3 not upgraded. */ +export interface FiatTradingPairListV5 { + fiats: FiatCoinInfoV5[]; // Fiat coin list + cryptos: CryptoCoinInfoV5[]; // Crypto coin list +} ⋮---- -/** - * 1 enabled, 2 disabled. May be `0` when the source value is `0`. - */ +fiats: FiatCoinInfoV5[]; // Fiat coin list +cryptos: CryptoCoinInfoV5[]; // Crypto coin list ⋮---- -/** - * Qualified invitees in the previous quarter. May be `0` when the source - * value is `0`. - */ +export interface FundingAccountTransactionRecordV5 { + memberId: string; + currency: string; + ioDirection: string; + txnAmt: string; + afterAmt: string; + createTime: string; + showBusiType: string; + showBusiTypeEn: string; + description: string; + descriptionEn: string; + currcCursor?: string; +} ⋮---- -export interface ReferralUserIdentityProfileV5 { - isAffiliate: boolean; - /** - * Whether the current user is an M1 inviter. Checked only when the user - * is not an affiliate. - */ - isM1: boolean; - /** - * Affiliate ID from the affiliate direct-customer relationship. `0` if - * none is found. - */ - inviterAffiliateId: number; - /** - * Relationship indicator: `1` when an affiliate direct-customer record - * exists, otherwise `0`. This is not the affiliate user's ID. - */ - inviterAffiliateUserId: number; - /** - * Relationship indicator: `1` when an invitation record exists for the - * current user as invitee, otherwise `0`. This is not the inviter's ID. - */ - inviterUserId: number; - /** - * Present only when an M1 inviter record matches the authenticated user - * and the commission query succeeds. - */ - commissionInfo?: ReferralCommissionInfoV5; +/** When accountType=Alpha and category is farm, under `coinDetail` in sub-categories. */ +export interface AssetOverviewCoinExtMapV5 { + priceUpper?: string; + priceLower?: string; + equityUnit?: string; } ⋮---- -/** - * Whether the current user is an M1 inviter. Checked only when the user - * is not an affiliate. - */ +export interface AssetOverviewCoinDetailV5 { + coin: string; + equity: string; + extMap?: AssetOverviewCoinExtMapV5; +} ⋮---- -/** - * Affiliate ID from the affiliate direct-customer relationship. `0` if - * none is found. - */ +export interface AssetOverviewCategoryV5 { + category: string; + equity: string; + coinDetail: AssetOverviewCoinDetailV5[]; +} ⋮---- -/** - * Relationship indicator: `1` when an affiliate direct-customer record - * exists, otherwise `0`. This is not the affiliate user's ID. - */ +export interface AssetOverviewAccountItemV5 { + accountType: string; + totalEquity: string; + valuationCurrency: string; + snapshotTime: string; + coinDetail?: AssetOverviewCoinDetailV5[]; + categories?: AssetOverviewCategoryV5[]; +} ⋮---- -/** - * Relationship indicator: `1` when an invitation record exists for the - * current user as invitee, otherwise `0`. This is not the inviter's ID. - */ +export interface AssetOverviewResultV5 { + totalEquity: string; + list: AssetOverviewAccountItemV5[]; +} ⋮---- -/** - * Present only when an M1 inviter record matches the authenticated user - * and the commission query succeeds. - */ +// --- GET /v5/asset/portfolio-margin (portfolio margin P&L ranges) --- ⋮---- -export interface ReferralUserInvitationRecordV5 { - /** Masked invitee ID. */ - userIdMask: string; - /** Invitee registration timestamp. */ - signTime: number; - userStatus: ReferralFriendStatusV5; - /** Total commission, at most eight decimal places. */ - totalCommission: string; - /** - * Unencrypted decimal invitee user ID. `userIdMask` is separate. The docs - * say to confirm that exposing this value is intended. - */ - userId: string; - taskProgress: string; - /** - * `true` for some new EU-site invitees and non-Boost JPN-site invitees. - * The Boost path leaves the default `false`. - */ - notShowCommission: boolean; - /** - * Not populated by the current endpoint. May be omitted, or `""`. - */ - totalBaseRewards?: string; +export interface PortfolioMarginWalletV5 { + equity: string; + cashBalance: string; + marginBalance: string; + availableBalance: string; + accountIM: string; + accountMM: string; + accountMMRate: string; + accountIMRate: string; } ⋮---- -/** Masked invitee ID. */ -⋮---- -/** Invitee registration timestamp. */ +export interface PortfolioMarginPnlRangePointV5 { + priceScale: string; + pnls: string[]; +} ⋮---- -/** Total commission, at most eight decimal places. */ +export interface PortfolioMarginContractBucketPnlV5 { + pnlRanges: PortfolioMarginPnlRangePointV5[]; +} ⋮---- -/** - * Unencrypted decimal invitee user ID. `userIdMask` is separate. The docs - * say to confirm that exposing this value is intended. - */ +export interface PortfolioMarginTotalPnlRangesV5 { + ALL?: PortfolioMarginContractBucketPnlV5; + PERPETUAL?: PortfolioMarginContractBucketPnlV5; + OPTION?: PortfolioMarginContractBucketPnlV5; +} ⋮---- -/** - * `true` for some new EU-site invitees and non-Boost JPN-site invitees. - * The Boost path leaves the default `false`. - */ +export interface PortfolioMarginPerpPositionPnlV5 { + symbolName: string; + position: string; + pnlRanges: PortfolioMarginPnlRangePointV5[]; + sessionAvgPrice: string; + markPrice: string; + orderSize: string; + contractType: number; + settleCoin: string; + symbolAlias?: string; +} ⋮---- -/** - * Not populated by the current endpoint. May be omitted, or `""`. - */ +export interface PortfolioMarginOptionPositionPnlV5 { + symbolName: string; + position: string; + pnlRanges: PortfolioMarginPnlRangePointV5[]; + sessionAvgPrice: string; + markPrice: string; + orderSize: string; + contractType: number; + settleCoin: string; +} ⋮---- -export interface ReferralUserInvitationsResultV5 { - records: ReferralUserInvitationRecordV5[]; - total: number; +export interface PortfolioMarginOptionExpiryPnlV5 { + expiryDateRepresentation: string; + pnlRanges: PortfolioMarginPnlRangePointV5[]; + optionPositionPnlRanges: PortfolioMarginOptionPositionPnlV5[]; } - -================ -File: src/types/websockets/ws-events.ts -================ -import WebSocket from 'isomorphic-ws'; ⋮---- -import { - RFQItemV5, - RFQPublicTradeV5, - RFQQuoteItemV5, - RFQTradeV5, -} from '../response/v5-rfq'; -import { - CategoryV5, - ExecTypeV5, - OCOTriggerTypeV5, - OrderCancelTypeV5, - OrderCreateTypeV5, - OrderRejectReasonV5, - OrderSideV5, - OrderSMPTypeV5, - OrderStatusV5, - OrderTimeInForceV5, - OrderTriggerByV5, - OrderTypeV5, - PositionIdx, - PositionSideV5, - PositionStatusV5, - StopOrderTypeV5, - SystemStatusItemV5, - TPSLModeV5, - TradeModeV5, -} from '../shared-v5'; -import { WsKey } from './ws-general'; +export interface PortfolioMarginContingencyV5 { + optionContingency: string; + futureDeltaContingency: string; + optionVegaContingency: string; + contingencyComponents: string; + usdtUsdcContingency: string; + futureContingency: string; +} ⋮---- -export interface MessageEventLike { - target: WebSocket; - type: 'message'; - data: string; +export interface PortfolioMarginAssetBlockV5 { + coin: string; + assetIM: string; + assetMM: string; } ⋮---- -export function isMessageEvent(msg: unknown): msg is MessageEventLike +export interface PortfolioMarginSpotHedgeInfoV5 { + hedgeSpotSize: string; + walletBalance: string; + usdIndexPrice: string; + pnlRanges: PortfolioMarginPnlRangePointV5[]; +} ⋮---- -export interface WSPublicTopicEventV5 { - id?: string; - topic: TTopic; - type: TType; - /** Cross sequence */ - cs?: number; - /** Event timestamp */ - ts: number; - data: TData; - /** - * matching engine timestamp (correlated with T from public trade channel) - */ - cts: number; - /** - * Internal reference, can be used to determine if this is spot/linear/inverse/etc - */ - wsKey: WsKey; +export interface PortfolioMarginByBaseCoinV5 { + baseCoin: string; + totalPnlRanges: PortfolioMarginTotalPnlRangesV5; + perpPositionPnlRanges: PortfolioMarginPerpPositionPnlV5[]; + optionExpiryDatePnlRanges: PortfolioMarginOptionExpiryPnlV5[]; + contingency: PortfolioMarginContingencyV5; + asset: PortfolioMarginAssetBlockV5; + maxLossPriceMove: string; + maxLossIvShock: string; + totalClosePzFee: string; + spotHedgeInfo: PortfolioMarginSpotHedgeInfoV5; + maxLossIvShockList: string[]; } ⋮---- -/** Cross sequence */ +export interface PortfolioMarginInfoResultV5 { + wallet: PortfolioMarginWalletV5; + assetPnlRange: PortfolioMarginByBaseCoinV5[]; +} ⋮---- -/** Event timestamp */ +// --- GET /v5/asset/total-members-assets --- ⋮---- -/** - * matching engine timestamp (correlated with T from public trade channel) - */ +export interface TotalMembersAccountBreakdownItemV5 { + type: string; + origb: string; + quoteb: string; + stat: number; +} ⋮---- -/** - * Internal reference, can be used to determine if this is spot/linear/inverse/etc - */ +export interface TotalMembersMemberEntryV5 { + uid: number; + isM?: boolean; + type?: number; + stat: number; + origb: string; + quoteb?: string; + items: TotalMembersAccountBreakdownItemV5[]; +} ⋮---- -export interface WSPrivateTopicEventV5 { - id?: string; - topic: TTopic; - creationTime: number; - data: TData; - wsKey: WsKey; +export interface TotalMembersAssetsResultV5 { + total: string; + quoteTotal: string; + stat: number; + list: TotalMembersMemberEntryV5[]; } + +================ +File: src/types/response/v5-user.ts +================ +import { + ReferralFriendStatusV5, + ReferralProductLineV5, +} from '../request/v5-user'; +import { PermissionsV5 } from '../shared-v5'; ⋮---- -export interface WSOrderbookV5 { - /** Symbol */ - s: string; - /** [price, qty][] */ - b: [string, string][]; - /** [price, qty][] */ - a: [string, string][]; - /** Update ID */ - u: number; - /** Cross sequence */ - seq: number; +export interface CreateSubMemberResultV5 { + uid: string; + username: string; + memberType: number; + status: number; + remark: string; } ⋮---- -/** Symbol */ -⋮---- -/** [price, qty][] */ +export interface CreateSubApiKeyResultV5 { + id: string; + note: string; + apiKey: string; + readOnly: number; + secret: string; + permissions: PermissionsV5; +} ⋮---- -/** [price, qty][] */ +export interface SubMemberV5 { + uid: string; + username: string; + memberType: number; + status: number; + accountMode: number; + remark: string; +} +export type ApiKeyType = 1 | 2; ⋮---- -/** Update ID */ +export interface ApiKeyPermissionsV5 { + ContractTrade: string[]; + Spot: string[]; + Wallet: string[]; + Options: string[]; + Derivatives: string[]; + CopyTrading: string[]; + BlockTrade: string[]; + Exchange: string[]; + NFT: string[]; + Affiliate: string[]; + Earn?: string[]; + FiatP2P?: string[]; + FiatBitPay?: string[]; + FiatConvertBroker?: string[]; + /** @deprecated */ + FiatGlobalPay?: string[]; + BitCard?: string[]; + ByXPost?: string[]; + /** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] when not granted */ + Compliance?: string[]; +} ⋮---- -/** Cross sequence */ +/** @deprecated */ ⋮---- -export type WSOrderbookEventV5 = WSPublicTopicEventV5< - string, - 'delta' | 'snapshot', - WSOrderbookV5 ->; +/** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] when not granted */ ⋮---- -export interface WSTradeV5 { - T: number; - s: string; - S: OrderSideV5; - v: string; - p: string; - L?: string; - i: string; - BT: boolean; - RPI?: boolean; - mP?: string; - iP?: string; - mIv?: string; - iv?: string; +export interface ApiKeyInfoV5 { + id: string; + note: string; + apiKey: string; + readOnly: 0 | 1; + secret: string; + permissions: ApiKeyPermissionsV5; + ips: string[]; + type: 1 | 2; // 1: personal, 2: connected to third-party app + deadlineDay: number; + expiredAt: string; + createdAt: string; + /** @deprecated */ + unified: number; + uta: 0 | 1; // 0: regular account, 1: unified trade account + userID: number; + inviterID: number; + vipLevel: string; + mktMakerLevel: string; + affiliateID: number; + rsaPublicKey: string; + isMaster: boolean; + parentUid: string; + kycLevel: 'LEVEL_DEFAULT' | 'LEVEL_1' | 'LEVEL_2'; + kycRegion: string; + isFixApi?: boolean; } ⋮---- -export type WSTradeEventV5 = WSPublicTopicEventV5< - string, - 'snapshot', - WSTradeV5[] ->; +type: 1 | 2; // 1: personal, 2: connected to third-party app ⋮---- -export interface WSEventOrderbookV5 { - s: string; - r: [string, string][]; - u: number; - seq: number; -} +/** @deprecated */ ⋮---- -export type WSEventOrderbookEventV5 = WSPublicTopicEventV5< - string, - 'delta' | 'snapshot', - WSEventOrderbookV5 ->; +uta: 0 | 1; // 0: regular account, 1: unified trade account ⋮---- -export interface WSEventPublicTradeV5 { - T: number; - s: string; - r: string; - a: string; - i: string; - seq: number; +export interface UpdateApiKeyResultV5 { + id: string; + note: string; + apiKey: string; + readOnly: 0 | 1; + secret: string; + permissions: PermissionsV5; + ips: string[]; } ⋮---- -export type WSEventPublicTradeEventV5 = WSPublicTopicEventV5< - string, - 'snapshot', - WSEventPublicTradeV5[] ->; -⋮---- -/** - * WSTickerV5 is the data structure for the "linear" ticker channel - * */ -export interface WSTickerV5 { - symbol: string; - tickDirection: string; - price24hPcnt: string; - lastPrice: string; - prevPrice24h: string; - highPrice24h: string; - lowPrice24h: string; - prevPrice1h: string; - markPrice: string; - indexPrice: string; - openInterest: string; - openInterestValue: string; - singleOpenInterest?: string; - singleOpenInterestValue?: string; - turnover24h: string; - volume24h: string; - nextFundingTime: string; - fundingRate: string; - bid1Price: string; - bid1Size: string; - ask1Price: string; - ask1Size: string; - deliveryTime?: string; - basisRate?: string; - deliveryFeeRate?: string; - predictedDeliveryPrice?: string; - preOpenPrice?: string; - preQty?: string; - curPreListingPhase?: string; - fundingIntervalHour?: string; - fundingCap?: string; - basisRateYear?: string; +export interface SubAccountAllApiKeysResultV5 { + result: { + id: string; + ips?: string[]; + apiKey: string; + note: string; + status: number; + expiredAt?: string; + createdAt: string; + type: ApiKeyType; + permissions: PermissionsV5; + secret: string; + readOnly: 0 | 1; + deadlineDay?: number; + flag: string; + }[]; + nextPageCursor: string; } ⋮---- -export interface WSTickerOptionV5 { - symbol: string; - bidPrice: string; - bidSize: string; - bidIv: string; - askPrice: string; - askSize: string; - askIv: string; - lastPrice: string; - highPrice24h: string; - lowPrice24h: string; - markPrice: string; - indexPrice: string; - markPriceIv: string; - underlyingPrice: string; - openInterest: string; - turnover24h: string; - volume24h: string; - totalVolume: string; - totalTurnover: string; - delta: string; - gamma: string; - vega: string; - theta: string; - predictedDeliveryPrice: string; - change24h: string; +export interface AffiliateUserListItemV5 { + userId: string; + registerTime: string; + source: string; + remarks: string; + isKyc: boolean; + takerVol30Day: string; + makerVol30Day: string; + tradeVol30Day: string; + depositAmount30Day: string; + takerVol365Day: string; + makerVol365Day: string; + tradeVol365Day: string; + depositAmount365Day: string; + takerVol: string; + makerVol: string; + tradeVol: string; + startDate: string; + endDate: string; + /** tradfi trade volume in [startDate, endDate] when startDate/endDate in params */ + tradfiTradeVol?: string; + /** tradfi trade volume in last 30 days. 0 when startDate/endDate in params */ + tradfiTradeVol30Day?: string; + /** tradfi trade volume in past year. 0 when startDate/endDate in params */ + tradfiTradeVol365Day?: string; + /** Commission between startDate and endDate when startDate/endDate in params. Coin -> amount */ + commissionsVol?: Record; + /** Commission in last 30 days. Coin -> amount */ + commissions30Day?: Record; + /** Commission in past year. Coin -> amount */ + commissions365Day?: Record; } ⋮---- -export interface WSTickerSpotV5 { - symbol: string; - lastPrice: string; - highPrice24h: string; - lowPrice24h: string; - prevPrice24h: string; - volume24h: string; - turnover24h: string; - price24hPcnt: string; - usdIndexPrice: string; -} +/** tradfi trade volume in [startDate, endDate] when startDate/endDate in params */ ⋮---- -export type WSTickerEventV5 = WSPublicTopicEventV5< - string, - 'snapshot' | 'delta', - WSTickerV5 | WSTickerOptionV5 | WSTickerSpotV5 ->; +/** tradfi trade volume in last 30 days. 0 when startDate/endDate in params */ ⋮---- -export interface WSKlineV5 { - start: number; - end: number; - interval: string; - open: string; - close: string; - high: string; - low: string; - volume: string; - turnover: string; - confirm: boolean; - timestamp: number; -} +/** tradfi trade volume in past year. 0 when startDate/endDate in params */ ⋮---- -export type WSKlineEventV5 = WSPublicTopicEventV5< - string, - 'snapshot', - WSKlineV5[] ->; +/** Commission between startDate and endDate when startDate/endDate in params. Coin -> amount */ ⋮---- -export interface WSLiquidationV5 { - T: number; - s: string; - S: OrderSideV5; - v: string; - p: string; +/** Commission in last 30 days. Coin -> amount */ +⋮---- +/** Commission in past year. Coin -> amount */ +⋮---- +export interface AffiliateUserInfoV5 { + uid: string; + vipLevel: string; + takerVol30Day: string; + makerVol30Day: string; + tradeVol30Day: string; + depositAmount30Day: string; + takerVol365Day: string; + makerVol365Day: string; + tradeVol365Day: string; + depositAmount365Day: string; + totalWalletBalance: '1' | '2' | '3' | '4'; + depositUpdateTime: string; + volUpdateTime: string; + KycLevel: 0 | 1 | 2; + /** tradfi trade volume in last 30 days (USDT) */ + tradfiTradeVol30Day?: string; + /** tradfi trade volume in past year (USDT) */ + tradfiTradeVol365Day?: string; + /** tradfi commissions in last 30 days. Coin -> amount */ + commissions30Day?: Record; + /** tradfi commissions in past year. Coin -> amount */ + commissions365Day?: Record; + /** Payment amount in the last 30 days */ + paySendAmount30Day: string; + /** Pay first transaction amount */ + payFtt: string; + /** Card first-time transaction amount */ + cardFtt: string; } ⋮---- -export type WSLiquidationEventV5 = WSPublicTopicEventV5< - string, - 'snapshot', - WSLiquidationV5[] ->; +/** tradfi trade volume in last 30 days (USDT) */ ⋮---- -export interface WSPositionV5 { - category: string; - symbol: string; - side: PositionSideV5; - size: string; - positionIdx: PositionIdx; - tradeMode: TradeModeV5; - positionValue: string; - riskId: number; - riskLimitValue: string; - entryPrice: string; - markPrice: string; - leverage: string; - breakEvenPrice?: string; // Break even price, only for linear & inverse - positionBalance: string; - autoAddMargin: number; - positionMM: string; - positionIM: string; - positionIMByMp: string; - positionMMByMp: string; - liqPrice: string; - bustPrice: string; - tpslMode: string; - takeProfit: string; - stopLoss: string; - trailingStop: string; - unrealisedPnl: string; - curRealisedPnl: string; - sessionAvgPrice: string; - delta: string; - gamma: string; - vega: string; - theta: string; - cumRealisedPnl: string; - positionStatus: PositionStatusV5; - adlRankIndicator: number; - isReduceOnly: boolean; - mmrSysUpdatedTime: string; - leverageSysUpdatedTime: string; - createdTime: string; - updatedTime: string; - /** Position open timestamp (ms). Default `0` when not set. */ - openTime: number; - seq: number; - netDeltaRatio?: string; +/** tradfi trade volume in past year (USDT) */ +⋮---- +/** tradfi commissions in last 30 days. Coin -> amount */ +⋮---- +/** tradfi commissions in past year. Coin -> amount */ +⋮---- +/** Payment amount in the last 30 days */ +⋮---- +/** Pay first transaction amount */ +⋮---- +/** Card first-time transaction amount */ +⋮---- +export interface AffiliateSubAffiliateListItemV5 { + subAffId: string; + userId: string; + name: string; + email: string; + /** Commission per currency (BTC, ETH, MNT, USDC, USDT) for the queried date range */ + commissionsVol: Record; + commissionsForUsdt: string; + becameAffTime: string; + startDate: string; + endDate: string; } ⋮---- -breakEvenPrice?: string; // Break even price, only for linear & inverse +/** Commission per currency (BTC, ETH, MNT, USDC, USDT) for the queried date range */ ⋮---- -/** Position open timestamp (ms). Default `0` when not set. */ +export interface AffiliateSubAffiliateListResultV5 { + list: AffiliateSubAffiliateListItemV5[]; + nextPageCursor: string; +} ⋮---- -export type WSPositionEventV5 = WSPrivateTopicEventV5< - 'position', - WSPositionV5[] ->; +export interface FriendReferralRecordV5 { + id: string; + inviteeUid: string; + status: number; + createdAt: string; + updatedAt: string; +} ⋮---- -export interface WSEventPositionV5 { - symbol: string; - baseCoin: string; - settleCoin: string; - side: string; - ecContractType: string; - ecDirection: string; - avgPayoutRatio: string; - positionValue: string; - ecSettleTime: string; - cumClosedPnl: string; - createdTime: string; - updatedTime: string; - seq: number; +export interface ReferralCodeItemV5 { + referralCode: string; + referralLink: string; + scene: number; } ⋮---- -export type WSEventPositionEventV5 = WSPrivateTopicEventV5< - 'position.event', - WSEventPositionV5[] ->; +export interface ReferralCodesResultV5 { + referralCodes: ReferralCodeItemV5[]; +} ⋮---- -export interface WSAccountOrderV5 { - category: CategoryV5; - orderId: string; - orderLinkId: string; - parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) - isLeverage: string; - blockTradeId: string; - symbol: string; - price: string; - qty: string; - side: OrderSideV5; - positionIdx: PositionIdx; - orderStatus: OrderStatusV5; - createType: OrderCreateTypeV5; - cancelType: OrderCancelTypeV5; - rejectReason?: OrderRejectReasonV5; - avgPrice?: string; - leavesQty?: string; - leavesValue?: string; - cumExecQty: string; - cumExecValue: string; - cumExecFee: string; - closedPnl: string; - feeCurrency: string; - timeInForce: OrderTimeInForceV5; - orderType: OrderTypeV5; - stopOrderType: StopOrderTypeV5; - ocoTriggerType?: OCOTriggerTypeV5; - orderIv: string; - marketUnit?: 'baseCoin' | 'quoteCoin'; - triggerPrice: string; - takeProfit: string; - stopLoss: string; - tpslMode?: TPSLModeV5; - tpLimitPrice?: string; - slLimitPrice?: string; - tpTriggerBy: string; - slTriggerBy: string; - triggerDirection: number; - triggerBy: OrderTriggerByV5; - lastPriceOnCreated: string; - reduceOnly: boolean; - closeOnTrigger: boolean; - placeType: string; - smpType: OrderSMPTypeV5; - smpGroup: string; - smpOrderId: string; - createdTime: string; - updatedTime: string; - cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency - rpiTakerAccess?: boolean; - rpiMatchedQty?: string; +/** 0 unknown, 1 awaiting credit, 2 settled. Unrecognized values are returned as 0. */ +export type ReferralCommissionStatusV5 = 0 | 1 | 2; +⋮---- +export interface ReferralCommissionRecordV5 { + /** Masked invitee ID: first character + `***` + last character. */ + userId: string; + /** Commission payment time, Unix seconds. */ + paymentTime: number; + /** Commission rate. */ + rate: string; + businessUnit: ReferralProductLineV5; + commissionOriginCoin: string; + /** Commission amount in the original currency. */ + commissionOriginAmount: string; + /** Commission value in USDT. */ + commissionUsdtAmount: string; + commissionStatus: ReferralCommissionStatusV5; + /** + * Whether the invitee is a Boost user. May be omitted. + */ + isBoostM2?: boolean; } ⋮---- -parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) +/** Masked invitee ID: first character + `***` + last character. */ ⋮---- -cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +/** Commission payment time, Unix seconds. */ ⋮---- -export type WSAccountOrderEventV5 = WSPrivateTopicEventV5< - 'order', - WSAccountOrderV5[] ->; +/** Commission rate. */ ⋮---- -export interface WSEventOrderV5 { - category: 'event' | string; - orderId: string; - orderLinkId: string; - symbol: string; - symbolId: number; - side: string; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - orderStatus: string; - ecContractType: string; - ecDirection: string; - ecDurationWindow: number; - ecTargetPrice: string; - ecLowerBound: string; - ecUpperBound: string; - ecOrderValue: string; - ecIndexPrice: string; - ecSettleTime: string; - payoutRatio: string; - orderAvgPayoutRatio: string; - cumExecValue: string; - cumExecFee: string; - leavesValue: string; - cumPayout: string; - createType: number; - cancelType: string; - rejectReason: string; - extraFees: unknown[]; - transTime: string; - createdTime: string; - updatedTime: string; -} +/** Commission amount in the original currency. */ ⋮---- -export type WSEventOrderEventV5 = WSPrivateTopicEventV5< - 'order' | 'order.event', - WSEventOrderV5[] ->; +/** Commission value in USDT. */ ⋮---- -export interface WSExecutionV5 { - category: CategoryV5; - symbol: string; - isLeverage: string; - orderId: string; - orderLinkId: string; - side: OrderSideV5; - orderPrice: string; - orderQty: string; - leavesQty: string; - createType: OrderCreateTypeV5; - orderType: OrderTypeV5; - stopOrderType: StopOrderTypeV5; - execFee: string; - feeCurrency: string; // Trading fee currency - execId: string; - execPrice: string; - execQty: string; - execPnl: string; - execType: ExecTypeV5; - execValue: string; - execTime: string; - isMaker: boolean; - feeRate: string; - tradeIv: string; - markIv: string; - markPrice: string; - indexPrice: string; - underlyingPrice: string; - blockTradeId: string; - closedSize: string; - extraFees: string; - seq: number; - marketUnit: string; +/** + * Whether the invitee is a Boost user. May be omitted. + */ +⋮---- +export interface ReferralCommissionRecordsResultV5 { + records: ReferralCommissionRecordV5[]; + total: number; } ⋮---- -feeCurrency: string; // Trading fee currency +export interface ReferralRebateRatioRuleV5 { + /** Referral commission rate, from 0 to 100. */ + rebateRatio: number; + /** Required number of qualified invitees. */ + referralCount: number; + /** Whether the tier requires trading volume. */ + hasTradeCondition: boolean; + /** Trading-volume threshold for the tier. */ + tradeAmountCondition: number; +} ⋮---- -export type WSExecutionEventV5 = WSPrivateTopicEventV5< - 'execution', - WSExecutionV5[] ->; +/** Referral commission rate, from 0 to 100. */ ⋮---- -export interface WSEventExecutionV5 { - category: 'event' | string; - transId: string; - execId: string; - orderId: string; - orderLinkId: string; - symbol: string; - symbolId: number; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - side: string; - feeCoin: string; - execType: string; - execPrice: string; - execValue: string; - execFee: string; - execFeeRate: string; - orderPrice: string; - ecContractType: number | string; - ecDirection: number | string; - ecDurationWindow: number; - ecTargetPrice: string; - ecLowerBound: string; - ecUpperBound: string; - ecOrderValue: string; - ecIndexPrice?: string; - ecPayout: string; - entryPrice: string; - settlePrice: string; - grossPayoutRatio: string; - sessionRpl: string; - transTime: string; - settleTimeMs: string; - crossSeq: string; - timeInForce: string; - extraFees: unknown[]; +/** Required number of qualified invitees. */ +⋮---- +/** Whether the tier requires trading volume. */ +⋮---- +/** Trading-volume threshold for the tier. */ +⋮---- +export interface ReferralRebateRuleV5 { + /** Deposit threshold. Currency and precision are not specified. */ + depositAmount: number; + /** Trading threshold. Currency and precision are not specified. */ + tradeAmount: number; + rebateRatioRules: ReferralRebateRatioRuleV5[]; + /** Number of days that the referral commission lasts. */ + rebateDurationDays: number; + /** + * Currently not populated. A default of `0` does not confirm a threshold. + */ + tradefiDepositAmount?: number; + /** + * Currently not populated. A default of `0` does not confirm a threshold. + */ + tradefiTradeAmount?: number; } ⋮---- -export type WSEventExecutionEventV5 = WSPrivateTopicEventV5< - 'execution' | 'execution.event', - WSEventExecutionV5[] ->; +/** Deposit threshold. Currency and precision are not specified. */ ⋮---- -export interface WSExecutionFastV5 { - category: CategoryV5; - symbol: string; - execId: string; - execPrice: string; - execQty: string; - orderId: string; - isMaker: boolean; - orderLinkId: string; - side: OrderSideV5; - execTime: string; - seq: number; - liquidity?: string; +/** Trading threshold. Currency and precision are not specified. */ +⋮---- +/** Number of days that the referral commission lasts. */ +⋮---- +/** + * Currently not populated. A default of `0` does not confirm a threshold. + */ +⋮---- +/** + * Currently not populated. A default of `0` does not confirm a threshold. + */ +⋮---- +/** + * Task reward type. See Bybit enum `awardType`. + * `100` loads reward-packet details. Types `95` and `97` do not currently + * include assembled reward details. + */ +export type ReferralAwardTypeV5 = + | 0 + | 1 + | 2 + | 3 + | 4 + | 5 + | 6 + | 7 + | 8 + | 9 + | 10 + | 11 + | 12 + | 13 + | 14 + | 15 + | 16 + | 17 + | 18 + | 19 + | 95 + | 96 + | 97 + | 98 + | 99 + | 100; +⋮---- +export interface ReferralCampaignAwardV5 { + /** Regular reward ID or reward packet ID. */ + id: number; + /** + * English reward name. Reward packets use `UP TO ` or + * `EARN `. + */ + name: string; + /** English reward type. Always `Packet` for reward packets. */ + type: string; + /** English product type. Empty for reward packets. */ + productLine: string; + /** UTC RFC 3339. Empty when unavailable or for reward packets. */ + startTime: string; + /** UTC RFC 3339. Empty when unavailable. */ + endTime: string; } ⋮---- -export type WSExecutionFastEventV5 = WSPrivateTopicEventV5< - 'execution.fast', - WSExecutionFastV5[] ->; +/** Regular reward ID or reward packet ID. */ ⋮---- -export interface WSCoinV5 { - coin: string; - equity: string; - usdValue: string; - walletBalance: string; - free?: string; - locked: string; - spotHedgingQty: string; - borrowAmount: string; - availableToBorrow: string; - availableToWithdraw: string; - accruedInterest: string; - totalOrderIM: string; - totalPositionIM: string; - totalPositionMM: string; - unrealisedPnl: string; - cumRealisedPnl: string; - bonus: string; - collateralSwitch: boolean; - marginCollateral: boolean; - spotBorrow: string; - colRes?: string; -} +/** + * English reward name. Reward packets use `UP TO ` or + * `EARN `. + */ ⋮---- -export interface WSWalletV5 { - accountType: string; - accountLTV: string; - accountIMRate: string; - accountMMRate: string; - accountIMRateByMp: string; - accountMMRateByMp: string; - totalInitialMarginByMp: string; - totalMaintenanceMarginByMp: string; - totalEquity: string; - totalWalletBalance: string; - totalMarginBalance: string; - totalAvailableBalance: string; - totalPerpUPL: string; - totalInitialMargin: string; - totalMaintenanceMargin: string; - coin: WSCoinV5[]; -} +/** English reward type. Always `Packet` for reward packets. */ ⋮---- -export type WSWalletEventV5 = WSPrivateTopicEventV5<'wallet', WSWalletV5[]>; +/** English product type. Empty for reward packets. */ ⋮---- -export interface WSGreeksV5 { - baseCoin: string; - totalDelta: string; - totalGamma: string; - totalVega: string; - totalTheta: string; -} +/** UTC RFC 3339. Empty when unavailable or for reward packets. */ ⋮---- -export type WSGreeksEventV5 = WSPrivateTopicEventV5<'greeks', WSGreeksV5[]>; +/** UTC RFC 3339. Empty when unavailable. */ ⋮---- -export interface WSSpreadOrderV5 { - category: 'combination' | 'spot_leg' | 'future_leg'; - symbol: string; - parentOrderId: string; - orderId: string; - orderLinkId: string; - side: OrderSideV5; - orderStatus: OrderStatusV5; - cancelType: OrderCancelTypeV5; - rejectReason: OrderRejectReasonV5; - timeInForce: OrderTimeInForceV5; - price: string; - qty: string; - avgPrice: string; - leavesQty: string; - leavesValue: string; - cumExecQty: string; - cumExecValue: string; - cumExecFee: string; - orderType: OrderTypeV5; - isLeverage: string; - createdTime: string; - updatedTime: string; - feeCurrency: string; - createType: OrderCreateTypeV5; - closedPnl: string; - cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +/** One configured task inside a parsed campaign JSON string. */ +export interface ReferralCampaignTaskItemV5 { + id: number; + awardType: ReferralAwardTypeV5; + /** English title of each valid rule. `null` when there are no valid rules. */ + ruleTitle: string[] | null; + /** English description of each valid rule. Same index as `ruleTitle`. */ + ruleDescription: string[] | null; + /** First parameter of each valid rule. Same index as `ruleTitle`. */ + ruleParam: string[] | null; + taskAwards: ReferralCampaignAwardV5[]; + /** M1 rewards with `UserRelateType=REFERRAL`. */ + m1Awards: ReferralCampaignAwardV5[]; } ⋮---- -cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +/** English title of each valid rule. `null` when there are no valid rules. */ ⋮---- -export type WSSpreadOrderEventV5 = WSPrivateTopicEventV5< - 'spread.order', - WSSpreadOrderV5[] ->; +/** English description of each valid rule. Same index as `ruleTitle`. */ ⋮---- -export interface WSSpreadExecutionV5 { - category: 'combination' | 'spot_leg' | 'future_leg'; - symbol: string; - isLeverage: string; - orderId: string; - orderLinkId: string; - side: OrderSideV5; - orderPrice: string; - orderQty: string; - leavesQty: string; - createType: OrderCreateTypeV5; - orderType: OrderTypeV5; - execFee: string; - execFeeV2: string; - feeCurrency: string; // Trading fee currency - parentExecId: string; - execId: string; - execPrice: string; - execQty: string; - execPnl: string; - execType: ExecTypeV5; - execValue: string; - execTime: string; - isMaker: boolean; - feeRate: string; - markPrice: string; - closedSize: string; - seq: number; +/** First parameter of each valid rule. Same index as `ruleTitle`. */ +⋮---- +/** M1 rewards with `UserRelateType=REFERRAL`. */ +⋮---- +/** + * Parsed shape of one `ReferralCampaignRewardsResultV5.tasks` string. + * `schemaVersion` is `2`. This is campaign configuration, not the user's + * task progress or a claimed reward. + */ +export interface ReferralCampaignTaskPayloadV5 { + schemaVersion: 2; + source: 'base' | 'fiat' | 'earn'; + /** Campaign configuration ID, not a user reward-record ID. */ + campaignId: string; + /** May be empty if task details cannot be assembled. */ + tasks: ReferralCampaignTaskItemV5[]; } ⋮---- -feeCurrency: string; // Trading fee currency +/** Campaign configuration ID, not a user reward-record ID. */ ⋮---- -export type WSSpreadExecutionEventV5 = WSPrivateTopicEventV5< - 'spread.execution', - WSSpreadExecutionV5[] ->; +/** May be empty if task details cannot be assembled. */ ⋮---- -export interface WSInsuranceV5 { - coin: string; - symbols: string; - balance: string; - updateTime: string; +export interface ReferralCampaignRewardsResultV5 { + /** + * Site referral rules. This does not indicate the tier matched by the + * current user. + */ + rebateRule: ReferralRebateRuleV5; + /** + * Campaign JSON strings, in base, fiat, then earn order when active. + * Parse each string as `ReferralCampaignTaskPayloadV5`. + */ + tasks: string[]; } ⋮---- -export type WSInsuranceEventV5 = WSPublicTopicEventV5< - 'insurance.USDT' | 'insurance.USDC' | 'insurance.inverse', - 'snapshot' | 'delta', - WSInsuranceV5[] ->; +/** + * Site referral rules. This does not indicate the tier matched by the + * current user. + */ ⋮---- -export interface WSPriceLimitV5 { - symbol: string; - buyLmt: string; - sellLmt: string; +/** + * Campaign JSON strings, in base, fiat, then earn order when active. + * Parse each string as `ReferralCampaignTaskPayloadV5`. + */ +⋮---- +export interface ReferralCommissionInfoV5 { + totalCommission: string; + yesterdayCommission: string; + totalFriends: number; + /** Number of invitees eligible for commission. */ + qualifiedFriends: number; + walletBalance: string; + /** Current-quarter trading volume of qualified invitees. */ + qualifiedFriendsQuarterTotalTradeVolume: string; + /** + * Active invitees in the current quarter. May be `0` when the source + * value is `0`. + */ + curQuarterActiveFriendsCount: number; + /** Legacy referral-commission programme indicator. */ + hasOldReferral: number; + /** + * 0 unknown or not downgraded, 1 downgraded due to active invitee count, + * 2 downgraded due to invitee trading volume. + */ + degradeType: 0 | 1 | 2; + commissionRate: string; + /** 0 unknown, 1 upgraded, 2 upgrading, 3 not upgraded. */ + upgradeUnifiedAccount: 0 | 1 | 2 | 3; + /** + * 1 enabled, 2 disabled. May be `0` when the source value is `0`. + */ + withdrawalSwitch: 0 | 1 | 2; + /** + * Qualified invitees in the previous quarter. May be `0` when the source + * value is `0`. + */ + lastQuarterQualifiedFriendsCount: number; } ⋮---- -export type WSPriceLimitEventV5 = WSPublicTopicEventV5< - string, - 'snapshot', - WSPriceLimitV5 ->; +/** Number of invitees eligible for commission. */ ⋮---- -export interface WSADLAlertV5 { - c: string; // Token of the insurance pool - s: string; // Trading pair name - b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) - mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours - i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL - pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped - adl_tt: string; // Trigger threshold for contract PnL drawdown ADL - adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL -} +/** Current-quarter trading volume of qualified invitees. */ +⋮---- +/** + * Active invitees in the current quarter. May be `0` when the source + * value is `0`. + */ ⋮---- -c: string; // Token of the insurance pool -s: string; // Trading pair name -b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) -mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours -i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL -pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped -adl_tt: string; // Trigger threshold for contract PnL drawdown ADL -adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL +/** Legacy referral-commission programme indicator. */ ⋮---- -export type WSADLAlertEventV5 = WSPublicTopicEventV5< - 'adlAlert.USDT' | 'adlAlert.USDC' | 'adlAlert.inverse', - 'snapshot', - WSADLAlertV5[] ->; +/** + * 0 unknown or not downgraded, 1 downgraded due to active invitee count, + * 2 downgraded due to invitee trading volume. + */ ⋮---- -export type WSSystemStatusEventV5 = WSPublicTopicEventV5< - 'system.status', - 'snapshot', - SystemStatusItemV5[] ->; +/** 0 unknown, 1 upgraded, 2 upgrading, 3 not upgraded. */ ⋮---- /** - * RFQ WebSocket Events - */ + * 1 enabled, 2 disabled. May be `0` when the source value is `0`. + */ ⋮---- /** - * RFQ Inquiry Channel - * Private push for RFQ inquiries sent or received by the user - * Topics: rfq.open.rfqs, rfq.site.rfqs - */ -export type WSRFQInquiryEventV5 = WSPrivateTopicEventV5< - 'rfq.open.rfqs' | 'rfq.site.rfqs', - RFQItemV5[] ->; + * Qualified invitees in the previous quarter. May be `0` when the source + * value is `0`. + */ +⋮---- +export interface ReferralUserIdentityProfileV5 { + isAffiliate: boolean; + /** + * Whether the current user is an M1 inviter. Checked only when the user + * is not an affiliate. + */ + isM1: boolean; + /** + * Affiliate ID from the affiliate direct-customer relationship. `0` if + * none is found. + */ + inviterAffiliateId: number; + /** + * Relationship indicator: `1` when an affiliate direct-customer record + * exists, otherwise `0`. This is not the affiliate user's ID. + */ + inviterAffiliateUserId: number; + /** + * Relationship indicator: `1` when an invitation record exists for the + * current user as invitee, otherwise `0`. This is not the inviter's ID. + */ + inviterUserId: number; + /** + * Present only when an M1 inviter record matches the authenticated user + * and the commission query succeeds. + */ + commissionInfo?: ReferralCommissionInfoV5; +} ⋮---- /** - * RFQ Quote Channel - * Private push for quotes sent or received by the user - * Topics: rfq.open.quotes, rfq.site.quotes - */ -export type WSRFQQuoteEventV5 = WSPrivateTopicEventV5< - 'rfq.open.quotes' | 'rfq.site.quotes', - RFQQuoteItemV5[] ->; + * Whether the current user is an M1 inviter. Checked only when the user + * is not an affiliate. + */ ⋮---- /** - * RFQ Trade Channel - * Private push for block trades executed by the user - * Topics: rfq.open.trades, rfq.site.trades - */ -export type WSRFQTradeEventV5 = WSPrivateTopicEventV5< - 'rfq.open.trades' | 'rfq.site.trades', - RFQTradeV5[] ->; + * Affiliate ID from the affiliate direct-customer relationship. `0` if + * none is found. + */ ⋮---- /** - * RFQ Public Trade Channel - * Public push for all block trades - * Topics: rfq.open.public.trades, rfq.site.public.trades - */ -export type WSRFQPublicTradeEventV5 = WSPublicTopicEventV5< - 'rfq.open.public.trades' | 'rfq.site.public.trades', - 'snapshot', - RFQPublicTradeV5[] ->; - -================ -File: src/types/request/index.ts -================ - - -================ -File: src/types/response/index.ts -================ - - -================ -File: src/types/shared-v5.ts -================ -export type CategoryV5 = 'spot' | 'linear' | 'inverse' | 'option'; -/** Public WS subscribe/routing category. Event Contract uses `'event'`; REST `CategoryV5` does not. */ -export type WSCategoryV5 = CategoryV5 | 'event'; -export type ContractTypeV5 = - | 'InversePerpetual' - | 'LinearPerpetual' - | 'InverseFutures'; -export type CopyTradingV5 = 'none' | 'both' | 'utaOnly' | 'normalOnly'; + * Relationship indicator: `1` when an affiliate direct-customer record + * exists, otherwise `0`. This is not the affiliate user's ID. + */ ⋮---- -export type InstrumentStatusV5 = - | 'PreLaunch' - | 'PendingOpen' - | 'Trading' - | 'Settling' - | 'Delivering' - | 'Closed'; +/** + * Relationship indicator: `1` when an invitation record exists for the + * current user as invitee, otherwise `0`. This is not the inviter's ID. + */ ⋮---- /** - * Region / product class returned as `symbolType` on instruments-info (and account instruments-info). - * For `category=linear`, includes e.g. `stock`, `forex`, `commodity`, `xstocks`. Spot may return `''`. - */ -export type InstrumentSymbolTypeV5 = - | '' - | 'stock' - | 'forex' - | 'commodity' - | 'xstocks'; + * Present only when an M1 inviter record matches the authenticated user + * and the commission query succeeds. + */ ⋮---- -export type MarginTradingV5 = 'none' | 'both' | 'utaOnly' | 'normalSpotOnly'; +export interface ReferralUserInvitationRecordV5 { + /** Masked invitee ID. */ + userIdMask: string; + /** Invitee registration timestamp. */ + signTime: number; + userStatus: ReferralFriendStatusV5; + /** Total commission, at most eight decimal places. */ + totalCommission: string; + /** + * Unencrypted decimal invitee user ID. `userIdMask` is separate. The docs + * say to confirm that exposing this value is intended. + */ + userId: string; + taskProgress: string; + /** + * `true` for some new EU-site invitees and non-Boost JPN-site invitees. + * The Boost path leaves the default `false`. + */ + notShowCommission: boolean; + /** + * Not populated by the current endpoint. May be omitted, or `""`. + */ + totalBaseRewards?: string; +} ⋮---- -/** Product type for strategy APIs (create / list). */ -export type StrategyCategoryV5 = - | 'UTA_USDT' - | 'UTA_USDC' - | 'UTA_USDC_FUTURE' - | 'UTA_SPOT' - | 'UTA_INVERSE' - | 'UTA_INVERSE_FUTURE' - | 'UTA_USDT_FUTURE'; +/** Masked invitee ID. */ ⋮---- -export type StrategyTypeV5 = 'twap' | 'chaseOrder' | 'iceberg' | 'pov'; +/** Invitee registration timestamp. */ ⋮---- -export type StrategyPreferV5 = - | 'limit' - | 'priceSpeedBalance' - | 'fastestExecution' - | 'quickExecution'; +/** Total commission, at most eight decimal places. */ ⋮---- -/** POV strategy execution mode */ -export type PovModeV5 = - | 'TradedVolume' - | 'OppositeSideLiquidity' - | 'SameSideLiquidity'; +/** + * Unencrypted decimal invitee user ID. `userIdMask` is separate. The docs + * say to confirm that exposing this value is intended. + */ ⋮---- -export type OrderFilterV5 = 'Order' | 'tpslOrder' | 'StopOrder'; -export type OrderSideV5 = 'Buy' | 'Sell'; -export type OrderTypeV5 = 'Market' | 'Limit'; -export type OrderTimeInForceV5 = 'GTC' | 'IOC' | 'FOK' | 'PostOnly' | 'RPI'; -export type OrderTriggerByV5 = 'LastPrice' | 'IndexPrice' | 'MarkPrice'; -export type OCOTriggerTypeV5 = - | 'OcoTriggerByUnknown' - | 'OcoTriggerTp' - | 'OcoTriggerBySl'; +/** + * `true` for some new EU-site invitees and non-Boost JPN-site invitees. + * The Boost path leaves the default `false`. + */ ⋮---- -export type OrderSMPTypeV5 = - | 'None' - | 'CancelMaker' - | 'CancelTaker' - | 'CancelBoth'; +/** + * Not populated by the current endpoint. May be omitted, or `""`. + */ ⋮---- -export type OrderStatusV5 = - | 'Created' - | 'New' - | 'Rejected' - | 'PartiallyFilled' - | 'PartiallyFilledCanceled' - | 'Filled' - | 'Cancelled' - | 'Untriggered' - | 'Triggered' - | 'Deactivated' - | 'Active'; +export interface ReferralUserInvitationsResultV5 { + records: ReferralUserInvitationRecordV5[]; + total: number; +} + +================ +File: src/types/request/v5-market.ts +================ +import { KlineIntervalV3 } from '../shared'; +import { + CategoryV5, + InstrumentStatusV5, + InstrumentSymbolTypeV5, + OptionTypeV5, +} from '../shared-v5'; +⋮---- +export interface GetKlineParamsV5 { + category: 'spot' | 'linear' | 'inverse'; + symbol: string; + interval: KlineIntervalV3; + start?: number; + end?: number; + limit?: number; +} ⋮---- -/** - * Defines the types of order creation mechanisms. - */ -export type OrderCreateTypeV5 = - /** Represents an order created by a user. */ - | 'CreateByUser' - /** Represents an order created by an admin closing. */ - | 'CreateByAdminClosing' - /** Futures conditional order. */ - | 'CreateByStopOrder' - /** Futures take profit order. */ - | 'CreateByTakeProfit' - /** Futures partial take profit order. */ - | 'CreateByPartialTakeProfit' - /** Futures stop loss order. */ - | 'CreateByStopLoss' - /** Futures partial stop loss order. */ - | 'CreateByPartialStopLoss' - /** Futures trailing stop order. */ - | 'CreateByTrailingStop' - /** Laddered liquidation to reduce the required maintenance margin. */ - | 'CreateByLiq' +export interface GetMarkPriceKlineParamsV5 { /** - * If the position is still subject to liquidation (i.e., does not meet the required maintenance margin level), - * the position shall be taken over by the liquidation engine and closed at the bankruptcy price. + * linear (default if omitted), inverse, or option. */ - | 'CreateByTakeOver_PassThrough' - /** Auto-Deleveraging(ADL) */ - | 'CreateByAdl_PassThrough' - /** Order placed via Paradigm. */ - | 'CreateByBlock_PassThrough' - /** Order created by move position. */ - | 'CreateByBlockTradeMovePosition_PassThrough' - /** The close order placed via web or app position area - web/app. */ - | 'CreateByClosing' - /** Order created via grid bot - web/app. */ - | 'CreateByFGridBot' - /** Order closed via grid bot - web/app. */ - | 'CloseByFGridBot' - /** Order created by TWAP - web/app. */ - | 'CreateByTWAP' - /** Order created by TV webhook - web/app. */ - | 'CreateByTVSignal' - /** Order created by Mm rate close function - web/app. */ - | 'CreateByMmRateClose' - /** Order created by Martingale bot - web/app. */ - | 'CreateByMartingaleBot' - /** Order closed by Martingale bot - web/app. */ - | 'CloseByMartingaleBot' - /** Order created by Ice berg strategy - web/app. */ - | 'CreateByIceBerg' - /** Order created by arbitrage - web/app. */ - | 'CreateByArbitrage' - /** Option dynamic delta hedge order - web/app */ - | 'CreateByDdh' - /** BBO Order - Best Bid/Offer order */ - | 'CreateByBboOrder'; + category?: 'linear' | 'inverse' | 'option'; + symbol: string; + interval: KlineIntervalV3; + start?: number; + end?: number; + /** + * Futures: [1, 1000], default 200. Options: [1, 500], default 200. + */ + limit?: number; +} ⋮---- -/** Represents an order created by a user. */ +/** + * linear (default if omitted), inverse, or option. + */ ⋮---- -/** Represents an order created by an admin closing. */ +/** + * Futures: [1, 1000], default 200. Options: [1, 500], default 200. + */ ⋮---- -/** Futures conditional order. */ +export interface GetIndexPriceKlineParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + interval: KlineIntervalV3; + start?: number; + end?: number; + limit?: number; +} ⋮---- -/** Futures take profit order. */ +export interface GetPremiumIndexPriceKlineParamsV5 { + category: 'linear'; + symbol: string; + interval: KlineIntervalV3; + start?: number; + end?: number; + limit?: number; +} ⋮---- -/** Futures partial take profit order. */ +export interface GetInstrumentsInfoParamsV5 { + category: CategoryV5; + symbol?: string; + /** Filter by instrument `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ + symbolType?: InstrumentSymbolTypeV5; + status?: InstrumentStatusV5; + /** For `category=option`, pass `All` to return all option symbols. */ + baseCoin?: string; + limit?: number; + cursor?: string; +} ⋮---- -/** Futures stop loss order. */ +/** Filter by instrument `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ ⋮---- -/** Futures partial stop loss order. */ +/** For `category=option`, pass `All` to return all option symbols. */ ⋮---- -/** Futures trailing stop order. */ +/** + * GET /v5/market/instrument-summary + * + * `category` is required. Page with `cursor` = previous `nextPageCursor`. + */ +export interface GetInstrumentSummaryParamsV5 { + /** Product type. `linear` or `option`. */ + category: 'linear' | 'option'; + symbol?: string; + /** Instrument type. */ + symbolType?: string; + /** Market region, for example `HK`, `US`, `CN`, `KR`. */ + marketRegion?: string; + /** Base coin, for example `NVDA` or `TSLA`. */ + baseCoin?: string; + /** Page size. Range [1, 1000]. Default 500. */ + limit?: number; + /** Cursor. Use `nextPageCursor` from the previous response. */ + cursor?: string; +} ⋮---- -/** Laddered liquidation to reduce the required maintenance margin. */ +/** Product type. `linear` or `option`. */ ⋮---- -/** - * If the position is still subject to liquidation (i.e., does not meet the required maintenance margin level), - * the position shall be taken over by the liquidation engine and closed at the bankruptcy price. - */ +/** Instrument type. */ ⋮---- -/** Auto-Deleveraging(ADL) */ +/** Market region, for example `HK`, `US`, `CN`, `KR`. */ ⋮---- -/** Order placed via Paradigm. */ +/** Base coin, for example `NVDA` or `TSLA`. */ ⋮---- -/** Order created by move position. */ +/** Page size. Range [1, 1000]. Default 500. */ ⋮---- -/** The close order placed via web or app position area - web/app. */ +/** Cursor. Use `nextPageCursor` from the previous response. */ ⋮---- -/** Order created via grid bot - web/app. */ +export interface GetOrderbookParamsV5 { + category: CategoryV5; + symbol: string; + limit?: number; +} ⋮---- -/** Order closed via grid bot - web/app. */ +export interface GetRPIOrderbookParamsV5 { + category?: 'spot' | 'linear' | 'inverse'; + symbol: string; + limit: number; // Required for RPI orderbook, [1, 50] +} ⋮---- -/** Order created by TWAP - web/app. */ +limit: number; // Required for RPI orderbook, [1, 50] ⋮---- -/** Order created by TV webhook - web/app. */ +export interface GetIndexPriceComponentsParamsV5 { + indexName: string; // Index name, like BTCUSDT +} ⋮---- -/** Order created by Mm rate close function - web/app. */ +indexName: string; // Index name, like BTCUSDT ⋮---- -/** Order created by Martingale bot - web/app. */ +export interface GetADLAlertParamsV5 { + symbol?: string; // Contract name, e.g. BTCUSDT. Uppercase only +} ⋮---- -/** Order closed by Martingale bot - web/app. */ +symbol?: string; // Contract name, e.g. BTCUSDT. Uppercase only ⋮---- -/** Order created by Ice berg strategy - web/app. */ +export interface GetFeeGroupStructureParamsV5 { + productType: string; // Product type. contract only for now + groupId?: string; // Group ID. 1, 2, 3, 4, 5, 6, 7 +} ⋮---- -/** Order created by arbitrage - web/app. */ +productType: string; // Product type. contract only for now +groupId?: string; // Group ID. 1, 2, 3, 4, 5, 6, 7 ⋮---- -/** Option dynamic delta hedge order - web/app */ +export interface GetTickersParamsV5 { + category: TCategory; + symbol?: string; + baseCoin?: string; + expDate?: string; +} ⋮---- -/** BBO Order - Best Bid/Offer order */ +export interface GetFundingRateHistoryParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + startTime?: number; + endTime?: number; + limit?: number; +} ⋮---- -export type OrderCancelTypeV5 = - | 'CancelByUser' - | 'CancelByReduceOnly' - | 'CancelByPrepareLiq' - | 'CancelAllBeforeLiq' - | 'CancelByPrepareAdl' - | 'CancelAllBeforeAdl' - | 'CancelByAdmin' - | 'CancelByTpSlTsClear' - | 'CancelByPzSideCh' - | 'UNKNOWN'; +export interface GetPublicTradingHistoryParamsV5 { + category: CategoryV5; + symbol: string; + baseCoin?: string; + optionType?: OptionTypeV5; + limit?: number; +} ⋮---- -export type OrderRejectReasonV5 = - | 'EC_NoError' - | 'EC_Others' - | 'EC_UnknownMessageType' - | 'EC_MissingClOrdID' - | 'EC_MissingOrigClOrdID' - | 'EC_ClOrdIDOrigClOrdIDAreTheSame' - | 'EC_DuplicatedClOrdID' - | 'EC_OrigClOrdIDDoesNotExist' - | 'EC_TooLateToCancel' - | 'EC_UnknownOrderType' - | 'EC_UnknownSide' - | 'EC_UnknownTimeInForce' - | 'EC_WronglyRouted' - | 'EC_MarketOrderPriceIsNotZero' - | 'EC_LimitOrderInvalidPrice' - | 'EC_NoEnoughQtyToFill' - | 'EC_NoImmediateQtyToFill' - | 'EC_PerCancelRequest' - | 'EC_MarketOrderCannotBePostOnly' - | 'EC_PostOnlyWillTakeLiquidity' - | 'EC_CancelReplaceOrder' - | 'EC_InvalidSymbolStatus'; +export type OpenInterestIntervalV5 = + | '5min' + | '15min' + | '30min' + | '1h' + | '4h' + | '1d'; ⋮---- -export type StopOrderTypeV5 = - | 'TakeProfit' - | 'StopLoss' - | 'TrailingStop' - | 'Stop' - | 'PartialTakeProfit' - | 'PartialStopLoss' - | 'tpslOrder' - | 'OcoOrder' - | 'MmRateClose' - | 'BidirectionalTpslOrder'; +export interface GetOpenInterestParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + intervalTime: OpenInterestIntervalV5; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -/** - * Position index. Used to identify positions in different position modes. - * - * - 0 one-way mode position - * - 1 Buy side of hedge-mode position - * - 2 Sell side of hedge-mode position - */ -export type PositionIdx = 0 | 1 | 2; +export interface GetHistoricalVolatilityParamsV5 { + category: 'option'; + baseCoin?: string; + period?: 7 | 14 | 21 | 30 | 60 | 90 | 180 | 270; + startTime?: number; + endTime?: number; +} ⋮---- -/** - * Position status. - * - * - 'Normal' - * - 'Liq' in the liquidation progress - * - 'Adl' in the auto-deleverage progress - */ -export type PositionStatusV5 = 'Normal' | 'Liq' | 'Adl'; -export type PositionSideV5 = 'Buy' | 'Sell' | 'None' | ''; +export interface GetInsuranceParamsV5 { + coin?: string; +} ⋮---- -export type OptionTypeV5 = 'Call' | 'Put'; +export interface GetRiskLimitParamsV5 { + category?: 'linear' | 'inverse'; + symbol?: string; + cursor?: string; +} ⋮---- -/** - * Trade mode. - * - * - 0 cross-margin, - * - 1 isolated margin - */ -export type TradeModeV5 = 0 | 1; +export interface GetOptionDeliveryPriceParamsV5 { + category: 'option'; + symbol?: string; + baseCoin?: string; + limit?: number; + cursor?: string; +} ⋮---- -export type TPSLModeV5 = 'Full' | 'Partial'; -export type AccountMarginModeV5 = - | 'ISOLATED_MARGIN' - | 'REGULAR_MARGIN' - | 'PORTFOLIO_MARGIN'; -export type UnifiedUpdateStatusV5 = 'FAIL' | 'PROCESS' | 'SUCCESS'; +export interface GetDeliveryPriceParamsV5 { + category: 'linear' | 'inverse' | 'option'; + symbol?: string; + baseCoin?: string; + settleCoin?: string; + limit?: number; + cursor?: string; +} ⋮---- -export type AccountTypeV5 = - | 'CONTRACT' - | 'SPOT' - | 'INVESTMENT' - | 'OPTION' - | 'UNIFIED' - | 'FUND' - | 'EARN'; +export interface GetLongShortRatioParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + period: OpenInterestIntervalV5; + startTime?: string; + endTime?: string; + limit?: number; + cursor?: string; +} ⋮---- -export type TransactionTypeV5 = - | 'TRANSFER_IN' - | 'TRANSFER_OUT' - | 'TRADE' - | 'SETTLEMENT' - | 'DELIVERY' - | 'LIQUIDATION' - | 'ADL' - | 'AIRDROP' - | 'BONUS_RECOLLECT' - | 'BONUS_RECOLLECT' - | 'FEE_REFUND' - | 'INTEREST' - | 'CURRENCY_BUY' - | 'CURRENCY_SELL' - | 'BORROWED_AMOUNT_INS_LOAN' - | 'PRINCIPLE_REPAYMENT_INS_LOAN' - | 'INTEREST_REPAYMENT_INS_LOAN' - | 'AUTO_SOLD_COLLATERAL_INS_LOAN' - | 'AUTO_BUY_LIABILITY_INS_LOAN' - | 'AUTO_PRINCIPLE_REPAYMENT_INS_LOAN' - | 'AUTO_INTEREST_REPAYMENT_INS_LOAN' - | 'TRANSFER_IN_INS_LOAN' - | 'TRANSFER_OUT_INS_LOAN' - | 'SPOT_REPAYMENT_SELL' - | 'SPOT_REPAYMENT_BUY' - | 'TOKENS_SUBSCRIPTION' - | 'TOKENS_REDEMPTION' - | 'AUTO_DEDUCTION' - | 'FLEXIBLE_STAKING_SUBSCRIPTION' - | 'FLEXIBLE_STAKING_REDEMPTION' - | 'FIXED_STAKING_SUBSCRIPTION' - | 'BORROWED_AMOUNT_INS_LOAN' - | 'PRINCIPLE_REPAYMENT_INS_LOAN' - | 'INTEREST_REPAYMENT_INS_LOAN' - | 'AUTO_SOLD_COLLATERAL_INS_LOAN' - | 'AUTO_BUY_LIABILITY_INS_LOAN' - | 'AUTO_PRINCIPLE_REPAYMENT_INS_LOAN' - | 'AUTO_INTEREST_REPAYMENT_INS_LOAN' - | 'TRANSFER_IN_INS_LOAN' - | 'TRANSFER_OUT_INS_LOAN' - | 'SPOT_REPAYMENT_SELL' - | 'SPOT_REPAYMENT_BUY' - | 'TOKENS_SUBSCRIPTION' - | 'TOKENS_REDEMPTION' - | 'AUTO_DEDUCTION' - | 'FLEXIBLE_STAKING_SUBSCRIPTION' - | 'FLEXIBLE_STAKING_REDEMPTION' - | 'FIXED_STAKING_SUBSCRIPTION' - | 'FLEXIBLE_STAKING_REFUND' - | 'FIXED_STAKING_REFUND' - | 'PREMARKET_TRANSFER_OUT' - | 'PREMARKET_DELIVERY_SELL_NEW_COIN' - | 'PREMARKET_DELIVERY_BUY_NEW_COIN' - | 'PREMARKET_DELIVERY_PLEDGE_PAY_SELLER' - | 'PREMARKET_DELIVERY_PLEDGE_BACK' - | 'PREMARKET_ROLLBACK_PLEDGE_BACK' - | 'PREMARKET_ROLLBACK_PLEDGE_PENALTY_TO_BUYER' - | 'CUSTODY_NETWORK_FEE' - | 'CUSTODY_SETTLE_FEE' - | 'CUSTODY_LOCK' - | 'CUSTODY_UNLOCK' - | 'CUSTODY_UNLOCK_REFUND' - | 'LOANS_BORROW_FUNDS' - | 'LOANS_PLEDGE_ASSET' - | 'BONUS_TRANSFER_IN' - | 'BONUS_TRANSFER_OUT' - | 'PEF_TRANSFER_IN' - | 'PEF_TRANSFER_OUT' - | 'PEF_PROFIT_SHARE' - | 'ONCHAINEARN_SUBSCRIPTION' - | 'ONCHAINEARN_REDEMPTION' - | 'ONCHAINEARN_REFUND' - | 'STRUCTURE_PRODUCT_SUBSCRIPTION' - | 'STRUCTURE_PRODUCT_REFUND' - | 'CLASSIC_WEALTH_MANAGEMENT_SUBSCRIPTION' - | 'PREMIMUM_WEALTH_MANAGEMENT_SUBSCRIPTION' - | 'PREMIMUM_WEALTH_MANAGEMENT_REFUND' - | 'LIQUIDITY_MINING_SUBSCRIPTION' - | 'LIQUIDITY_MINING_REFUND' - | 'PWM_SUBSCRIPTION' - | 'PWM_REFUND' - | 'DEFI_INVESTMENT_SUBSCRIPTION' - | 'DEFI_INVESTMENT_REFUND' - | 'DEFI_INVESTMENT_REDEMPTION' - | 'INSTITUTION_LOAN_IN' - | 'INSTITUTION_PAYBACK_PRINCIPAL_OUT' - | 'INSTITUTION_PAYBACK_INTEREST_OUT' - | 'INSTITUTION_EXCHANGE_SELL' - | 'INSTITUTION_EXCHANGE_BUY' - | 'INSTITUTION_LIQ_PRINCIPAL_OUT' - | 'INSTITUTION_LIQ_INTEREST_OUT' - | 'INSTITUTION_LOAN_TRANSFER_IN' - | 'INSTITUTION_LOAN_TRANSFER_OUT' - | 'INSTITUTION_LOAN_WITHOUT_WITHDRAW' - | 'INSTITUTION_LOAN_RESERVE_IN' - | 'INSTITUTION_LOAN_RESERVE_OUT' - | 'PLATFORM_TOKEN_MNT_LIQRECALLEDMMNT' - | 'PLATFORM_TOKEN_MNT_LIQRETURNEDMNT' - | 'DIVIDEND_SETTLEMENT' +export interface GetFullDepthOrderbookParamsV5 { + category: 'spot' | 'linear' | 'inverse'; + symbol: string; +} +⋮---- +export interface GetOptionBaseCoinsParamsV5 { /** - * Forward stock split settlement. Closes the entire existing position; the - * new position is opened as `FORWARD_SPLIT_OPEN`. - * - * Changelog 2026-10-13 updated this description. The enum glossary still - * lists the older wording "fractional share settlement". + * Comma-separated underlying types. + * 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil. Omit to return all types. */ - | 'FORWARD_SPLIT_SETTLE' - /** Forward stock split position opening after the existing position is settled and closed. */ - | 'FORWARD_SPLIT_OPEN' - /** - * Reverse stock split settlement. Closes the entire existing position; the - * new position is opened as `REVERSE_SPLIT_OPEN`. - * - * Changelog 2026-10-13 updated this description. The enum glossary still - * lists the older wording "fractional share settlement". + underlyingType?: string; +} +⋮---- +/** + * Comma-separated underlying types. + * 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil. Omit to return all types. */ - | 'REVERSE_SPLIT_SETTLE' - /** Reverse stock split position opening after the existing position is settled and closed. */ - | 'REVERSE_SPLIT_OPEN'; +⋮---- +export interface GetCorporateActionsParamsV5 { + category?: 'option'; + baseCoin?: string; + actionType?: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; + limit?: number; + cursor?: string; +} + +================ +File: src/types/response/v5-market.ts +================ +import { + CategoryCursorListV5, + CategoryV5, + ContractTypeV5, + CopyTradingV5, + InstrumentStatusV5, + InstrumentSymbolTypeV5, + MarginTradingV5, + OptionTypeV5, + OrderSideV5, +} from '../shared-v5'; +⋮---- +/** + * OHLCVT candle used by v5 APIs + * + * - list[0]: startTime string Start time of the candle (ms) + * - list[1]: openPrice string Open price + * - list[2]: highPrice string Highest price + * - list[3]: lowPrice string Lowest price + * - list[4]: closePrice string Close price. Is the last traded price when the candle is not closed + * - list[5]: volume string Trade volume. Unit of contract: pieces of contract. Unit of spot: quantity of coins + * - list[6]: turnover string Turnover. Unit of figure: quantity of quota coin + */ +export type OHLCVKlineV5 = [ + string, + string, + string, + string, + string, + string, + string, +]; ⋮---- /** - * Forward stock split settlement. Closes the entire existing position; the - * new position is opened as `FORWARD_SPLIT_OPEN`. - * - * Changelog 2026-10-13 updated this description. The enum glossary still - * lists the older wording "fractional share settlement". + * OHLC candle used by v5 APIs + * + * - list[0]: startTime string Start time of the candle (ms) + * - list[1]: openPrice string Open price + * - list[2]: highPrice string Highest price + * - list[3]: lowPrice string Lowest price + * - list[4]: closePrice string Close price. Is the last traded price when the candle is not closed + */ +export type OHLCKlineV5 = [string, string, string, string, string]; +⋮---- +export interface LinearInverseInstrumentInfoV5 { + /** The ID of the symbol name. */ + symbolId: number; + symbol: string; + contractType: ContractTypeV5; + status: InstrumentStatusV5; + baseCoin: string; + quoteCoin: string; + /** Region / product class for the pair (`stock`, `forex`, `commodity`, `xstocks`, etc.). */ + symbolType: InstrumentSymbolTypeV5; + launchTime: string; + deliveryTime?: string; + deliveryFeeRate?: string; + priceScale: string; + leverageFilter: { + minLeverage: string; + maxLeverage: string; + leverageStep: string; + }; + priceFilter: { + minPrice: string; + maxPrice: string; + tickSize: string; + }; + lotSizeFilter: { + maxOrderQty: string; + maxMktOrderQty: string; + minOrderQty: string; + qtyStep: string; + postOnlyMaxOrderQty?: string; + minNotionalValue?: string; + }; + unifiedMarginTrade: boolean; + fundingInterval: number; + settleCoin: string; + copyTrading: CopyTradingV5; + upperFundingRate: string; + lowerFundingRate: string; + riskParameters: { + priceLimitRatioX: string; + priceLimitRatioY: string; + }; + isPreListing: boolean; + preListingInfo: { + curAuctionPhase: string; + phases: { + phase: string; + startTime: string; + endTime: string; + }[]; + auctionFeeInfo: { + auctionFeeRate: string; + takerFeeRate: string; + makerFeeRate: string; + }; + } | null; + skipCallAuction?: boolean; // For USDT pre-market contract + displayName: string; + fullName?: string; + marketRegion?: string; + underlyingTicker?: string; + /** Symbol tags such as `ST`. Linear and inverse only. */ + tags?: string[]; +} +⋮---- +/** The ID of the symbol name. */ +⋮---- +/** Region / product class for the pair (`stock`, `forex`, `commodity`, `xstocks`, etc.). */ +⋮---- +skipCallAuction?: boolean; // For USDT pre-market contract +⋮---- +/** Symbol tags such as `ST`. Linear and inverse only. */ +⋮---- +export interface OptionInstrumentInfoV5 { + /** The ID of the symbol name. */ + symbolId: number; + symbol: string; + optionsType: OptionTypeV5; + status: InstrumentStatusV5; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + symbolType: InstrumentSymbolTypeV5; + launchTime: string; + deliveryTime: string; + deliveryFeeRate: string; + priceFilter: { + minPrice: string; + maxPrice: string; + tickSize: string; + }; + lotSizeFilter: { + maxOrderQty: string; + minOrderQty: string; + qtyStep: string; + }; + displayName: string; +} +⋮---- +/** The ID of the symbol name. */ +⋮---- +export interface SpotInstrumentInfoV5 { + /** The ID of the symbol name. */ + symbolId: number; + symbol: string; + baseCoin: string; + quoteCoin: string; + /** + * Xstock multiplier for `symbolType` = xstocks pairs. `stock_price = token_price / multiplier`, + * `stock_qty = token_qty * multiplier`. Default `"1"`. */ + xstockMultiplier?: string; + symbolType: InstrumentSymbolTypeV5; + innovation: '0' | '1'; // Deprecated, always 0 + status: InstrumentStatusV5; + marginTrading: MarginTradingV5; + stTag: '0' | '1'; + lotSizeFilter: { + basePrecision: string; + quotePrecision: string; + /** + * @deprecated Spot order size is enforced by `minOrderAmt` only. + * Bybit API staff confirmed on 15 Oct 2026 that `minOrderQty` no longer + * applies for spot. Undocumented: broker and CCXT users have a 1 USDT + * minimum; direct API users have a 5 USDT minimum. + */ + minOrderQty: string; + maxOrderQty: string; + /** + * Minimum order amount in the quote coin. This is the spot minimum that + * applies. Undocumented; Bybit API staff confirmed on 15 Oct 2026 that + * broker and CCXT users have a 1 USDT minimum, and direct API users have + * a 5 USDT minimum. + */ + minOrderAmt: string; + maxOrderAmt: string; + maxLimitOrderQty: string; + maxMarketOrderQty: string; + postOnlyMaxLimitOrderSize: string; + }; + priceFilter: { + tickSize: string; + }; + riskParameters: { + priceLimitRatioX: string; + priceLimitRatioY: string; + }; + forbidUplWithdrawal: boolean; +} ⋮---- -/** Forward stock split position opening after the existing position is settled and closed. */ +/** The ID of the symbol name. */ ⋮---- /** - * Reverse stock split settlement. Closes the entire existing position; the - * new position is opened as `REVERSE_SPLIT_OPEN`. - * - * Changelog 2026-10-13 updated this description. The enum glossary still - * lists the older wording "fractional share settlement". + * Xstock multiplier for `symbolType` = xstocks pairs. `stock_price = token_price / multiplier`, + * `stock_qty = token_qty * multiplier`. Default `"1"`. */ ⋮---- -/** Reverse stock split position opening after the existing position is settled and closed. */ -⋮---- -export type PermissionTypeV5 = - | 'ContractTrade' - | 'Spot' - | 'Wallet' - | 'Options' - | 'Derivatives' - | 'Exchange' - | 'NFT'; +innovation: '0' | '1'; // Deprecated, always 0 ⋮---- /** - * Leveraged token status: - * - * - '1' LT can be purchased and redeemed - * - '2' LT can be purchased, but not redeemed - * - '3' LT can be redeemed, but not purchased - * - '4' LT cannot be purchased nor redeemed - * - '5' Adjusting position - */ -export type LeverageTokenStatusV5 = '1' | '2' | '3' | '4' | '5'; + * @deprecated Spot order size is enforced by `minOrderAmt` only. + * Bybit API staff confirmed on 15 Oct 2026 that `minOrderQty` no longer + * applies for spot. Undocumented: broker and CCXT users have a 1 USDT + * minimum; direct API users have a 5 USDT minimum. + */ ⋮---- /** - * Leveraged token order type: '1': purchase, '2': redeem - */ -export type LTOrderTypeV5 = '1' | '2'; + * Minimum order amount in the quote coin. This is the spot minimum that + * applies. Undocumented; Bybit API staff confirmed on 15 Oct 2026 that + * broker and CCXT users have a 1 USDT minimum, and direct API users have + * a 5 USDT minimum. + */ +⋮---- +type InstrumentInfoV5Mapping = { + linear: LinearInverseInstrumentInfoV5[]; + inverse: LinearInverseInstrumentInfoV5[]; + option: OptionInstrumentInfoV5[]; + spot: SpotInstrumentInfoV5[]; +}; +⋮---- +export type InstrumentInfoResponseV5 = + CategoryCursorListV5; ⋮---- /** - * Leveraged token order status: '1': completed, '2': in progress, '3': failed + * One row from GET /v5/market/instrument-summary. + * + * Several fields are an empty string when they do not apply (`fullName`, + * `marketRegion`, and `underlyingTicker` for option; `priceIndex` for linear). */ -export type LTOrderStatusV5 = '1' | '2' | '3'; -⋮---- -export type ExecTypeV5 = - | 'Trade' - | 'AdlTrade' - | 'Funding' - | 'BustTrade' - | 'Settle' - | 'BlockTrade' - | 'MovePosition' - /** @deprecated Removed from Bybit execType; kept for older payloads. */ - | 'CorporateAction' +export interface InstrumentSummaryV5 { + symbol: string; + /** Instrument type. May be an empty string. */ + symbolType: string; + /** Display name shown in the UI. */ + displayName: string; + baseCoin: string; + settleCoin: string; + /** Full name. Empty string for `option`. */ + fullName: string; /** - * Forward stock split settlement and closure of the entire existing position, - * followed by opening a new position (`ForwardSplitOpen`). + * Market region of the underlying asset (`US`, `CN`, `HK`, `KR`, and others). + * Empty string for `option` or when not applicable. + */ + marketRegion: string; + /** + * Stock ticker, security code, or asset symbol in the underlying market. + * Empty string for `option`. */ - | 'ForwardSplitSettle' - /** Forward stock split position opening after the existing position is settled and closed. */ - | 'ForwardSplitOpen' + underlyingTicker: string; /** - * Reverse stock split settlement and closure of the entire existing position, - * followed by opening a new position (`ReverseSplitOpen`). + * TradFi perpetual symbol used as the price index. NVDA options use `NVDAUSDT`. + * Empty string for `linear`. */ - | 'ReverseSplitSettle' - /** Reverse stock split position opening after the existing position is settled and closed. */ - | 'ReverseSplitOpen' - | 'Dividend' - | 'UNKNOWN'; + priceIndex: string; + qtyStep: string; + tickSize: string; + /** Delivery timestamp in milliseconds. `"0"` for `linear`. */ + deliveryTime: string; +} ⋮---- -/** @deprecated Removed from Bybit execType; kept for older payloads. */ +/** Instrument type. May be an empty string. */ +⋮---- +/** Display name shown in the UI. */ +⋮---- +/** Full name. Empty string for `option`. */ ⋮---- /** - * Forward stock split settlement and closure of the entire existing position, - * followed by opening a new position (`ForwardSplitOpen`). + * Market region of the underlying asset (`US`, `CN`, `HK`, `KR`, and others). + * Empty string for `option` or when not applicable. */ ⋮---- -/** Forward stock split position opening after the existing position is settled and closed. */ +/** + * Stock ticker, security code, or asset symbol in the underlying market. + * Empty string for `option`. + */ ⋮---- /** - * Reverse stock split settlement and closure of the entire existing position, - * followed by opening a new position (`ReverseSplitOpen`). + * TradFi perpetual symbol used as the price index. NVDA options use `NVDAUSDT`. + * Empty string for `linear`. */ ⋮---- -/** Reverse stock split position opening after the existing position is settled and closed. */ +/** Delivery timestamp in milliseconds. `"0"` for `linear`. */ ⋮---- -/** - * Withdraw type. 0(default): on chain. 1: off chain. 2: all. - */ -export type WithdrawalTypeV5 = '0' | '1' | '2'; +export type InstrumentSummaryResponseV5 = CategoryCursorListV5< + InstrumentSummaryV5[], + 'linear' | 'option' +>; ⋮---- -export interface PermissionsV5 { - ContractTrade?: string[]; - Spot?: string[]; - Wallet?: string[]; - Options?: string[]; - Derivatives?: string[]; - CopyTrading?: string[]; - BlockTrade?: string[]; - Exchange?: string[]; - /** @deprecated , always returns []*/ - NFT?: string[]; - Earn?: string[]; - Affiliate?: string[]; - FiatP2P?: string[]; - /** Bybit Pay (FaitPayOrder) */ - FiatBitPay?: string[]; - FiatConvertBroker?: string[]; - BitCard?: string[]; - ByXPost?: string[]; +// Account Instruments Info (includes RPI permissions) +export interface AccountSpotInstrumentInfoV5 extends SpotInstrumentInfoV5 { + isPublicRpi: boolean; + myRpiPermission: boolean; } ⋮---- -/** @deprecated , always returns []*/ +export interface AccountLinearInverseInstrumentInfoV5 + extends LinearInverseInstrumentInfoV5 { + isPublicRpi: boolean; + myRpiPermission: boolean; +} ⋮---- -/** Bybit Pay (FaitPayOrder) */ +type AccountInstrumentInfoV5Mapping = { + linear: AccountLinearInverseInstrumentInfoV5[]; + inverse: AccountLinearInverseInstrumentInfoV5[]; + spot: AccountSpotInstrumentInfoV5[]; +}; ⋮---- -export interface CategoryCursorListV5< - T extends unknown[], - TCategory extends CategoryV5 = CategoryV5, -> { - category: TCategory; - list: T; - nextPageCursor?: string; +export type AccountInstrumentInfoResponseV5< + C extends 'spot' | 'linear' | 'inverse', +> = CategoryCursorListV5; +⋮---- +/** + * [price, size] + */ +export type OrderbookLevelV5 = [string, string]; +⋮---- +export interface OrderbookResponseV5 { + s: string; + b: OrderbookLevelV5[]; + a: OrderbookLevelV5[]; + ts: number; + u: number; + seq: number; + cts: number; } ⋮---- /** - * Next page cursor does not exist for spot! + * RPI Orderbook level: [price, nonRpiSize, rpiSize] */ -export interface CursorListV5 { - nextPageCursor: string; - list: T; +export type RPIOrderbookLevelV5 = [string, string, string]; +⋮---- +export interface RPIOrderbookResponseV5 { + s: string; // Symbol name + b: RPIOrderbookLevelV5[]; // Bids. Sorted by price in descending order + a: RPIOrderbookLevelV5[]; // Asks. Sorted by price in ascending order + ts: number; // The timestamp (ms) that the system generates the data + u: number; // Update ID, is always in sequence corresponds to u in the 50-level WebSocket RPI orderbook stream + seq: number; // Cross sequence + cts: number; // The timestamp from the matching engine when this orderbook data is produced +} +⋮---- +s: string; // Symbol name +b: RPIOrderbookLevelV5[]; // Bids. Sorted by price in descending order +a: RPIOrderbookLevelV5[]; // Asks. Sorted by price in ascending order +ts: number; // The timestamp (ms) that the system generates the data +u: number; // Update ID, is always in sequence corresponds to u in the 50-level WebSocket RPI orderbook stream +seq: number; // Cross sequence +cts: number; // The timestamp from the matching engine when this orderbook data is produced +⋮---- +export interface TickerLinearInverseV5 { + symbol: string; + lastPrice: string; + indexPrice: string; + markPrice: string; + prevPrice24h: string; + price24hPcnt: string; + highPrice24h: string; + lowPrice24h: string; + prevPrice1h: string; + openInterest: string; + openInterestValue: string; + singleOpenInterest?: string; + singleOpenInterestValue?: string; + turnover24h: string; + volume24h: string; + fundingRate: string; + nextFundingTime: string; + predictedDeliveryPrice: string; + basisRate: string; + basisRateYear: string; + fundingIntervalHour: string; + fundingCap: string; + deliveryFeeRate: string; + deliveryTime: string; + ask1Size: string; + bid1Price: string; + ask1Price: string; + bid1Size: string; + preOpenPrice: string; + preQty: string; + curPreListingPhase: string; + basis: string; +} +⋮---- +export interface TickerOptionV5 { + symbol: string; + bid1Price: string; + bid1Size: string; + bid1Iv: string; + ask1Price: string; + ask1Size: string; + ask1Iv: string; + lastPrice: string; + highPrice24h: string; + lowPrice24h: string; + markPrice: string; + indexPrice: string; + markIv: string; + underlyingPrice: string; + openInterest: string; + turnover24h: string; + volume24h: string; + totalVolume: string; + totalTurnover: string; + delta: string; + gamma: string; + vega: string; + theta: string; + predictedDeliveryPrice: string; + change24h: string; +} +⋮---- +export interface TickerSpotV5 { + symbol: string; + bid1Price: string; + bid1Size: string; + ask1Price: string; + ask1Size: string; + lastPrice: string; + prevPrice24h: string; + price24hPcnt: string; + highPrice24h: string; + lowPrice24h: string; + turnover24h: string; + volume24h: string; + usdIndexPrice: string; +} +⋮---- +export interface FundingRateHistoryResponseV5 { + symbol: string; + fundingRate: string; + fundingRateTimestamp: string; +} +⋮---- +export interface PublicTradeV5 { + execId: string; + symbol: string; + price: string; + size: string; + side: OrderSideV5; + time: string; + isBlockTrade: boolean; + isRPITrade: boolean; + mP?: string; + iP?: string; + mIv?: string; + iv?: string; + seq?: string; } ⋮---- /** - * A wrapper type for any responses that have a "nextPageCursor" property, and a "rows" property with an array of elements * - * ```{ nextPageCursor: "something", rows: someData[] }``` + * - openInterest string Open interest + * - timestamp string The timestamp (ms) */ -export interface CursorRowsV5 { - nextPageCursor: string; - rows: T; +export type OpenInterestV5 = { + openInterest: string; + singleOpenInterest?: string; + timestamp: string; +}; +⋮---- +export interface OpenInterestResponseV5 { + category: 'linear' | 'inverse'; + symbol: string; + list: OpenInterestV5[]; + nextPageCursor?: string; +} +⋮---- +export interface HistoricalVolatilityV5 { + period: number; + value: string; + time: string; } ⋮---- -export interface CategoryListV5< - T extends unknown[], - TCategory extends CategoryV5, -> { - category: TCategory; - list: T; +export interface InsuranceDataV5 { + coin: string; + symbols: string; + balance: string; + value: string; } ⋮---- -export interface CategorySymbolListV5< - T extends unknown[], - TCategory extends CategoryV5, -> { - category: TCategory; +export interface InsuranceResponseV5 { + updatedTime: string; + list: InsuranceDataV5[]; +} +⋮---- +export interface RiskLimitV5 { + id: number; symbol: string; - list: T; + riskLimitValue: string; + maintenanceMargin: number; + initialMargin: number; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + section: any; + isLowestRisk: 0 | 1; + maxLeverage: string; + mmDeduction: string; + nextPageCursor?: string; } ⋮---- -export interface GetSystemStatusParamsV5 { - id?: string; - state?: string; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +⋮---- +/** @deprecated use DeliveryPriceV5 instead */ +export interface OptionDeliveryPriceV5 { + symbol: string; + deliveryPrice: string; + deliveryTime: string; } ⋮---- -export interface SystemStatusItemV5 { - id: string; - title: string; - state: string; - begin: string; - end: string; - href: string; - serviceTypes: number[]; - product: number[]; - uidSuffix: number[]; - maintainType: string; - env: string; +export interface DeliveryPriceV5 { + symbol: string; + deliveryPrice: string; + deliveryTime: string; } - -================ -File: src/types/request/v5-market.ts -================ -import { KlineIntervalV3 } from '../shared'; -import { - CategoryV5, - InstrumentStatusV5, - InstrumentSymbolTypeV5, - OptionTypeV5, -} from '../shared-v5'; ⋮---- -export interface GetKlineParamsV5 { - category: 'spot' | 'linear' | 'inverse'; +export interface LongShortRatioV5 { symbol: string; - interval: KlineIntervalV3; - start?: number; - end?: number; - limit?: number; + buyRatio: string; + sellRatio: string; + timestamp: string; } ⋮---- -export interface GetMarkPriceKlineParamsV5 { - /** - * linear (default if omitted), inverse, or option. - */ - category?: 'linear' | 'inverse' | 'option'; +export interface OrderPriceLimitV5 { symbol: string; - interval: KlineIntervalV3; - start?: number; - end?: number; - /** - * Futures: [1, 1000], default 200. Options: [1, 500], default 200. - */ - limit?: number; + buyLmt: string; + sellLmt: string; + ts: string; } ⋮---- -/** - * linear (default if omitted), inverse, or option. - */ +export interface IndexPriceComponentV5 { + exchange: string; // Name of the exchange + spotPair: string; // Spot trading pair on the exchange (e.g., BTCUSDT) + equivalentPrice: string; // Equivalent price + multiplier: string; // Multiplier used for the component price + price: string; // Actual price + weight: string; // Weight in the index calculation +} ⋮---- -/** - * Futures: [1, 1000], default 200. Options: [1, 500], default 200. - */ +exchange: string; // Name of the exchange +spotPair: string; // Spot trading pair on the exchange (e.g., BTCUSDT) +equivalentPrice: string; // Equivalent price +multiplier: string; // Multiplier used for the component price +price: string; // Actual price +weight: string; // Weight in the index calculation ⋮---- -export interface GetIndexPriceKlineParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - interval: KlineIntervalV3; - start?: number; - end?: number; - limit?: number; +export interface IndexPriceComponentsResponseV5 { + indexName: string; // Name of the index (e.g., BTCUSDT) + lastPrice: string; // Last price of the index + updateTime: string; // Timestamp of the last update in milliseconds + components: IndexPriceComponentV5[]; // List of components contributing to the index price } ⋮---- -export interface GetPremiumIndexPriceKlineParamsV5 { - category: 'linear'; - symbol: string; - interval: KlineIntervalV3; - start?: number; - end?: number; - limit?: number; +indexName: string; // Name of the index (e.g., BTCUSDT) +lastPrice: string; // Last price of the index +updateTime: string; // Timestamp of the last update in milliseconds +components: IndexPriceComponentV5[]; // List of components contributing to the index price +⋮---- +export interface ADLAlertItemV5 { + coin: string; // Token of the insurance pool + symbol: string; // Trading pair name + balance: string; // Balance of the insurance fund. Used to determine if ADL is triggered + maxBalance: string; // Maximum balance of the insurance pool in the last 8 hours + insurancePnlRatio: string; // PnL ratio threshold for triggering contract PnL drawdown ADL + pnlRatio: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped + adlTriggerThreshold: string; // Trigger threshold for contract PnL drawdown ADL + adlStopRatio: string; // Stop ratio threshold for contract PnL drawdown ADL } ⋮---- -export interface GetInstrumentsInfoParamsV5 { - category: CategoryV5; - symbol?: string; - /** Filter by instrument `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ - symbolType?: InstrumentSymbolTypeV5; - status?: InstrumentStatusV5; - /** For `category=option`, pass `All` to return all option symbols. */ - baseCoin?: string; - limit?: number; - cursor?: string; +coin: string; // Token of the insurance pool +symbol: string; // Trading pair name +balance: string; // Balance of the insurance fund. Used to determine if ADL is triggered +maxBalance: string; // Maximum balance of the insurance pool in the last 8 hours +insurancePnlRatio: string; // PnL ratio threshold for triggering contract PnL drawdown ADL +pnlRatio: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped +adlTriggerThreshold: string; // Trigger threshold for contract PnL drawdown ADL +adlStopRatio: string; // Stop ratio threshold for contract PnL drawdown ADL +⋮---- +export interface ADLAlertResponseV5 { + updateTime: string; // Latest data update timestamp (ms) + list: ADLAlertItemV5[]; // List of ADL alert items } ⋮---- -/** Filter by instrument `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ +updateTime: string; // Latest data update timestamp (ms) +list: ADLAlertItemV5[]; // List of ADL alert items ⋮---- -/** For `category=option`, pass `All` to return all option symbols. */ +export interface FeeGroupLevelV5 { + level: string; // Pro level name or Market Maker level name + takerFeeRate: string; // Taker fee rate + makerFeeRate: string; // Maker fee rate + makerRebate: string; // Maker rebate fee rate + rpiMakerRebate?: string; +} ⋮---- -/** - * GET /v5/market/instrument-summary - * - * `category` is required. Page with `cursor` = previous `nextPageCursor`. - */ -export interface GetInstrumentSummaryParamsV5 { - /** Product type. `linear` or `option`. */ - category: 'linear' | 'option'; - symbol?: string; - /** Instrument type. */ - symbolType?: string; - /** Market region, for example `HK`, `US`, `CN`, `KR`. */ - marketRegion?: string; - /** Base coin, for example `NVDA` or `TSLA`. */ - baseCoin?: string; - /** Page size. Range [1, 1000]. Default 500. */ - limit?: number; - /** Cursor. Use `nextPageCursor` from the previous response. */ - cursor?: string; +level: string; // Pro level name or Market Maker level name +takerFeeRate: string; // Taker fee rate +makerFeeRate: string; // Maker fee rate +makerRebate: string; // Maker rebate fee rate +⋮---- +export interface FeeGroupRatesV5 { + pro: FeeGroupLevelV5[]; // Pro-level fee structures + marketMaker: FeeGroupLevelV5[]; // Market Maker-level fee structures } ⋮---- -/** Product type. `linear` or `option`. */ +pro: FeeGroupLevelV5[]; // Pro-level fee structures +marketMaker: FeeGroupLevelV5[]; // Market Maker-level fee structures ⋮---- -/** Instrument type. */ +export interface FeeGroupItemV5 { + groupName: string; // Fee group name + weightingFactor: number; // Group weighting factor + symbolsNumbers: number; // Symbols number + symbols: string[]; // Symbol names + feeRates: FeeGroupRatesV5; // Fee rate details for different categories + updateTime: string; // Latest data update timestamp (ms) +} ⋮---- -/** Market region, for example `HK`, `US`, `CN`, `KR`. */ +groupName: string; // Fee group name +weightingFactor: number; // Group weighting factor +symbolsNumbers: number; // Symbols number +symbols: string[]; // Symbol names +feeRates: FeeGroupRatesV5; // Fee rate details for different categories +updateTime: string; // Latest data update timestamp (ms) ⋮---- -/** Base coin, for example `NVDA` or `TSLA`. */ +export interface FeeGroupStructureResponseV5 { + list: FeeGroupItemV5[]; // List of fee group objects +} ⋮---- -/** Page size. Range [1, 1000]. Default 500. */ +list: FeeGroupItemV5[]; // List of fee group objects ⋮---- -/** Cursor. Use `nextPageCursor` from the previous response. */ +export interface OptionBaseCoinV5 { + baseCoin: string; + quoteCoin: string; + settleCoin: string; + optionShowName: string; + /** UTC milliseconds. 0 when the option is not scheduled. */ + optionOnlineTime: number; + /** 1 when tradable option symbols exist, otherwise 0 */ + hasSymbol: 0 | 1; + /** 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil */ + underlyingType: 0 | 1 | 2 | 3 | 4; +} ⋮---- -export interface GetOrderbookParamsV5 { - category: CategoryV5; - symbol: string; - limit?: number; +/** UTC milliseconds. 0 when the option is not scheduled. */ +⋮---- +/** 1 when tradable option symbols exist, otherwise 0 */ +⋮---- +/** 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil */ +⋮---- +export interface OptionBaseCoinsResultV5 { + list: OptionBaseCoinV5[]; } ⋮---- -export interface GetRPIOrderbookParamsV5 { - category?: 'spot' | 'linear' | 'inverse'; +export interface CorporateActionV5 { + category?: 'option'; symbol: string; - limit: number; // Required for RPI orderbook, [1, 50] + baseCoin: string; + actionType: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; + status: string; + effectiveTime: number; + details: { + splitFactor?: string; + splitType?: 'FORWARD' | 'REVERSE'; + dividendAmountPerShare?: string; + dividendCurrency?: string; + installmentCount?: number; + installmentAmountPerShare?: string; + installmentCoin?: string; + firstSettlementTimeUtc?: number; + installments?: { + installmentNo: number; + settlementTimeUtc: number; + status: string; + }[]; + }; } + +================ +File: src/types/shared-v5.ts +================ +export type CategoryV5 = 'spot' | 'linear' | 'inverse' | 'option'; +/** Public WS subscribe/routing category. Event Contract uses `'event'`; REST `CategoryV5` does not. */ +export type WSCategoryV5 = CategoryV5 | 'event'; +export type ContractTypeV5 = + | 'InversePerpetual' + | 'LinearPerpetual' + | 'InverseFutures'; +export type CopyTradingV5 = 'none' | 'both' | 'utaOnly' | 'normalOnly'; ⋮---- -limit: number; // Required for RPI orderbook, [1, 50] +export type InstrumentStatusV5 = + | 'PreLaunch' + | 'PendingOpen' + | 'Trading' + | 'Settling' + | 'Delivering' + | 'Closed'; ⋮---- -export interface GetIndexPriceComponentsParamsV5 { - indexName: string; // Index name, like BTCUSDT -} +/** + * Region / product class returned as `symbolType` on instruments-info (and account instruments-info). + * For `category=linear`, includes e.g. `stock`, `forex`, `commodity`, `xstocks`. Spot may return `''`. + */ +export type InstrumentSymbolTypeV5 = + | '' + | 'stock' + | 'forex' + | 'commodity' + | 'xstocks'; ⋮---- -indexName: string; // Index name, like BTCUSDT +export type MarginTradingV5 = 'none' | 'both' | 'utaOnly' | 'normalSpotOnly'; ⋮---- -export interface GetADLAlertParamsV5 { - symbol?: string; // Contract name, e.g. BTCUSDT. Uppercase only -} +/** Product type for strategy APIs (create / list). */ +export type StrategyCategoryV5 = + | 'UTA_USDT' + | 'UTA_USDC' + | 'UTA_USDC_FUTURE' + | 'UTA_SPOT' + | 'UTA_INVERSE' + | 'UTA_INVERSE_FUTURE' + | 'UTA_USDT_FUTURE'; ⋮---- -symbol?: string; // Contract name, e.g. BTCUSDT. Uppercase only +export type StrategyTypeV5 = 'twap' | 'chaseOrder' | 'iceberg' | 'pov'; ⋮---- -export interface GetFeeGroupStructureParamsV5 { - productType: string; // Product type. contract only for now - groupId?: string; // Group ID. 1, 2, 3, 4, 5, 6, 7 -} +export type StrategyPreferV5 = + | 'limit' + | 'priceSpeedBalance' + | 'fastestExecution' + | 'quickExecution'; ⋮---- -productType: string; // Product type. contract only for now -groupId?: string; // Group ID. 1, 2, 3, 4, 5, 6, 7 +/** POV strategy execution mode */ +export type PovModeV5 = + | 'TradedVolume' + | 'OppositeSideLiquidity' + | 'SameSideLiquidity'; ⋮---- -export interface GetTickersParamsV5 { - category: TCategory; - symbol?: string; - baseCoin?: string; - expDate?: string; -} +export type OrderFilterV5 = 'Order' | 'tpslOrder' | 'StopOrder'; +export type OrderSideV5 = 'Buy' | 'Sell'; +export type OrderTypeV5 = 'Market' | 'Limit'; +export type OrderTimeInForceV5 = 'GTC' | 'IOC' | 'FOK' | 'PostOnly' | 'RPI'; +export type OrderTriggerByV5 = 'LastPrice' | 'IndexPrice' | 'MarkPrice'; +export type OCOTriggerTypeV5 = + | 'OcoTriggerByUnknown' + | 'OcoTriggerTp' + | 'OcoTriggerBySl'; ⋮---- -export interface GetFundingRateHistoryParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - startTime?: number; - endTime?: number; - limit?: number; -} +export type OrderSMPTypeV5 = + | 'None' + | 'CancelMaker' + | 'CancelTaker' + | 'CancelBoth'; ⋮---- -export interface GetPublicTradingHistoryParamsV5 { - category: CategoryV5; - symbol: string; - baseCoin?: string; - optionType?: OptionTypeV5; - limit?: number; -} +export type OrderStatusV5 = + | 'Created' + | 'New' + | 'Rejected' + | 'PartiallyFilled' + | 'PartiallyFilledCanceled' + | 'Filled' + | 'Cancelled' + | 'Untriggered' + | 'Triggered' + | 'Deactivated' + | 'Active'; ⋮---- -export type OpenInterestIntervalV5 = - | '5min' - | '15min' - | '30min' - | '1h' - | '4h' - | '1d'; +/** + * Defines the types of order creation mechanisms. + */ +export type OrderCreateTypeV5 = + /** Represents an order created by a user. */ + | 'CreateByUser' + /** Represents an order created by an admin closing. */ + | 'CreateByAdminClosing' + /** Futures conditional order. */ + | 'CreateByStopOrder' + /** Futures take profit order. */ + | 'CreateByTakeProfit' + /** Futures partial take profit order. */ + | 'CreateByPartialTakeProfit' + /** Futures stop loss order. */ + | 'CreateByStopLoss' + /** Futures partial stop loss order. */ + | 'CreateByPartialStopLoss' + /** Futures trailing stop order. */ + | 'CreateByTrailingStop' + /** Laddered liquidation to reduce the required maintenance margin. */ + | 'CreateByLiq' + /** + * If the position is still subject to liquidation (i.e., does not meet the required maintenance margin level), + * the position shall be taken over by the liquidation engine and closed at the bankruptcy price. + */ + | 'CreateByTakeOver_PassThrough' + /** Auto-Deleveraging(ADL) */ + | 'CreateByAdl_PassThrough' + /** Order placed via Paradigm. */ + | 'CreateByBlock_PassThrough' + /** Order created by move position. */ + | 'CreateByBlockTradeMovePosition_PassThrough' + /** The close order placed via web or app position area - web/app. */ + | 'CreateByClosing' + /** Order created via grid bot - web/app. */ + | 'CreateByFGridBot' + /** Order closed via grid bot - web/app. */ + | 'CloseByFGridBot' + /** Order created by TWAP - web/app. */ + | 'CreateByTWAP' + /** Order created by TV webhook - web/app. */ + | 'CreateByTVSignal' + /** Order created by Mm rate close function - web/app. */ + | 'CreateByMmRateClose' + /** Order created by Martingale bot - web/app. */ + | 'CreateByMartingaleBot' + /** Order closed by Martingale bot - web/app. */ + | 'CloseByMartingaleBot' + /** Order created by Ice berg strategy - web/app. */ + | 'CreateByIceBerg' + /** Order created by arbitrage - web/app. */ + | 'CreateByArbitrage' + /** Option dynamic delta hedge order - web/app */ + | 'CreateByDdh' + /** BBO Order - Best Bid/Offer order */ + | 'CreateByBboOrder'; ⋮---- -export interface GetOpenInterestParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - intervalTime: OpenInterestIntervalV5; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} +/** Represents an order created by a user. */ ⋮---- -export interface GetHistoricalVolatilityParamsV5 { - category: 'option'; - baseCoin?: string; - period?: 7 | 14 | 21 | 30 | 60 | 90 | 180 | 270; - startTime?: number; - endTime?: number; -} +/** Represents an order created by an admin closing. */ ⋮---- -export interface GetInsuranceParamsV5 { - coin?: string; -} +/** Futures conditional order. */ ⋮---- -export interface GetRiskLimitParamsV5 { - category?: 'linear' | 'inverse'; - symbol?: string; - cursor?: string; -} +/** Futures take profit order. */ ⋮---- -export interface GetOptionDeliveryPriceParamsV5 { - category: 'option'; - symbol?: string; - baseCoin?: string; - limit?: number; - cursor?: string; -} +/** Futures partial take profit order. */ ⋮---- -export interface GetDeliveryPriceParamsV5 { - category: 'linear' | 'inverse' | 'option'; - symbol?: string; - baseCoin?: string; - settleCoin?: string; - limit?: number; - cursor?: string; -} +/** Futures stop loss order. */ ⋮---- -export interface GetLongShortRatioParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - period: OpenInterestIntervalV5; - startTime?: string; - endTime?: string; - limit?: number; - cursor?: string; -} +/** Futures partial stop loss order. */ ⋮---- -export interface GetFullDepthOrderbookParamsV5 { - category: 'spot' | 'linear' | 'inverse'; - symbol: string; -} +/** Futures trailing stop order. */ ⋮---- -export interface GetOptionBaseCoinsParamsV5 { - /** - * Comma-separated underlying types. - * 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil. Omit to return all types. - */ - underlyingType?: string; -} +/** Laddered liquidation to reduce the required maintenance margin. */ ⋮---- /** - * Comma-separated underlying types. - * 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil. Omit to return all types. + * If the position is still subject to liquidation (i.e., does not meet the required maintenance margin level), + * the position shall be taken over by the liquidation engine and closed at the bankruptcy price. */ ⋮---- -export interface GetCorporateActionsParamsV5 { - category?: 'option'; - baseCoin?: string; - actionType?: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; - limit?: number; - cursor?: string; -} - -================ -File: src/types/response/v5-market.ts -================ -import { - CategoryCursorListV5, - CategoryV5, - ContractTypeV5, - CopyTradingV5, - InstrumentStatusV5, - InstrumentSymbolTypeV5, - MarginTradingV5, - OptionTypeV5, - OrderSideV5, -} from '../shared-v5'; +/** Auto-Deleveraging(ADL) */ ⋮---- -/** - * OHLCVT candle used by v5 APIs - * - * - list[0]: startTime string Start time of the candle (ms) - * - list[1]: openPrice string Open price - * - list[2]: highPrice string Highest price - * - list[3]: lowPrice string Lowest price - * - list[4]: closePrice string Close price. Is the last traded price when the candle is not closed - * - list[5]: volume string Trade volume. Unit of contract: pieces of contract. Unit of spot: quantity of coins - * - list[6]: turnover string Turnover. Unit of figure: quantity of quota coin - */ -export type OHLCVKlineV5 = [ - string, - string, - string, - string, - string, - string, - string, -]; +/** Order placed via Paradigm. */ ⋮---- -/** - * OHLC candle used by v5 APIs - * - * - list[0]: startTime string Start time of the candle (ms) - * - list[1]: openPrice string Open price - * - list[2]: highPrice string Highest price - * - list[3]: lowPrice string Lowest price - * - list[4]: closePrice string Close price. Is the last traded price when the candle is not closed - */ -export type OHLCKlineV5 = [string, string, string, string, string]; +/** Order created by move position. */ ⋮---- -export interface LinearInverseInstrumentInfoV5 { - /** The ID of the symbol name. */ - symbolId: number; - symbol: string; - contractType: ContractTypeV5; - status: InstrumentStatusV5; - baseCoin: string; - quoteCoin: string; - /** Region / product class for the pair (`stock`, `forex`, `commodity`, `xstocks`, etc.). */ - symbolType: InstrumentSymbolTypeV5; - launchTime: string; - deliveryTime?: string; - deliveryFeeRate?: string; - priceScale: string; - leverageFilter: { - minLeverage: string; - maxLeverage: string; - leverageStep: string; - }; - priceFilter: { - minPrice: string; - maxPrice: string; - tickSize: string; - }; - lotSizeFilter: { - maxOrderQty: string; - maxMktOrderQty: string; - minOrderQty: string; - qtyStep: string; - postOnlyMaxOrderQty?: string; - minNotionalValue?: string; - }; - unifiedMarginTrade: boolean; - fundingInterval: number; - settleCoin: string; - copyTrading: CopyTradingV5; - upperFundingRate: string; - lowerFundingRate: string; - riskParameters: { - priceLimitRatioX: string; - priceLimitRatioY: string; - }; - isPreListing: boolean; - preListingInfo: { - curAuctionPhase: string; - phases: { - phase: string; - startTime: string; - endTime: string; - }[]; - auctionFeeInfo: { - auctionFeeRate: string; - takerFeeRate: string; - makerFeeRate: string; - }; - } | null; - skipCallAuction?: boolean; // For USDT pre-market contract - displayName: string; - fullName?: string; - marketRegion?: string; - underlyingTicker?: string; - /** Symbol tags such as `ST`. Linear and inverse only. */ - tags?: string[]; -} +/** The close order placed via web or app position area - web/app. */ ⋮---- -/** The ID of the symbol name. */ +/** Order created via grid bot - web/app. */ ⋮---- -/** Region / product class for the pair (`stock`, `forex`, `commodity`, `xstocks`, etc.). */ +/** Order closed via grid bot - web/app. */ ⋮---- -skipCallAuction?: boolean; // For USDT pre-market contract +/** Order created by TWAP - web/app. */ ⋮---- -/** Symbol tags such as `ST`. Linear and inverse only. */ +/** Order created by TV webhook - web/app. */ ⋮---- -export interface OptionInstrumentInfoV5 { - /** The ID of the symbol name. */ - symbolId: number; - symbol: string; - optionsType: OptionTypeV5; - status: InstrumentStatusV5; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - symbolType: InstrumentSymbolTypeV5; - launchTime: string; - deliveryTime: string; - deliveryFeeRate: string; - priceFilter: { - minPrice: string; - maxPrice: string; - tickSize: string; - }; - lotSizeFilter: { - maxOrderQty: string; - minOrderQty: string; - qtyStep: string; - }; - displayName: string; -} +/** Order created by Mm rate close function - web/app. */ ⋮---- -/** The ID of the symbol name. */ +/** Order created by Martingale bot - web/app. */ ⋮---- -export interface SpotInstrumentInfoV5 { - /** The ID of the symbol name. */ - symbolId: number; - symbol: string; - baseCoin: string; - quoteCoin: string; - /** - * Xstock multiplier for `symbolType` = xstocks pairs. `stock_price = token_price / multiplier`, - * `stock_qty = token_qty * multiplier`. Default `"1"`. - */ - xstockMultiplier?: string; - symbolType: InstrumentSymbolTypeV5; - innovation: '0' | '1'; // Deprecated, always 0 - status: InstrumentStatusV5; - marginTrading: MarginTradingV5; - stTag: '0' | '1'; - lotSizeFilter: { - basePrecision: string; - quotePrecision: string; - /** - * @deprecated Spot order size is enforced by `minOrderAmt` only. - * Bybit API staff confirmed on 15 Oct 2026 that `minOrderQty` no longer - * applies for spot. Undocumented: broker and CCXT users have a 1 USDT - * minimum; direct API users have a 5 USDT minimum. - */ - minOrderQty: string; - maxOrderQty: string; - /** - * Minimum order amount in the quote coin. This is the spot minimum that - * applies. Undocumented; Bybit API staff confirmed on 15 Oct 2026 that - * broker and CCXT users have a 1 USDT minimum, and direct API users have - * a 5 USDT minimum. - */ - minOrderAmt: string; - maxOrderAmt: string; - maxLimitOrderQty: string; - maxMarketOrderQty: string; - postOnlyMaxLimitOrderSize: string; - }; - priceFilter: { - tickSize: string; - }; - riskParameters: { - priceLimitRatioX: string; - priceLimitRatioY: string; - }; - forbidUplWithdrawal: boolean; -} +/** Order closed by Martingale bot - web/app. */ ⋮---- -/** The ID of the symbol name. */ +/** Order created by Ice berg strategy - web/app. */ ⋮---- -/** - * Xstock multiplier for `symbolType` = xstocks pairs. `stock_price = token_price / multiplier`, - * `stock_qty = token_qty * multiplier`. Default `"1"`. - */ +/** Order created by arbitrage - web/app. */ ⋮---- -innovation: '0' | '1'; // Deprecated, always 0 +/** Option dynamic delta hedge order - web/app */ ⋮---- -/** - * @deprecated Spot order size is enforced by `minOrderAmt` only. - * Bybit API staff confirmed on 15 Oct 2026 that `minOrderQty` no longer - * applies for spot. Undocumented: broker and CCXT users have a 1 USDT - * minimum; direct API users have a 5 USDT minimum. - */ +/** BBO Order - Best Bid/Offer order */ ⋮---- -/** - * Minimum order amount in the quote coin. This is the spot minimum that - * applies. Undocumented; Bybit API staff confirmed on 15 Oct 2026 that - * broker and CCXT users have a 1 USDT minimum, and direct API users have - * a 5 USDT minimum. - */ +export type OrderCancelTypeV5 = + | 'CancelByUser' + | 'CancelByReduceOnly' + | 'CancelByPrepareLiq' + | 'CancelAllBeforeLiq' + | 'CancelByPrepareAdl' + | 'CancelAllBeforeAdl' + | 'CancelByAdmin' + | 'CancelByTpSlTsClear' + | 'CancelByPzSideCh' + | 'UNKNOWN'; ⋮---- -type InstrumentInfoV5Mapping = { - linear: LinearInverseInstrumentInfoV5[]; - inverse: LinearInverseInstrumentInfoV5[]; - option: OptionInstrumentInfoV5[]; - spot: SpotInstrumentInfoV5[]; -}; +export type OrderRejectReasonV5 = + | 'EC_NoError' + | 'EC_Others' + | 'EC_UnknownMessageType' + | 'EC_MissingClOrdID' + | 'EC_MissingOrigClOrdID' + | 'EC_ClOrdIDOrigClOrdIDAreTheSame' + | 'EC_DuplicatedClOrdID' + | 'EC_OrigClOrdIDDoesNotExist' + | 'EC_TooLateToCancel' + | 'EC_UnknownOrderType' + | 'EC_UnknownSide' + | 'EC_UnknownTimeInForce' + | 'EC_WronglyRouted' + | 'EC_MarketOrderPriceIsNotZero' + | 'EC_LimitOrderInvalidPrice' + | 'EC_NoEnoughQtyToFill' + | 'EC_NoImmediateQtyToFill' + | 'EC_PerCancelRequest' + | 'EC_MarketOrderCannotBePostOnly' + | 'EC_PostOnlyWillTakeLiquidity' + | 'EC_CancelReplaceOrder' + | 'EC_InvalidSymbolStatus'; ⋮---- -export type InstrumentInfoResponseV5 = - CategoryCursorListV5; +export type StopOrderTypeV5 = + | 'TakeProfit' + | 'StopLoss' + | 'TrailingStop' + | 'Stop' + | 'PartialTakeProfit' + | 'PartialStopLoss' + | 'tpslOrder' + | 'OcoOrder' + | 'MmRateClose' + | 'BidirectionalTpslOrder'; ⋮---- /** - * One row from GET /v5/market/instrument-summary. + * Position index. Used to identify positions in different position modes. * - * Several fields are an empty string when they do not apply (`fullName`, - * `marketRegion`, and `underlyingTicker` for option; `priceIndex` for linear). + * - 0 one-way mode position + * - 1 Buy side of hedge-mode position + * - 2 Sell side of hedge-mode position */ -export interface InstrumentSummaryV5 { - symbol: string; - /** Instrument type. May be an empty string. */ - symbolType: string; - /** Display name shown in the UI. */ - displayName: string; - baseCoin: string; - settleCoin: string; - /** Full name. Empty string for `option`. */ - fullName: string; - /** - * Market region of the underlying asset (`US`, `CN`, `HK`, `KR`, and others). - * Empty string for `option` or when not applicable. - */ - marketRegion: string; - /** - * Stock ticker, security code, or asset symbol in the underlying market. - * Empty string for `option`. - */ - underlyingTicker: string; - /** - * TradFi perpetual symbol used as the price index. NVDA options use `NVDAUSDT`. - * Empty string for `linear`. - */ - priceIndex: string; - qtyStep: string; - tickSize: string; - /** Delivery timestamp in milliseconds. `"0"` for `linear`. */ - deliveryTime: string; -} -⋮---- -/** Instrument type. May be an empty string. */ -⋮---- -/** Display name shown in the UI. */ -⋮---- -/** Full name. Empty string for `option`. */ +export type PositionIdx = 0 | 1 | 2; ⋮---- /** - * Market region of the underlying asset (`US`, `CN`, `HK`, `KR`, and others). - * Empty string for `option` or when not applicable. - */ + * Position status. + * + * - 'Normal' + * - 'Liq' in the liquidation progress + * - 'Adl' in the auto-deleverage progress + */ +export type PositionStatusV5 = 'Normal' | 'Liq' | 'Adl'; +export type PositionSideV5 = 'Buy' | 'Sell' | 'None' | ''; ⋮---- -/** - * Stock ticker, security code, or asset symbol in the underlying market. - * Empty string for `option`. - */ +export type OptionTypeV5 = 'Call' | 'Put'; ⋮---- /** - * TradFi perpetual symbol used as the price index. NVDA options use `NVDAUSDT`. - * Empty string for `linear`. - */ -⋮---- -/** Delivery timestamp in milliseconds. `"0"` for `linear`. */ -⋮---- -export type InstrumentSummaryResponseV5 = CategoryCursorListV5< - InstrumentSummaryV5[], - 'linear' | 'option' ->; -⋮---- -// Account Instruments Info (includes RPI permissions) -export interface AccountSpotInstrumentInfoV5 extends SpotInstrumentInfoV5 { - isPublicRpi: boolean; - myRpiPermission: boolean; -} + * Trade mode. + * + * - 0 cross-margin, + * - 1 isolated margin + */ +export type TradeModeV5 = 0 | 1; ⋮---- -export interface AccountLinearInverseInstrumentInfoV5 - extends LinearInverseInstrumentInfoV5 { - isPublicRpi: boolean; - myRpiPermission: boolean; -} +export type TPSLModeV5 = 'Full' | 'Partial'; +export type AccountMarginModeV5 = + | 'ISOLATED_MARGIN' + | 'REGULAR_MARGIN' + | 'PORTFOLIO_MARGIN'; +export type UnifiedUpdateStatusV5 = 'FAIL' | 'PROCESS' | 'SUCCESS'; ⋮---- -type AccountInstrumentInfoV5Mapping = { - linear: AccountLinearInverseInstrumentInfoV5[]; - inverse: AccountLinearInverseInstrumentInfoV5[]; - spot: AccountSpotInstrumentInfoV5[]; -}; +export type AccountTypeV5 = + | 'CONTRACT' + | 'SPOT' + | 'INVESTMENT' + | 'OPTION' + | 'UNIFIED' + | 'FUND' + | 'EARN'; ⋮---- -export type AccountInstrumentInfoResponseV5< - C extends 'spot' | 'linear' | 'inverse', -> = CategoryCursorListV5; +export type TransactionTypeV5 = + | 'TRANSFER_IN' + | 'TRANSFER_OUT' + | 'TRADE' + | 'SETTLEMENT' + | 'DELIVERY' + | 'LIQUIDATION' + | 'ADL' + | 'AIRDROP' + | 'BONUS_RECOLLECT' + | 'BONUS_RECOLLECT' + | 'FEE_REFUND' + | 'INTEREST' + | 'CURRENCY_BUY' + | 'CURRENCY_SELL' + | 'BORROWED_AMOUNT_INS_LOAN' + | 'PRINCIPLE_REPAYMENT_INS_LOAN' + | 'INTEREST_REPAYMENT_INS_LOAN' + | 'AUTO_SOLD_COLLATERAL_INS_LOAN' + | 'AUTO_BUY_LIABILITY_INS_LOAN' + | 'AUTO_PRINCIPLE_REPAYMENT_INS_LOAN' + | 'AUTO_INTEREST_REPAYMENT_INS_LOAN' + | 'TRANSFER_IN_INS_LOAN' + | 'TRANSFER_OUT_INS_LOAN' + | 'SPOT_REPAYMENT_SELL' + | 'SPOT_REPAYMENT_BUY' + | 'TOKENS_SUBSCRIPTION' + | 'TOKENS_REDEMPTION' + | 'AUTO_DEDUCTION' + | 'FLEXIBLE_STAKING_SUBSCRIPTION' + | 'FLEXIBLE_STAKING_REDEMPTION' + | 'FIXED_STAKING_SUBSCRIPTION' + | 'BORROWED_AMOUNT_INS_LOAN' + | 'PRINCIPLE_REPAYMENT_INS_LOAN' + | 'INTEREST_REPAYMENT_INS_LOAN' + | 'AUTO_SOLD_COLLATERAL_INS_LOAN' + | 'AUTO_BUY_LIABILITY_INS_LOAN' + | 'AUTO_PRINCIPLE_REPAYMENT_INS_LOAN' + | 'AUTO_INTEREST_REPAYMENT_INS_LOAN' + | 'TRANSFER_IN_INS_LOAN' + | 'TRANSFER_OUT_INS_LOAN' + | 'SPOT_REPAYMENT_SELL' + | 'SPOT_REPAYMENT_BUY' + | 'TOKENS_SUBSCRIPTION' + | 'TOKENS_REDEMPTION' + | 'AUTO_DEDUCTION' + | 'FLEXIBLE_STAKING_SUBSCRIPTION' + | 'FLEXIBLE_STAKING_REDEMPTION' + | 'FIXED_STAKING_SUBSCRIPTION' + | 'FLEXIBLE_STAKING_REFUND' + | 'FIXED_STAKING_REFUND' + | 'PREMARKET_TRANSFER_OUT' + | 'PREMARKET_DELIVERY_SELL_NEW_COIN' + | 'PREMARKET_DELIVERY_BUY_NEW_COIN' + | 'PREMARKET_DELIVERY_PLEDGE_PAY_SELLER' + | 'PREMARKET_DELIVERY_PLEDGE_BACK' + | 'PREMARKET_ROLLBACK_PLEDGE_BACK' + | 'PREMARKET_ROLLBACK_PLEDGE_PENALTY_TO_BUYER' + | 'CUSTODY_NETWORK_FEE' + | 'CUSTODY_SETTLE_FEE' + | 'CUSTODY_LOCK' + | 'CUSTODY_UNLOCK' + | 'CUSTODY_UNLOCK_REFUND' + | 'LOANS_BORROW_FUNDS' + | 'LOANS_PLEDGE_ASSET' + | 'BONUS_TRANSFER_IN' + | 'BONUS_TRANSFER_OUT' + | 'PEF_TRANSFER_IN' + | 'PEF_TRANSFER_OUT' + | 'PEF_PROFIT_SHARE' + | 'ONCHAINEARN_SUBSCRIPTION' + | 'ONCHAINEARN_REDEMPTION' + | 'ONCHAINEARN_REFUND' + | 'STRUCTURE_PRODUCT_SUBSCRIPTION' + | 'STRUCTURE_PRODUCT_REFUND' + | 'CLASSIC_WEALTH_MANAGEMENT_SUBSCRIPTION' + | 'PREMIMUM_WEALTH_MANAGEMENT_SUBSCRIPTION' + | 'PREMIMUM_WEALTH_MANAGEMENT_REFUND' + | 'LIQUIDITY_MINING_SUBSCRIPTION' + | 'LIQUIDITY_MINING_REFUND' + | 'PWM_SUBSCRIPTION' + | 'PWM_REFUND' + | 'DEFI_INVESTMENT_SUBSCRIPTION' + | 'DEFI_INVESTMENT_REFUND' + | 'DEFI_INVESTMENT_REDEMPTION' + | 'INSTITUTION_LOAN_IN' + | 'INSTITUTION_PAYBACK_PRINCIPAL_OUT' + | 'INSTITUTION_PAYBACK_INTEREST_OUT' + | 'INSTITUTION_EXCHANGE_SELL' + | 'INSTITUTION_EXCHANGE_BUY' + | 'INSTITUTION_LIQ_PRINCIPAL_OUT' + | 'INSTITUTION_LIQ_INTEREST_OUT' + | 'INSTITUTION_LOAN_TRANSFER_IN' + | 'INSTITUTION_LOAN_TRANSFER_OUT' + | 'INSTITUTION_LOAN_WITHOUT_WITHDRAW' + | 'INSTITUTION_LOAN_RESERVE_IN' + | 'INSTITUTION_LOAN_RESERVE_OUT' + | 'PLATFORM_TOKEN_MNT_LIQRECALLEDMMNT' + | 'PLATFORM_TOKEN_MNT_LIQRETURNEDMNT' + | 'DIVIDEND_SETTLEMENT' + /** + * Forward stock split settlement. Closes the entire existing position; the + * new position is opened as `FORWARD_SPLIT_OPEN`. + * + * Changelog 2026-10-13 updated this description. The enum glossary still + * lists the older wording "fractional share settlement". + */ + | 'FORWARD_SPLIT_SETTLE' + /** Forward stock split position opening after the existing position is settled and closed. */ + | 'FORWARD_SPLIT_OPEN' + /** + * Reverse stock split settlement. Closes the entire existing position; the + * new position is opened as `REVERSE_SPLIT_OPEN`. + * + * Changelog 2026-10-13 updated this description. The enum glossary still + * lists the older wording "fractional share settlement". + */ + | 'REVERSE_SPLIT_SETTLE' + /** Reverse stock split position opening after the existing position is settled and closed. */ + | 'REVERSE_SPLIT_OPEN'; ⋮---- /** - * [price, size] - */ -export type OrderbookLevelV5 = [string, string]; + * Forward stock split settlement. Closes the entire existing position; the + * new position is opened as `FORWARD_SPLIT_OPEN`. + * + * Changelog 2026-10-13 updated this description. The enum glossary still + * lists the older wording "fractional share settlement". + */ ⋮---- -export interface OrderbookResponseV5 { - s: string; - b: OrderbookLevelV5[]; - a: OrderbookLevelV5[]; - ts: number; - u: number; - seq: number; - cts: number; -} +/** Forward stock split position opening after the existing position is settled and closed. */ ⋮---- /** - * RPI Orderbook level: [price, nonRpiSize, rpiSize] - */ -export type RPIOrderbookLevelV5 = [string, string, string]; -⋮---- -export interface RPIOrderbookResponseV5 { - s: string; // Symbol name - b: RPIOrderbookLevelV5[]; // Bids. Sorted by price in descending order - a: RPIOrderbookLevelV5[]; // Asks. Sorted by price in ascending order - ts: number; // The timestamp (ms) that the system generates the data - u: number; // Update ID, is always in sequence corresponds to u in the 50-level WebSocket RPI orderbook stream - seq: number; // Cross sequence - cts: number; // The timestamp from the matching engine when this orderbook data is produced -} -⋮---- -s: string; // Symbol name -b: RPIOrderbookLevelV5[]; // Bids. Sorted by price in descending order -a: RPIOrderbookLevelV5[]; // Asks. Sorted by price in ascending order -ts: number; // The timestamp (ms) that the system generates the data -u: number; // Update ID, is always in sequence corresponds to u in the 50-level WebSocket RPI orderbook stream -seq: number; // Cross sequence -cts: number; // The timestamp from the matching engine when this orderbook data is produced -⋮---- -export interface TickerLinearInverseV5 { - symbol: string; - lastPrice: string; - indexPrice: string; - markPrice: string; - prevPrice24h: string; - price24hPcnt: string; - highPrice24h: string; - lowPrice24h: string; - prevPrice1h: string; - openInterest: string; - openInterestValue: string; - singleOpenInterest?: string; - singleOpenInterestValue?: string; - turnover24h: string; - volume24h: string; - fundingRate: string; - nextFundingTime: string; - predictedDeliveryPrice: string; - basisRate: string; - basisRateYear: string; - fundingIntervalHour: string; - fundingCap: string; - deliveryFeeRate: string; - deliveryTime: string; - ask1Size: string; - bid1Price: string; - ask1Price: string; - bid1Size: string; - preOpenPrice: string; - preQty: string; - curPreListingPhase: string; - basis: string; -} -⋮---- -export interface TickerOptionV5 { - symbol: string; - bid1Price: string; - bid1Size: string; - bid1Iv: string; - ask1Price: string; - ask1Size: string; - ask1Iv: string; - lastPrice: string; - highPrice24h: string; - lowPrice24h: string; - markPrice: string; - indexPrice: string; - markIv: string; - underlyingPrice: string; - openInterest: string; - turnover24h: string; - volume24h: string; - totalVolume: string; - totalTurnover: string; - delta: string; - gamma: string; - vega: string; - theta: string; - predictedDeliveryPrice: string; - change24h: string; -} -⋮---- -export interface TickerSpotV5 { - symbol: string; - bid1Price: string; - bid1Size: string; - ask1Price: string; - ask1Size: string; - lastPrice: string; - prevPrice24h: string; - price24hPcnt: string; - highPrice24h: string; - lowPrice24h: string; - turnover24h: string; - volume24h: string; - usdIndexPrice: string; -} + * Reverse stock split settlement. Closes the entire existing position; the + * new position is opened as `REVERSE_SPLIT_OPEN`. + * + * Changelog 2026-10-13 updated this description. The enum glossary still + * lists the older wording "fractional share settlement". + */ ⋮---- -export interface FundingRateHistoryResponseV5 { - symbol: string; - fundingRate: string; - fundingRateTimestamp: string; -} +/** Reverse stock split position opening after the existing position is settled and closed. */ ⋮---- -export interface PublicTradeV5 { - execId: string; - symbol: string; - price: string; - size: string; - side: OrderSideV5; - time: string; - isBlockTrade: boolean; - isRPITrade: boolean; - mP?: string; - iP?: string; - mIv?: string; - iv?: string; - seq?: string; -} +export type PermissionTypeV5 = + | 'ContractTrade' + | 'Spot' + | 'Wallet' + | 'Options' + | 'Derivatives' + | 'Exchange' + | 'NFT'; ⋮---- /** + * Leveraged token status: * - * - openInterest string Open interest - * - timestamp string The timestamp (ms) + * - '1' LT can be purchased and redeemed + * - '2' LT can be purchased, but not redeemed + * - '3' LT can be redeemed, but not purchased + * - '4' LT cannot be purchased nor redeemed + * - '5' Adjusting position */ -export type OpenInterestV5 = { - openInterest: string; - singleOpenInterest?: string; - timestamp: string; -}; -⋮---- -export interface OpenInterestResponseV5 { - category: 'linear' | 'inverse'; - symbol: string; - list: OpenInterestV5[]; - nextPageCursor?: string; -} -⋮---- -export interface HistoricalVolatilityV5 { - period: number; - value: string; - time: string; -} -⋮---- -export interface InsuranceDataV5 { - coin: string; - symbols: string; - balance: string; - value: string; -} -⋮---- -export interface InsuranceResponseV5 { - updatedTime: string; - list: InsuranceDataV5[]; -} -⋮---- -export interface RiskLimitV5 { - id: number; - symbol: string; - riskLimitValue: string; - maintenanceMargin: number; - initialMargin: number; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - section: any; - isLowestRisk: 0 | 1; - maxLeverage: string; - mmDeduction: string; - nextPageCursor?: string; -} +export type LeverageTokenStatusV5 = '1' | '2' | '3' | '4' | '5'; ⋮---- -// eslint-disable-next-line @typescript-eslint/no-explicit-any +/** + * Leveraged token order type: '1': purchase, '2': redeem + */ +export type LTOrderTypeV5 = '1' | '2'; ⋮---- -/** @deprecated use DeliveryPriceV5 instead */ -export interface OptionDeliveryPriceV5 { - symbol: string; - deliveryPrice: string; - deliveryTime: string; -} +/** + * Leveraged token order status: '1': completed, '2': in progress, '3': failed + */ +export type LTOrderStatusV5 = '1' | '2' | '3'; ⋮---- -export interface DeliveryPriceV5 { - symbol: string; - deliveryPrice: string; - deliveryTime: string; -} +export type ExecTypeV5 = + | 'Trade' + | 'AdlTrade' + | 'Funding' + | 'BustTrade' + | 'Settle' + | 'BlockTrade' + | 'MovePosition' + /** @deprecated Removed from Bybit execType; kept for older payloads. */ + | 'CorporateAction' + /** + * Forward stock split settlement and closure of the entire existing position, + * followed by opening a new position (`ForwardSplitOpen`). + */ + | 'ForwardSplitSettle' + /** Forward stock split position opening after the existing position is settled and closed. */ + | 'ForwardSplitOpen' + /** + * Reverse stock split settlement and closure of the entire existing position, + * followed by opening a new position (`ReverseSplitOpen`). + */ + | 'ReverseSplitSettle' + /** Reverse stock split position opening after the existing position is settled and closed. */ + | 'ReverseSplitOpen' + | 'Dividend' + | 'UNKNOWN'; ⋮---- -export interface LongShortRatioV5 { - symbol: string; - buyRatio: string; - sellRatio: string; - timestamp: string; -} +/** @deprecated Removed from Bybit execType; kept for older payloads. */ ⋮---- -export interface OrderPriceLimitV5 { - symbol: string; - buyLmt: string; - sellLmt: string; - ts: string; -} +/** + * Forward stock split settlement and closure of the entire existing position, + * followed by opening a new position (`ForwardSplitOpen`). + */ ⋮---- -export interface IndexPriceComponentV5 { - exchange: string; // Name of the exchange - spotPair: string; // Spot trading pair on the exchange (e.g., BTCUSDT) - equivalentPrice: string; // Equivalent price - multiplier: string; // Multiplier used for the component price - price: string; // Actual price - weight: string; // Weight in the index calculation -} +/** Forward stock split position opening after the existing position is settled and closed. */ ⋮---- -exchange: string; // Name of the exchange -spotPair: string; // Spot trading pair on the exchange (e.g., BTCUSDT) -equivalentPrice: string; // Equivalent price -multiplier: string; // Multiplier used for the component price -price: string; // Actual price -weight: string; // Weight in the index calculation +/** + * Reverse stock split settlement and closure of the entire existing position, + * followed by opening a new position (`ReverseSplitOpen`). + */ ⋮---- -export interface IndexPriceComponentsResponseV5 { - indexName: string; // Name of the index (e.g., BTCUSDT) - lastPrice: string; // Last price of the index - updateTime: string; // Timestamp of the last update in milliseconds - components: IndexPriceComponentV5[]; // List of components contributing to the index price -} +/** Reverse stock split position opening after the existing position is settled and closed. */ ⋮---- -indexName: string; // Name of the index (e.g., BTCUSDT) -lastPrice: string; // Last price of the index -updateTime: string; // Timestamp of the last update in milliseconds -components: IndexPriceComponentV5[]; // List of components contributing to the index price +/** + * Withdraw type. 0(default): on chain. 1: off chain. 2: all. + */ +export type WithdrawalTypeV5 = '0' | '1' | '2'; ⋮---- -export interface ADLAlertItemV5 { - coin: string; // Token of the insurance pool - symbol: string; // Trading pair name - balance: string; // Balance of the insurance fund. Used to determine if ADL is triggered - maxBalance: string; // Maximum balance of the insurance pool in the last 8 hours - insurancePnlRatio: string; // PnL ratio threshold for triggering contract PnL drawdown ADL - pnlRatio: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped - adlTriggerThreshold: string; // Trigger threshold for contract PnL drawdown ADL - adlStopRatio: string; // Stop ratio threshold for contract PnL drawdown ADL +export interface PermissionsV5 { + ContractTrade?: string[]; + Spot?: string[]; + Wallet?: string[]; + Options?: string[]; + Derivatives?: string[]; + CopyTrading?: string[]; + BlockTrade?: string[]; + Exchange?: string[]; + /** @deprecated , always returns []*/ + NFT?: string[]; + Earn?: string[]; + Affiliate?: string[]; + FiatP2P?: string[]; + /** Bybit Pay (FaitPayOrder) */ + FiatBitPay?: string[]; + FiatConvertBroker?: string[]; + BitCard?: string[]; + ByXPost?: string[]; + /** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] revokes permission */ + Compliance?: string[]; } ⋮---- -coin: string; // Token of the insurance pool -symbol: string; // Trading pair name -balance: string; // Balance of the insurance fund. Used to determine if ADL is triggered -maxBalance: string; // Maximum balance of the insurance pool in the last 8 hours -insurancePnlRatio: string; // PnL ratio threshold for triggering contract PnL drawdown ADL -pnlRatio: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped -adlTriggerThreshold: string; // Trigger threshold for contract PnL drawdown ADL -adlStopRatio: string; // Stop ratio threshold for contract PnL drawdown ADL +/** @deprecated , always returns []*/ ⋮---- -export interface ADLAlertResponseV5 { - updateTime: string; // Latest data update timestamp (ms) - list: ADLAlertItemV5[]; // List of ADL alert items -} +/** Bybit Pay (FaitPayOrder) */ ⋮---- -updateTime: string; // Latest data update timestamp (ms) -list: ADLAlertItemV5[]; // List of ADL alert items +/** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] revokes permission */ ⋮---- -export interface FeeGroupLevelV5 { - level: string; // Pro level name or Market Maker level name - takerFeeRate: string; // Taker fee rate - makerFeeRate: string; // Maker fee rate - makerRebate: string; // Maker rebate fee rate - rpiMakerRebate?: string; +export interface CategoryCursorListV5< + T extends unknown[], + TCategory extends CategoryV5 = CategoryV5, +> { + category: TCategory; + list: T; + nextPageCursor?: string; } ⋮---- -level: string; // Pro level name or Market Maker level name -takerFeeRate: string; // Taker fee rate -makerFeeRate: string; // Maker fee rate -makerRebate: string; // Maker rebate fee rate -⋮---- -export interface FeeGroupRatesV5 { - pro: FeeGroupLevelV5[]; // Pro-level fee structures - marketMaker: FeeGroupLevelV5[]; // Market Maker-level fee structures +/** + * Next page cursor does not exist for spot! + */ +export interface CursorListV5 { + nextPageCursor: string; + list: T; } ⋮---- -pro: FeeGroupLevelV5[]; // Pro-level fee structures -marketMaker: FeeGroupLevelV5[]; // Market Maker-level fee structures -⋮---- -export interface FeeGroupItemV5 { - groupName: string; // Fee group name - weightingFactor: number; // Group weighting factor - symbolsNumbers: number; // Symbols number - symbols: string[]; // Symbol names - feeRates: FeeGroupRatesV5; // Fee rate details for different categories - updateTime: string; // Latest data update timestamp (ms) +/** + * A wrapper type for any responses that have a "nextPageCursor" property, and a "rows" property with an array of elements + * + * ```{ nextPageCursor: "something", rows: someData[] }``` + */ +export interface CursorRowsV5 { + nextPageCursor: string; + rows: T; } ⋮---- -groupName: string; // Fee group name -weightingFactor: number; // Group weighting factor -symbolsNumbers: number; // Symbols number -symbols: string[]; // Symbol names -feeRates: FeeGroupRatesV5; // Fee rate details for different categories -updateTime: string; // Latest data update timestamp (ms) -⋮---- -export interface FeeGroupStructureResponseV5 { - list: FeeGroupItemV5[]; // List of fee group objects +export interface CategoryListV5< + T extends unknown[], + TCategory extends CategoryV5, +> { + category: TCategory; + list: T; } ⋮---- -list: FeeGroupItemV5[]; // List of fee group objects -⋮---- -export interface OptionBaseCoinV5 { - baseCoin: string; - quoteCoin: string; - settleCoin: string; - optionShowName: string; - /** UTC milliseconds. 0 when the option is not scheduled. */ - optionOnlineTime: number; - /** 1 when tradable option symbols exist, otherwise 0 */ - hasSymbol: 0 | 1; - /** 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil */ - underlyingType: 0 | 1 | 2 | 3 | 4; +export interface CategorySymbolListV5< + T extends unknown[], + TCategory extends CategoryV5, +> { + category: TCategory; + symbol: string; + list: T; } ⋮---- -/** UTC milliseconds. 0 when the option is not scheduled. */ -⋮---- -/** 1 when tradable option symbols exist, otherwise 0 */ -⋮---- -/** 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil */ -⋮---- -export interface OptionBaseCoinsResultV5 { - list: OptionBaseCoinV5[]; +export interface GetSystemStatusParamsV5 { + id?: string; + state?: string; } ⋮---- -export interface CorporateActionV5 { - category?: 'option'; - symbol: string; - baseCoin: string; - actionType: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; - status: string; - effectiveTime: number; - details: { - splitFactor?: string; - splitType?: 'FORWARD' | 'REVERSE'; - dividendAmountPerShare?: string; - dividendCurrency?: string; - installmentCount?: number; - installmentAmountPerShare?: string; - installmentCoin?: string; - firstSettlementTimeUtc?: number; - installments?: { - installmentNo: number; - settlementTimeUtc: number; - status: string; - }[]; - }; +export interface SystemStatusItemV5 { + id: string; + title: string; + state: string; + begin: string; + end: string; + href: string; + serviceTypes: number[]; + product: number[]; + uidSuffix: number[]; + maintainType: string; + env: string; } ================ @@ -16687,6 +16720,8 @@ import { BrokerRateLimitCapItemV5, BrokerRateLimitSetResultItemV5, BrokerVoucherSpecV5, + CancelAllEventQuotesParamsV5, + CancelAllEventQuotesResultV5, CancelAllOrdersParamsV5, CancelAllRFQResultV5, CancelBorrowOrderFixedParamsV5, @@ -17191,6 +17226,7 @@ import { SettlePwmFundProfitParamsV5, SettlePwmFundProfitResultV5, SetTPSLModeParamsV5, + SetTradeAutoRepayParamsV5, SetTradingStopParamsV5, SignAgreementParamsV5, SmallBalanceListV5, @@ -17235,6 +17271,7 @@ import { TokenSplashUserActivityResultV5, TotalMembersAssetsResultV5, TPSLModeV5, + TradeAutoRepayResultV5, TradeInfoForAnalysisResultV5, TransactionLogV5, UnifiedAccountUpgradeResultV5, @@ -17294,8 +17331,7 @@ getSystemStatus(params?: GetSystemStatusParamsV5): Promise< APIResponseV3WithTime<{ list: SystemStatusItemV5[]; }> - > { - return this.getPrivate('/v5/system/status', params); + > ⋮---- getClientType() ⋮---- @@ -17303,8 +17339,7 @@ async fetchServerTime(): Promise ⋮---- getServerTime(): Promise< APIResponseV3WithTime<{ timeSecond: string; timeNano: string }> - > { - return this.get('/v5/market/time'); + > ⋮---- /** * @@ -17318,12 +17353,12 @@ requestDemoTradingFunds(params?: { coin: string; amountStr: string; }>; -}): Promise> ⋮---- /** * Create a demo trading account. */ -createDemoAccount(): Promise> ⋮---- /** * @@ -17339,8 +17374,7 @@ getSpreadInstrumentsInfo(params?: GetSpreadInstrumentsInfoParamsV5): Promise< list: SpreadInstrumentInfoV5[]; nextPageCursor: string; }> - > { - return this.get('/v5/spread/instrument', params); + > ⋮---- /** * Get Spread Orderbook @@ -17348,7 +17382,7 @@ getSpreadInstrumentsInfo(params?: GetSpreadInstrumentsInfoParamsV5): Promise< getSpreadOrderbook(params: { symbol: string; limit?: number; -}): Promise> + }): Promise> ⋮---- /** * Get Spread Tickers @@ -17357,8 +17391,7 @@ getSpreadTickers(params: { symbol: string }): Promise< APIResponseV3WithTime<{ list: SpreadTickerV5[]; }> - > { - return this.get('/v5/spread/tickers', params); + > ⋮---- /** * Get Spread Public Recent Trades @@ -17367,8 +17400,7 @@ getSpreadRecentTrades(params: { symbol: string; limit?: number }): Promise< APIResponseV3WithTime<{ list: SpreadRecentTradeV5[]; }> - > { - return this.get('/v5/spread/recent-trade', params); + > ⋮---- /** * Get Spread Max Qty @@ -17376,7 +17408,7 @@ getSpreadRecentTrades(params: { symbol: string; limit?: number }): Promise< */ getSpreadMaxQty( params: GetSpreadMaxQtyParamsV5, -): Promise> + ): Promise> ⋮---- /** * Create Spread Order @@ -17386,8 +17418,7 @@ submitSpreadOrder(params: SubmitSpreadOrderParamsV5): Promise< orderId: string; orderLinkId: string; }> - > { - return this.postPrivate('/v5/spread/order/create', params); + > ⋮---- /** * Amend Spread Order @@ -17398,8 +17429,7 @@ amendSpreadOrder(params: AmendSpreadOrderParamsV5): Promise< orderId: string; orderLinkId: string; }> - > { - return this.postPrivate('/v5/spread/order/amend', params); + > ⋮---- /** * Cancel Spread Order @@ -17412,8 +17442,7 @@ cancelSpreadOrder(params: { orderId: string; orderLinkId: string; }> - > { - return this.postPrivate('/v5/spread/order/cancel', params); + > ⋮---- /** * Cancel All Spread Orders @@ -17432,8 +17461,7 @@ cancelAllSpreadOrders(params?: { }[]; success: string; }> - > { - return this.postPrivate('/v5/spread/order/cancel-all', params); + > ⋮---- /** * Get Spread Open Orders @@ -17444,8 +17472,7 @@ getSpreadOpenOrders(params?: GetSpreadOpenOrdersParamsV5): Promise< list: SpreadOpenOrderV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/spread/order/realtime', params); + > ⋮---- /** * Get Spread Order History @@ -17454,14 +17481,17 @@ getSpreadOpenOrders(params?: GetSpreadOpenOrdersParamsV5): Promise< * - orderId & orderLinkId has a higher priority than startTime & endTime * - Fully canceled orders are stored for up to 24 hours * - Single leg orders can also be found with "createType"=CreateByFutureSpread via Get Order History + * - From 2026-11-12, omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * Pass orderStatus explicitly to retrieve matching orders from that period. + * Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 */ getSpreadOrderHistory(params?: GetSpreadOrderHistoryParamsV5): Promise< APIResponseV3WithTime<{ list: SpreadOrderHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/spread/order/history', params); + > ⋮---- /** * Get Spread Trade History @@ -17475,8 +17505,7 @@ getSpreadTradeHistory(params?: GetSpreadTradeHistoryParamsV5): Promise< list: SpreadTradeV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/spread/execution/list', params); + > ⋮---- /** * @@ -17495,8 +17524,7 @@ getKline( APIResponseV3WithTime< CategorySymbolListV5 > - > { - return this.get('/v5/market/kline', params); + > ⋮---- /** * Query the mark price kline data. Charts are returned in groups based on the requested interval. @@ -17511,8 +17539,7 @@ getMarkPriceKline( APIResponseV3WithTime< CategorySymbolListV5 > - > { - return this.get('/v5/market/mark-price-kline', params); + > ⋮---- /** * Query the index price kline data. Charts are returned in groups based on the requested interval. @@ -17525,8 +17552,7 @@ getIndexPriceKline( APIResponseV3WithTime< CategorySymbolListV5 > - > { - return this.get('/v5/market/index-price-kline', params); + > ⋮---- /** * Retrieve the premium index price kline data. Charts are returned in groups based on the requested interval. @@ -17537,8 +17563,7 @@ getPremiumIndexPriceKline( params: GetPremiumIndexPriceKlineParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.get('/v5/market/premium-index-price-kline', params); + > ⋮---- /** * Query a list of instruments of online trading pair. @@ -17550,7 +17575,7 @@ getPremiumIndexPriceKline( */ getInstrumentsInfo( params: GetInstrumentsInfoParamsV5 & { category: C }, -): Promise>> + ): Promise>> ⋮---- /** * Query summary information and trading increments for linear and option instruments. @@ -17562,7 +17587,7 @@ getInstrumentsInfo( */ getInstrumentSummary( params: GetInstrumentSummaryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query orderbook data @@ -17571,11 +17596,11 @@ getInstrumentSummary( */ getOrderbook( params: GetOrderbookParamsV5, -): Promise> + ): Promise> ⋮---- getFullDepthOrderbook( params: GetFullDepthOrderbookParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get RPI Orderbook @@ -17587,7 +17612,7 @@ getFullDepthOrderbook( */ getRPIOrderbook( params: GetRPIOrderbookParamsV5, -): Promise> + ): Promise> ⋮---- getTickers( ⋮---- @@ -17612,8 +17637,7 @@ getTickers( | CategoryListV5 | CategoryListV5 > - > { - return this.get('/v5/market/tickers', params); + > ⋮---- /** * Query historical funding rate. Each symbol has a different funding interval. @@ -17626,8 +17650,7 @@ getFundingRateHistory( APIResponseV3WithTime< CategoryListV5 > - > { - return this.get('/v5/market/funding/history', params); + > ⋮---- /** * Query recent public trading data in Bybit. @@ -17638,8 +17661,7 @@ getPublicTradingHistory( params: GetPublicTradingHistoryParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.get('/v5/market/recent-trade', params); + > ⋮---- /** * Get open interest of each symbol. @@ -17648,7 +17670,7 @@ getPublicTradingHistory( */ getOpenInterest( params: GetOpenInterestParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query option historical volatility @@ -17658,15 +17680,14 @@ getHistoricalVolatility( params: GetHistoricalVolatilityParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.get('/v5/market/historical-volatility', params); + > ⋮---- /** * Query Bybit insurance pool data (BTC/USDT/USDC etc). The data is updated every 24 hours. */ getInsurance( params?: GetInsuranceParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query risk limit of futures @@ -17677,8 +17698,7 @@ getRiskLimit( params?: GetRiskLimitParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.get('/v5/market/risk-limit', params); + > ⋮---- /** * Get the delivery price for option @@ -17691,8 +17711,7 @@ getOptionDeliveryPrice( params: GetOptionDeliveryPriceParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.get('/v5/market/delivery-price', params); + > ⋮---- /** * Get the delivery price of Inverse futures, USDC futures and Options @@ -17701,7 +17720,7 @@ getOptionDeliveryPrice( */ getDeliveryPrice( params: GetDeliveryPriceParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get New Delivery Price @@ -17725,12 +17744,11 @@ getNewDeliveryPrice(params: { deliveryTime: string; }[]; }> - > { - return this.get('/v5/market/new-delivery-price', params); + > ⋮---- getLongShortRatio( params: GetLongShortRatioParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get Index Price Components @@ -17738,12 +17756,12 @@ getLongShortRatio( */ getIndexPriceComponents( params: GetIndexPriceComponentsParamsV5, -): Promise> + ): Promise> ⋮---- getOrderPriceLimit(params: { symbol: string; category: 'spot' | 'linear' | 'inverse'; -}): Promise> + }): Promise> ⋮---- /** * Get ADL Alert @@ -17754,7 +17772,7 @@ getOrderPriceLimit(params: { */ getADLAlert( params?: GetADLAlertParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Fee Group Structure @@ -17765,22 +17783,21 @@ getADLAlert( */ getFeeGroupStructure( params: GetFeeGroupStructureParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query option base coins, display names, launch times, and tradable symbol availability. */ getOptionBaseCoins( params?: GetOptionBaseCoinsParamsV5, -): Promise> + ): Promise> ⋮---- getCorporateActions(params?: GetCorporateActionsParamsV5): Promise< APIResponseV3WithTime<{ list: CorporateActionV5[]; nextPageCursor: string; }> - > { - return this.get('/v5/market/corporate-action', params); + > ⋮---- /** * @@ -17790,38 +17807,41 @@ getCorporateActions(params?: GetCorporateActionsParamsV5): Promise< ⋮---- submitOrder( params: OrderParamsV5, -): Promise> + ): Promise> ⋮---- amendOrder( params: AmendOrderParamsV5, -): Promise> + ): Promise> ⋮---- cancelOrder( params: CancelOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query unfilled or partially filled orders in real-time. To query older order records, please use the order history interface. */ getActiveOrders( params: GetAccountOrdersParamsV5, -): Promise>> + ): Promise>> ⋮---- cancelAllOrders( params: CancelAllOrdersParamsV5, ): Promise< APIResponseV3WithTime<{ list: OrderResultV5[]; success: string }> - > { - return this.postPrivate('/v5/order/cancel-all', params); + > ⋮---- /** * Query order history. As order creation/cancellation is asynchronous, the data returned from this endpoint may delay. * * If you want to get real-time order information, you could query this endpoint or rely on the websocket stream (recommended). + * + * From 2026-11-12, omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * Pass orderStatus explicitly to retrieve matching orders from that period. + * @see https://t.me/Bybit_API_Announcements/464 */ getHistoricOrders( params: GetAccountHistoricOrdersParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query users' execution records, sorted by execTime in descending order @@ -17831,7 +17851,7 @@ getHistoricOrders( */ getExecutionList( params: GetExecutionListParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * This endpoint allows you to place more than one order in a single request. @@ -17855,11 +17875,7 @@ batchSubmitOrders( }, BatchOrdersRetExtInfoV5 > - > { - return this.postPrivate('/v5/order/create-batch', { - category, - request: orders, - }); + > ⋮---- /** * This endpoint allows you to amend more than one open order in a single request. @@ -17879,11 +17895,7 @@ batchAmendOrders( }, BatchOrdersRetExtInfoV5 > - > { - return this.postPrivate('/v5/order/amend-batch', { - category, - request: orders, - }); + > ⋮---- /** * This endpoint allows you to cancel more than one open order in a single request. @@ -17903,11 +17915,7 @@ batchCancelOrders( }, BatchOrdersRetExtInfoV5 > - > { - return this.postPrivate('/v5/order/cancel-batch', { - category, - request: orders, - }); + > ⋮---- /** * Query the qty and amount of borrowable coins in spot account. @@ -17917,7 +17925,7 @@ batchCancelOrders( getSpotBorrowCheck( symbol: string, side: OrderSideV5, -): Promise> + ): Promise> ⋮---- /** * This endpoint allows you to set the disconnection protect time window. Covers: option (unified account). @@ -17932,7 +17940,7 @@ getSpotBorrowCheck( setDisconnectCancelAllWindow( category: 'option', timeWindow: number, -): Promise> + ): Promise> ⋮---- /** * This endpoint allows you to set the disconnection protect time window. Covers: option (unified account). @@ -17945,7 +17953,7 @@ setDisconnectCancelAllWindow( setDisconnectCancelAllWindowV2(params: { product?: 'OPTION' | 'SPOT' | 'DERIVATIVES'; timeWindow: number; -}): Promise> + }): Promise> ⋮---- /** * Pre-check order to calculate changes in IMR and MMR before placing an order @@ -17957,7 +17965,7 @@ setDisconnectCancelAllWindowV2(params: { */ preCheckOrder( params: OrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -17972,7 +17980,7 @@ preCheckOrder( */ createStrategyOrder( params: CreateStrategyOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Strategy List @@ -17981,7 +17989,7 @@ createStrategyOrder( */ getStrategyList( params?: GetStrategyListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Strategy Order List @@ -17990,7 +17998,7 @@ getStrategyList( */ getStrategyOrderList( params: GetStrategyOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Stop Strategy @@ -17999,7 +18007,7 @@ getStrategyOrderList( */ stopStrategy( params: StopStrategyParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -18022,7 +18030,7 @@ stopStrategy( */ getPositionInfo( params: PositionInfoParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get Futures Leverage @@ -18032,7 +18040,7 @@ getPositionInfo( */ getFuturesLeverage( params: GetFuturesLeverageParamsV5, -): Promise> + ): Promise> ⋮---- /** * Set the leverage @@ -18043,7 +18051,7 @@ getFuturesLeverage( * * Note: Under one-way mode, buyLeverage must be the same as sellLeverage */ -setLeverage(params: SetLeverageParamsV5): Promise> ⋮---- /** * Select cross margin mode or isolated margin mode. @@ -18056,7 +18064,7 @@ setLeverage(params: SetLeverageParamsV5): Promise> ⋮---- /** * @deprecated @@ -18068,7 +18076,7 @@ switchIsolatedMargin( */ setTPSLMode( params: SetTPSLModeParamsV5, -): Promise> ⋮---- /** * Switches the position mode for USDT perpetual and Inverse futures. @@ -18081,7 +18089,7 @@ setTPSLMode( */ switchPositionMode( params: SwitchPositionModeParamsV5, -): Promise> ⋮---- /** * @deprecated @@ -18093,7 +18101,7 @@ switchPositionMode( */ setRiskLimit( params: SetRiskLimitParamsV5, -): Promise> + ): Promise> ⋮---- /** * This endpoint allows you to set the take profit, stop loss or trailing stop for a position. @@ -18106,7 +18114,7 @@ setRiskLimit( */ setTradingStop( params: SetTradingStopParamsV5, -): Promise> ⋮---- /** * This endpoint allows you to turn on/off auto-add-margin for an isolated margin position. @@ -18115,7 +18123,7 @@ setTradingStop( */ setAutoAddMargin( params: SetAutoAddMarginParamsV5, -): Promise> ⋮---- /** * Manually add or reduce margin for isolated margin position @@ -18125,7 +18133,7 @@ setAutoAddMargin( */ addOrReduceMargin( params: AddOrReduceMarginParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query user's closed profit and loss records. The results are sorted by createdTime in descending order. @@ -18135,7 +18143,7 @@ addOrReduceMargin( */ getClosedPnL( params: GetClosedPnLParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get Closed Options Positions @@ -18153,8 +18161,7 @@ getClosedOptionsPositions( category: string; list: ClosedOptionsPositionV5[]; }> - > { - return this.getPrivate('/v5/position/get-closed-positions', params); + > ⋮---- /** * Move positions between sub-master, master-sub, or sub-sub UIDs. @@ -18171,7 +18178,7 @@ getClosedOptionsPositions( */ movePosition( params: MovePositionParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query moved position data by master UID api key. @@ -18183,8 +18190,7 @@ getMovePositionHistory(params?: GetMovePositionHistoryParamsV5): Promise< list: MovePositionHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/position/move-history', params); + > ⋮---- /** * Confirm new risk limit. @@ -18198,7 +18204,7 @@ getMovePositionHistory(params?: GetMovePositionHistoryParamsV5): Promise< */ confirmNewRiskLimit( params: ConfirmNewRiskLimitParamsV5, -): Promise> ⋮---- /** * @@ -18216,7 +18222,7 @@ confirmNewRiskLimit( */ getPreUpgradeOrderHistory( params: GetPreUpgradeOrderHistoryParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get users' execution records which occurred before you upgrade the account to Unified account, sorted by execTime in descending order @@ -18229,7 +18235,7 @@ getPreUpgradeOrderHistory( */ getPreUpgradeTradeHistory( params: GetPreUpgradeTradeHistoryParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query user's closed profit and loss records. The results are sorted by createdTime in descending order. @@ -18238,7 +18244,7 @@ getPreUpgradeTradeHistory( */ getPreUpgradeClosedPnl( params: GetPreUpgradeClosedPnlParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query transaction logs which occurred in the USDC Derivatives wallet before the account was upgraded to a Unified account. @@ -18255,8 +18261,7 @@ getPreUpgradeTransactions( list: PreUpgradeTransaction[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/pre-upgrade/account/transaction-log', params); + > ⋮---- /** * Query delivery records of Option before you upgraded the account to a Unified account, sorted by deliveryTime in descending order. @@ -18268,8 +18273,7 @@ getPreUpgradeOptionDeliveryRecord( params: GetPreUpgradeOptionDeliveryRecordParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.getPrivate('/v5/pre-upgrade/asset/delivery-record', params); + > ⋮---- /** * Query session settlement records of USDC perpetual before you upgrade the account to Unified account. @@ -18283,8 +18287,7 @@ getPreUpgradeUSDCSessionSettlements( APIResponseV3WithTime< CategoryCursorListV5 > - > { - return this.getPrivate('/v5/pre-upgrade/asset/settlement-record', params); + > ⋮---- /** * @@ -18299,7 +18302,7 @@ getPreUpgradeUSDCSessionSettlements( */ getWalletBalance( params: GetWalletBalanceParamsV5, -): Promise> ⋮---- /** * Query the available amount to transfer of a specific coin in the Unified wallet. @@ -18310,8 +18313,7 @@ getTransferableAmount(params: { coinName: string }): Promise< APIResponseV3WithTime<{ availableWithdrawal: string; }> - > { - return this.getPrivate('/v5/account/withdrawal', params); + > ⋮---- /** * Get Account Instruments Info @@ -18324,7 +18326,7 @@ getTransferableAmount(params: { coinName: string }): Promise< */ getAccountInstrumentsInfo( params: GetAccountInstrumentsInfoParamsV5 & { category: C }, -): Promise>> + ): Promise>> ⋮---- /** * Upgrade to unified account. @@ -18333,8 +18335,7 @@ getAccountInstrumentsInfo( */ upgradeToUnifiedAccount(): Promise< APIResponseV3WithTime - > { - return this.postPrivate('/v5/account/upgrade-to-uta'); + > ⋮---- /** * Get interest records, sorted in reverse order of creation time. @@ -18343,7 +18344,7 @@ upgradeToUnifiedAccount(): Promise< */ getBorrowHistory( params?: GetBorrowHistoryParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * You can manually repay the liabilities of Unified account @@ -18362,7 +18363,7 @@ getBorrowHistory( */ repayLiability( params?: RepayLiabilityParamsV5, -): Promise> ⋮---- /** * Manual Repay @@ -18385,18 +18386,18 @@ repayLiability( */ manualRepay( params?: ManualRepayParamsV5, -): Promise> + ): Promise> ⋮---- /** * You can decide whether the assets in the Unified account needs to be collateral coins. */ setCollateralCoin( params: SetCollateralCoinParamsV5, -): Promise> ⋮---- batchSetCollateralCoin(params: { request: SetCollateralCoinParamsV5[]; -}): Promise> ⋮---- /** * Get the collateral information of the current unified margin account, including loan interest rate, @@ -18404,14 +18405,14 @@ batchSetCollateralCoin(params: { */ getCollateralInfo( currency?: string, -): Promise> ⋮---- /** * Get current account Greeks information */ getCoinGreeks( baseCoin?: string, -): Promise> ⋮---- /** * Get the trading fee rate. @@ -18419,7 +18420,7 @@ getCoinGreeks( */ getFeeRate( params: GetFeeRateParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query the margin mode and the upgraded status of account @@ -18435,14 +18436,14 @@ getAccountInfo(): Promise> * support linear contract (USDT, USDC Perp & USDC Futures) / Spot / Options only * Unified account only */ -getDCPInfo(): Promise> ⋮---- /** * Query transaction logs in Unified account. */ getTransactionLog( params?: GetTransactionLogParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query transaction logs in the derivatives wallet (classic account), and inverse derivatives wallet (upgraded to UTA). @@ -18453,8 +18454,7 @@ getClassicTransactionLogs( params?: GetClassicTransactionLogsParamsV5, ): Promise< APIResponseV3WithTime<{ list: TransactionLogV5[]; nextPageCursor: string }> - > { - return this.getPrivate('/v5/account/contract-transaction-log', params); + > ⋮---- /** * Query the SMP group ID of self match prevention. @@ -18463,8 +18463,7 @@ getSMPGroup(): Promise< APIResponseV3WithTime<{ smpGroup: string; }> - > { - return this.getPrivate('/v5/account/smp-group'); + > ⋮---- /** * Default is regular margin mode. @@ -18475,10 +18474,7 @@ setMarginMode( marginMode: AccountMarginModeV5, ): Promise< APIResponseV3<{ reasons: { reasonCode: string; reasonMsg: string }[] }> - > { - return this.postPrivate('/v5/account/set-margin-mode', { - setMarginMode: marginMode, - }); + > ⋮---- /** * Turn on/off Spot hedging feature in Portfolio margin for Unified account. @@ -18489,7 +18485,7 @@ setMarginMode( */ setSpotHedging(params: { setHedgingMode: 'ON' | 'OFF'; -}): Promise> ⋮---- /** * Set Limit Price Behaviour @@ -18500,7 +18496,7 @@ setSpotHedging(params: { */ setLimitPriceAction( params: SetLimitPriceActionParamsV5, -): Promise> ⋮---- /** * Get Trade Behaviour Config / Get Limit Price Behaviour @@ -18515,7 +18511,7 @@ getLimitPriceAction(): Promise> */ setDeltaNeutralMode( params: SetDeltaNeutralModeParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Configure Market Maker Protection (MMP) @@ -18532,7 +18528,7 @@ resetMMP(baseCoin: string): Promise> */ getMMPState( baseCoin: string, -): Promise> ⋮---- /** * Get Option Asset Info @@ -18540,8 +18536,7 @@ getMMPState( */ getOptionAssetInfo(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/account/option-asset-info'); + > ⋮---- /** * Get Pay Info @@ -18549,7 +18544,7 @@ getOptionAssetInfo(): Promise< */ getPayInfo( params?: GetPayInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Trade Info For Analysis @@ -18557,7 +18552,7 @@ getPayInfo( */ getTradeInfoForAnalysis( params: GetTradeInfoForAnalysisParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -18575,7 +18570,7 @@ getTradeInfoForAnalysis( */ getAssetOverview( params?: GetAssetOverviewParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Portfolio Margin Info @@ -18583,7 +18578,7 @@ getAssetOverview( */ getPortfolioMarginInfo( params?: GetPortfolioMarginInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Total Members Assets @@ -18591,7 +18586,7 @@ getPortfolioMarginInfo( */ getTotalMembersAssets( params?: GetTotalMembersAssetsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Funding Account Transaction History @@ -18606,8 +18601,7 @@ getFundingAccountTransactionHistory( nextPageCursor: string; list: FundingAccountTransactionRecordV5[]; }> - > { - return this.getPrivate('/v5/asset/fundinghistory', params); + > ⋮---- /** * Query option delivery records, sorted by deliveryTime in descending order. @@ -18616,7 +18610,7 @@ getFundingAccountTransactionHistory( */ getDeliveryRecord( params: GetDeliveryRecordParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query session settlement records of USDC perpetual @@ -18627,8 +18621,7 @@ getSettlementRecords( params: GetSettlementRecordParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.getPrivate('/v5/asset/settlement-record', params); + > ⋮---- /** * Query the coin exchange records. @@ -18640,8 +18633,7 @@ getCoinExchangeRecords(params?: GetCoinExchangeRecordParamsV5): Promise< orderBody: CoinExchangeRecordV5[]; nextPageCursor?: string; }> - > { - return this.getPrivate('/v5/asset/exchange/order-record', params); + > ⋮---- /** * Query coin information, including chain information, withdraw and deposit status. @@ -18651,7 +18643,7 @@ getCoinExchangeRecords(params?: GetCoinExchangeRecordParamsV5): Promise< */ getCoinInfo( coin?: string, -): Promise> ⋮---- /** * Query the sub UIDs under a main UID @@ -18663,8 +18655,7 @@ getSubUID(): Promise< subMemberIds: string[]; transferableSubMemberIds: string[]; }> - > { - return this.getPrivate('/v5/asset/transfer/query-sub-member-list'); + > ⋮---- /** * Query asset information. @@ -18674,7 +18665,7 @@ getSubUID(): Promise< */ getAssetInfo( params: GetAssetInfoParamsV5, -): Promise> ⋮---- /** * Query all coin balances of all account types under the master account and sub accounts. @@ -18683,7 +18674,7 @@ getAssetInfo( */ getAllCoinsBalance( params: GetAllCoinsBalanceParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query the balance of a specific coin in a specific account type. Supports querying sub UID's balance. @@ -18692,7 +18683,7 @@ getAllCoinsBalance( */ getCoinBalance( params: GetAccountCoinBalanceParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query withdrawable amount (incl. risk-frozen `limitAmountUsd` and per-wallet slices). @@ -18701,7 +18692,7 @@ getCoinBalance( */ getWithdrawableAmount(params: { coin: string; -}): Promise> + }): Promise> ⋮---- /** * Query the transferable coin list between each account type. @@ -18709,7 +18700,7 @@ getWithdrawableAmount(params: { getTransferableCoinList( fromAccountType: AccountTypeV5, toAccountType: AccountTypeV5, -): Promise> ⋮---- /** * Create the internal transfer between different account types under the same UID. @@ -18723,14 +18714,14 @@ createInternalTransfer( amount: string, fromAccountType: AccountTypeV5, toAccountType: AccountTypeV5, -): Promise> ⋮---- /** * Query the internal transfer records between different account types under the same UID. */ getInternalTransferRecords( params?: GetInternalTransferParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Enable Universal Transfer for Sub UID @@ -18745,14 +18736,14 @@ getInternalTransferRecords( */ enableUniversalTransferForSubUIDs( subMemberIds: string[], -): Promise> ⋮---- /** * Transfer between sub-sub or main-sub. Please make sure you have enabled universal transfer on your sub UID in advance. */ createUniversalTransfer( params: UniversalTransferParamsV5, -): Promise> ⋮---- /** * Query universal transfer records @@ -18762,7 +18753,7 @@ createUniversalTransfer( */ getUniversalTransferRecords( params?: GetUniversalTransferRecordsParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query allowed deposit coin information. @@ -18775,8 +18766,7 @@ getAllowedDepositCoinInfo( configList: AllowedDepositCoinInfoV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/asset/deposit/query-allowed-list', params); + > ⋮---- /** * Set auto transfer account after deposit. The same function as the setting for Deposit on web GUI @@ -18786,8 +18776,7 @@ setDepositAccount(params: { accountType: AccountTypeV5 }): Promise< APIResponseV3WithTime<{ status: 0 | 1; }> - > { - return this.postPrivate('/v5/asset/deposit/deposit-to-account', params); + > ⋮---- /** * Query deposit records. @@ -18801,8 +18790,7 @@ getDepositRecords( params?: GetDepositRecordParamsV5, ): Promise< APIResponseV3WithTime<{ rows: DepositRecordV5[]; nextPageCursor: string }> - > { - return this.getPrivate('/v5/asset/deposit/query-record', params); + > ⋮---- /** * Query subaccount's deposit records by MAIN UID's API key. @@ -18815,8 +18803,7 @@ getSubAccountDepositRecords( params: GetSubAccountDepositRecordParamsV5, ): Promise< APIResponseV3WithTime<{ rows: DepositRecordV5[]; nextPageCursor: string }> - > { - return this.getPrivate('/v5/asset/deposit/query-sub-member-record', params); + > ⋮---- /** * Get Internal Deposit Records (across Bybit) @@ -18831,8 +18818,7 @@ getInternalDepositRecords(params?: GetInternalDepositRecordParamsV5): Promise< rows: InternalDepositRecordV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/asset/deposit/query-internal-record', params); + > ⋮---- /** * Query the deposit address information of MASTER account. @@ -18845,11 +18831,7 @@ getMasterDepositAddress( coin: string; chains: DepositAddressChainV5[]; }> - > { - return this.getPrivate('/v5/asset/deposit/query-address', { - coin, - chainType, - }); + > ⋮---- /** * Query the deposit address information of SUB account. @@ -18863,12 +18845,7 @@ getSubDepositAddress( coin: string; chains: DepositAddressChainV5; }> - > { - return this.getPrivate('/v5/asset/deposit/query-sub-member-address', { - coin, - chainType, - subMemberId, - }); + > ⋮---- /** * @deprecated - duplicate function, use getSubDepositAddress() instead @@ -18887,19 +18864,14 @@ querySubMemberAddress( coin: string; chains: DepositAddressChainV5; }> - > { - return this.getPrivate('/v5/asset/deposit/query-sub-member-address', { - coin, - chainType, - subMemberId, - }); + > ⋮---- /** * Query withdrawal records. */ getWithdrawalRecords( params?: GetWithdrawalRecordsParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get Withdrawal Address List @@ -18912,8 +18884,7 @@ getWithdrawalAddressList(params?: GetWithdrawalAddressListParamsV5): Promise< rows: WithdrawalAddressV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/asset/withdraw/query-address', params); + > ⋮---- /** * Get Exchange Entity List. @@ -18922,8 +18893,7 @@ getWithdrawalAddressList(params?: GetWithdrawalAddressListParamsV5): Promise< */ getExchangeEntities(): Promise< APIResponseV3WithTime<{ vasp: VaspEntityV5[] }> - > { - return this.getPrivate('/v5/asset/withdraw/vasp/list'); + > ⋮---- /** * Submit Deposit Originator Info @@ -18931,7 +18901,7 @@ getExchangeEntities(): Promise< */ submitDepositOriginatorInfo( params: SubmitDepositOriginatorInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Withdraw from Funding, Unified, and/or Earn (and combos such as FUND,UTA,EARN per API). @@ -18944,7 +18914,7 @@ submitDepositOriginatorInfo( */ submitWithdrawal( params: WithdrawParamsV5, -): Promise> ⋮---- /** * Cancel the withdrawal @@ -18953,7 +18923,7 @@ submitWithdrawal( */ cancelWithdrawal( id: string, -): Promise> ⋮---- /** * Query the coin list of convert from (to). @@ -18962,15 +18932,14 @@ getConvertCoins(params: ConvertCoinsParamsV5): Promise< APIResponseV3WithTime<{ coins: ConvertCoinSpecV5[]; }> - > { - return this.getPrivate('/v5/asset/exchange/query-coin-list', params); + > ⋮---- /** * Request a quote for converting coins. */ requestConvertQuote( params: RequestConvertQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Confirm a quote for converting coins. @@ -18980,8 +18949,7 @@ confirmConvertQuote(params: { quoteTxId: string }): Promise< quoteTxId: string; exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; }> - > { - return this.postPrivate('/v5/asset/exchange/convert-execute', params); + > ⋮---- /** * Query the exchange result by sending quoteTxId. @@ -18998,8 +18966,7 @@ getConvertStatus(params: { APIResponseV3WithTime<{ result: ConvertStatusV5; }> - > { - return this.getPrivate('/v5/asset/exchange/convert-result-query', params); + > ⋮---- /** * Query the conversion history. @@ -19008,8 +18975,7 @@ getConvertHistory(params?: GetConvertHistoryParamsV5): Promise< APIResponseV3WithTime<{ list: ConvertHistoryRecordV5[]; }> - > { - return this.getPrivate('/v5/asset/exchange/query-convert-history', params); + > ⋮---- /** * Get Small Balance Coins @@ -19022,7 +18988,7 @@ getConvertHistory(params?: GetConvertHistoryParamsV5): Promise< */ getSmallBalanceList( params: GetSmallBalanceListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Fiat Trading Pair List @@ -19034,7 +19000,7 @@ getSmallBalanceList( */ getFiatTradingPairList( params?: GetFiatTradingPairListParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -19050,7 +19016,7 @@ getFiatTradingPairList( */ createSubMember( params: CreateSubMemberParamsV5, -): Promise> + ): Promise> ⋮---- /** * To create new API key for those newly created sub UID. Use master user's api key only. @@ -19060,15 +19026,14 @@ createSubMember( */ createSubUIDAPIKey( params: CreateSubApiKeyParamsV5, -): Promise> + ): Promise> ⋮---- /** * This endpoint allows you to get a list of all sub UID of master account. At most 10k subaccounts. */ getSubUIDList(): Promise< APIResponseV3WithTime<{ subMembers: SubMemberV5[] }> - > { - return this.getPrivate('/v5/user/query-sub-members'); + > ⋮---- /** * This endpoint allows you to get a list of all sub UID of master account. No limit on the number of subaccounts. @@ -19081,8 +19046,7 @@ getSubUIDListUnlimited(params?: { subMembers: SubMemberV5[]; nextCursor: string; }> - > { - return this.getPrivate('/v5/user/submembers', params); + > ⋮---- /** * Froze sub uid. Use master user's api key only. @@ -19093,7 +19057,7 @@ getSubUIDListUnlimited(params?: { setSubUIDFrozenState( subuid: number, frozen: 0 | 1, -): Promise> ⋮---- /** * Get the information of the api key. Use the api key pending to be checked to call the endpoint. @@ -19113,8 +19077,7 @@ getSubAccountAllApiKeys(params: GetSubAccountAllApiKeysParamsV5): Promise< result: ApiKeyInfoV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/user/sub-apikeys', params); + > ⋮---- getUIDWalletType(params: { memberIds: string }): Promise< APIResponseV3WithTime<{ @@ -19123,8 +19086,7 @@ getUIDWalletType(params: { memberIds: string }): Promise< accountType: string[]; }[]; }> - > { - return this.getPrivate('/v5/user/get-member-type', params); + > ⋮---- /** * Modify the settings of a master API key. Use the API key pending to be modified to call the endpoint. Use master user's API key only. @@ -19136,7 +19098,7 @@ getUIDWalletType(params: { memberIds: string }): Promise< */ updateMasterApiKey( params: UpdateApiKeyParamsV5, -): Promise> + ): Promise> ⋮---- /** * This endpoint modifies the settings of a sub API key. @@ -19148,7 +19110,7 @@ updateMasterApiKey( */ updateSubApiKey( params: UpdateApiKeyParamsV5, -): Promise> + ): Promise> ⋮---- /** * Delete a sub UID. Before deleting the UID, please make sure there are no assets. @@ -19159,7 +19121,7 @@ updateSubApiKey( */ deleteSubMember( params: DeleteSubMemberParamsV5, -): Promise> ⋮---- /** * Delete the api key of master account. Use the api key pending to be delete to call the endpoint. Use master user's api key only. @@ -19170,7 +19132,7 @@ deleteSubMember( * * DANGER: BE CAREFUL! The API key used to call this interface will be invalid immediately. */ -deleteMasterApiKey(): Promise> ⋮---- /** * Delete the api key of sub account. Use the api key pending to be delete to call the endpoint. Use sub user's api key only. @@ -19184,7 +19146,7 @@ deleteMasterApiKey(): Promise> ⋮---- /** * @@ -19197,14 +19159,14 @@ deleteSubApiKey(params?: { */ createTaxBatchExport( params: CreateTaxBatchExportParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query tax batch export task status and download URLs by batchId. */ getTaxBatchExport( params: GetTaxBatchExportParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -19225,8 +19187,7 @@ getAffiliateUserList(params?: GetAffiliateUserListParamsV5): Promise< list: AffiliateUserListItemV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/affiliate/aff-user-list', params); + > ⋮---- /** * Get Affiliate Sub-Affiliate List. @@ -19239,7 +19200,7 @@ getAffiliateUserList(params?: GetAffiliateUserListParamsV5): Promise< */ getAffiliateSubAffiliateList( params?: GetAffiliateSubAffiliateListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Affiliate User Info. @@ -19253,7 +19214,7 @@ getAffiliateSubAffiliateList( */ getAffiliateUserInfo( params: GetAffiliateUserInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Friend Referrals @@ -19266,8 +19227,7 @@ getFriendReferrals(params?: GetFriendReferralsParamsV5): Promise< nextCursor: string; records: FriendReferralRecordV5[]; }> - > { - return this.getPrivate('/v5/user/invitation/referrals', params); + > ⋮---- getReferralCode(): Promise> ⋮---- @@ -19281,7 +19241,7 @@ getReferralCode(): Promise> */ getReferralCommissionRecords( params?: GetReferralCommissionRecordsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get referral rules and configured campaign tasks for the current site. @@ -19292,8 +19252,7 @@ getReferralCommissionRecords( */ getReferralCampaignRewards(): Promise< APIResponseV3WithTime - > { -return this.postPrivate('/v5/referral/campaign/rewards', + > ⋮---- /** * Get the authenticated user's referral identity and available commission. @@ -19306,8 +19265,7 @@ return this.postPrivate('/v5/referral/campaign/rewards', */ getReferralUserIdentityProfile(): Promise< APIResponseV3WithTime - > { -return this.postPrivate('/v5/referral/user/identity-profile', + > ⋮---- /** * Query invitation records for the authenticated referral user. @@ -19318,7 +19276,7 @@ return this.postPrivate('/v5/referral/user/identity-profile', */ getReferralUserInvitations( params?: GetReferralUserInvitationsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Sign Agreement @@ -19334,7 +19292,7 @@ getReferralUserInvitations( */ signAgreement( params: SignAgreementParamsV5, -): Promise> ⋮---- /** * @@ -19349,7 +19307,7 @@ signAgreement( */ getAlphaTradeQuote( params: GetAlphaTradeQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute Purchase @@ -19358,7 +19316,7 @@ getAlphaTradeQuote( */ executeAlphaTradePurchase( params: ExecuteAlphaTradeParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute Redeem @@ -19367,7 +19325,7 @@ executeAlphaTradePurchase( */ executeAlphaTradeRedeem( params: ExecuteAlphaTradeParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Payment Token List @@ -19375,7 +19333,7 @@ executeAlphaTradeRedeem( */ getAlphaPayTokenList( params: GetAlphaPayTokenListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Order List @@ -19383,7 +19341,7 @@ getAlphaPayTokenList( */ getAlphaTradeOrderList( params: GetAlphaTradeOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Biz Token List @@ -19391,7 +19349,7 @@ getAlphaTradeOrderList( */ getAlphaBizTokenList( params?: GetAlphaBizTokenListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Token Price List @@ -19399,7 +19357,7 @@ getAlphaBizTokenList( */ getAlphaBizTokenPriceList( params: GetAlphaBizTokenPriceListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Token Details @@ -19407,7 +19365,7 @@ getAlphaBizTokenPriceList( */ getAlphaBizTokenDetails( params: GetAlphaBizTokenDetailsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Asset List @@ -19421,7 +19379,7 @@ getAlphaAssetList(): Promise> */ getAlphaAssetDetail( params: GetAlphaAssetDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -19435,8 +19393,7 @@ getAlphaAssetDetail( */ getAlphaPredictionEngineStatus(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/alpha/prediction/engine-status'); + > ⋮---- /** * Get Payment Token List @@ -19444,8 +19401,7 @@ getAlphaPredictionEngineStatus(): Promise< */ getAlphaPredictionPayTokenList(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/alpha/prediction/pay-token-list'); + > ⋮---- /** * Get Event Detail @@ -19453,7 +19409,7 @@ getAlphaPredictionPayTokenList(): Promise< */ getAlphaPredictionEventDetail( params: GetAlphaPredictionEventDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Order Estimate @@ -19461,7 +19417,7 @@ getAlphaPredictionEventDetail( */ getAlphaPredictionOrderEstimate( params: GetAlphaPredictionOrderEstimateParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute Buy @@ -19469,7 +19425,7 @@ getAlphaPredictionOrderEstimate( */ executeAlphaPredictionBuy( params: ExecuteAlphaPredictionBuyParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute Sell @@ -19477,7 +19433,7 @@ executeAlphaPredictionBuy( */ executeAlphaPredictionSell( params: ExecuteAlphaPredictionSellParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Order List @@ -19485,7 +19441,7 @@ executeAlphaPredictionSell( */ getAlphaPredictionOrderList( params: GetAlphaPredictionOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Order Book @@ -19493,7 +19449,7 @@ getAlphaPredictionOrderList( */ getAlphaPredictionOrderBook( params: GetAlphaPredictionOrderBookParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Token Price @@ -19501,7 +19457,7 @@ getAlphaPredictionOrderBook( */ getAlphaPredictionTokenPrice( params: GetAlphaPredictionTokenPriceParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Price History @@ -19509,7 +19465,7 @@ getAlphaPredictionTokenPrice( */ getAlphaPredictionPriceHistory( params: GetAlphaPredictionPriceHistoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Position List @@ -19517,7 +19473,7 @@ getAlphaPredictionPriceHistory( */ getAlphaPredictionPositionList( params?: GetAlphaPredictionPositionListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Position History @@ -19525,7 +19481,7 @@ getAlphaPredictionPositionList( */ getAlphaPredictionPositionHistory( params?: GetAlphaPredictionPositionHistoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Portfolio Summary @@ -19533,7 +19489,7 @@ getAlphaPredictionPositionHistory( */ getAlphaPredictionPortfolioSummary( params?: GetAlphaPredictionPortfolioSummaryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Side Market List @@ -19541,7 +19497,7 @@ getAlphaPredictionPortfolioSummary( */ getAlphaPredictionSideMarketList( params: GetAlphaPredictionSideMarketListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Sports Match List @@ -19549,7 +19505,7 @@ getAlphaPredictionSideMarketList( */ getAlphaPredictionSportsMatchList( params: GetAlphaPredictionSportsMatchListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Sports Timeline Stages @@ -19557,7 +19513,7 @@ getAlphaPredictionSportsMatchList( */ getAlphaPredictionSportsTimelineStages( params: GetAlphaPredictionSportsTimelineStagesParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Sports Group Stage Detail @@ -19565,7 +19521,7 @@ getAlphaPredictionSportsTimelineStages( */ getAlphaPredictionSportsGroupStageDetail( params: GetAlphaPredictionSportsGroupStageDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -19579,7 +19535,7 @@ getAlphaPredictionSportsGroupStageDetail( */ getAlphaLPPoolList( params?: GetAlphaLPPoolListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get LP Pool Info @@ -19587,7 +19543,7 @@ getAlphaLPPoolList( */ getAlphaLPPoolInfo( params: GetAlphaLPPoolInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute LP Stake @@ -19595,7 +19551,7 @@ getAlphaLPPoolInfo( */ executeAlphaLPStake( params: ExecuteAlphaLPStakeParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute LP Redeem @@ -19603,7 +19559,7 @@ executeAlphaLPStake( */ executeAlphaLPRedeem( params: ExecuteAlphaLPRedeemParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get LP Order List @@ -19611,7 +19567,7 @@ executeAlphaLPRedeem( */ getAlphaLPOrderList( params?: GetAlphaLPOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get LP Pay Token List @@ -19619,7 +19575,7 @@ getAlphaLPOrderList( */ getAlphaLPPayTokenList( params?: GetAlphaLPPayTokenListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get LP Pay Token Price @@ -19627,7 +19583,7 @@ getAlphaLPPayTokenList( */ getAlphaLPPayTokenPrice( params: GetAlphaLPPayTokenPriceParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get LP Position List @@ -19635,8 +19591,7 @@ getAlphaLPPayTokenPrice( */ getAlphaLPPositionList(): Promise< APIResponseV3WithTime - > { -return this.postPrivate('/v5/alpha/lp/position-list', + > ⋮---- /** * @@ -19654,7 +19609,7 @@ return this.postPrivate('/v5/alpha/lp/position-list', */ getVIPMarginData( params?: GetVIPMarginDataParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Historical Interest Rate @@ -19675,11 +19630,7 @@ getHistoricalInterestRate(params: { vipLevel: string; }[]; }> - > { - return this.getPrivate( - '/v5/spot-margin-trade/interest-rate-history', - params, - ); + > ⋮---- /** * Get Currency Data @@ -19687,7 +19638,7 @@ getHistoricalInterestRate(params: { */ getSpotMarginCurrencyData( params?: GetSpotMarginCurrencyDataParamsV5, -): Promise> ⋮---- /** * Turn spot margin trade on / off in your UTA account. @@ -19697,12 +19648,12 @@ getSpotMarginCurrencyData( */ toggleSpotMarginTrade( spotMarginMode: '1' | '0', -): Promise> ⋮---- /** * @deprecated Use setSpotMarginLeverageV2 instead, which uses an object parameter instead. This method will be replaced by setSpotMarginLeverageV2 in a future release. */ -setSpotMarginLeverage(leverage: string): Promise> ⋮---- /** * Set the user's maximum leverage in spot cross margin. @@ -19710,7 +19661,7 @@ setSpotMarginLeverage(leverage: string): Promise> ⋮---- /** * Query the Spot margin status and leverage of Unified account. @@ -19724,7 +19675,7 @@ getSpotMarginState(): Promise> */ manualBorrow( params: ManualBorrowParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get max borrowable amount. @@ -19737,7 +19688,7 @@ manualBorrow( */ getMaxBorrowableAmount( params: GetMaxBorrowableAmountParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get loan position risk information (position tiers) @@ -19746,8 +19697,7 @@ getPositionTiers(params?: GetPositionTiersParamsV5): Promise< APIResponseV3WithTime<{ list: CurrencyPositionTiersV5[]; }> - > { - return this.getPrivate('/v5/spot-margin-trade/position-tiers', params); + > ⋮---- /** * Get currency leverage information (coin state) @@ -19756,15 +19706,14 @@ getCoinState(params?: GetCoinStateParamsV5): Promise< APIResponseV3WithTime<{ list: CoinStateV5[]; }> - > { - return this.getPrivate('/v5/spot-margin-trade/coinstate', params); + > ⋮---- /** * Get available amount to repay */ getAvailableAmountToRepay( params: GetAvailableAmountToRepayParamsV5, -): Promise> + ): Promise> ⋮---- /** * Manual repay without asset conversion @@ -19778,7 +19727,7 @@ getAvailableAmountToRepay( */ manualRepayWithoutConversion( params: ManualRepayWithoutConversionParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Auto Repay Mode @@ -19789,35 +19738,56 @@ manualRepayWithoutConversion( */ getAutoRepayMode( params?: GetAutoRepayModeParamsV5, -): Promise> + ): Promise> ⋮---- /** * Set Auto Repay Mode * Set spot automatic repayment mode. * * INFO: - * - If currency is not passed, spot automatic repayment will be enabled for all currencies + * - If currency is not passed, autoRepayMode sets the global automatic repayment switch. + * When enabled, it also applies to currencies that become borrowable later. + * - If currency is passed, only that currency is updated; single-currency behavior is unchanged. * - If autoRepayMode of a currency is set to 1, the system will automatically make repayments * without asset conversion to that currency at 0 and 30 minutes every hour * - The amount of repayments is the minimum of available spot balance and liability */ setAutoRepayMode( params: SetAutoRepayModeParamsV5, -): Promise> + ): Promise> +⋮---- +/** + * Get the Unified account's trade auto repayment switch. + * + * Applies only in Cross and Portfolio margin modes; has no effect in Isolated mode. + * Separate from scheduled automatic repayment configured through setAutoRepayMode. + */ +getTradeAutoRepay(): Promise> +⋮---- +/** + * Set the Unified account's trade auto repayment switch. Disabled by default. + * Repays a credited coin's own flexible-rate liability after an eligible spot trade, without asset conversion. + * + * Runs only in Cross and Portfolio margin modes. Isolated mode can save the setting, but repayment does not run. + * Separate from scheduled automatic repayment configured through setAutoRepayMode. + */ +setTradeAutoRepay( + params: SetTradeAutoRepayParamsV5, + ): Promise> ⋮---- /** * Get Liability Info (spot margin UTA): fixed vs floating, spot vs derivatives borrow split. */ getSpotMarginLiability( params: GetSpotMarginLiabilityInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-rate borrow (place order). */ submitFixedRateBorrow( params: FixedRateBorrowParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-rate borrow order history (descending by order time). @@ -19829,11 +19799,7 @@ getFixedRateBorrowOrderInfo( list: FixedRateBorrowOrderInfoV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/spot-margin-trade/fixedborrow-order-info', - params, - ); + > ⋮---- /** * Fixed-rate borrow contract list (descending by borrow time). @@ -19845,25 +19811,21 @@ getFixedRateBorrowContractInfo( list: FixedRateBorrowContractInfoV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/spot-margin-trade/fixedborrow-contract-info', - params, - ); + > ⋮---- /** * Fixed-rate borrow order book quotes (sort by apy, term, or quantity). */ getFixedRateBorrowOrderQuote( params: GetFixedRateBorrowOrderQuoteParamsV5, -): Promise> ⋮---- /** * Renew a fixed-rate loan contract (full remaining amount if `qty` omitted). */ renewFixedRateBorrow( params: RenewFixedRateBorrowParamsV5, -): Promise> + ): Promise> ⋮---- getFixedRateBorrowInterestAccrued( params?: GetFixedRateBorrowInterestAccruedParamsV5, @@ -19872,23 +19834,19 @@ getFixedRateBorrowInterestAccrued( list: FixedRateBorrowInterestAccruedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/spot-margin-trade/fixedborrow-interest-accrued', - params, - ); + > ⋮---- cancelFixedRateBorrowOrder( params: CancelFixedRateBorrowOrderParamsV5, -): Promise> ⋮---- getFlexibleAvailableInventory( params: GetFlexibleAvailableInventoryParamsV5, -): Promise> + ): Promise> ⋮---- getFixedRateAvailableInventory( params: GetFixedRateAvailableInventoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -19907,10 +19865,7 @@ getSpotMarginCoinInfo(coin?: string): Promise< liquidationOrder: number; }[]; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/pledge-token', { - coin, - }); + > ⋮---- /** * Get Borrowable Coin Info @@ -19923,10 +19878,7 @@ getSpotMarginBorrowableCoinInfo(coin?: string): Promise< repaymentPrecision: number; }[]; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/borrow-token', { - coin, - }); + > ⋮---- /** * Get Interest & Quota @@ -19940,10 +19892,7 @@ getSpotMarginInterestAndQuota(coin: string): Promise< maxLoanAmount: string; }[]; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/loan-info', { - coin, - }); + > ⋮---- /** * Get Loan Account Info @@ -19965,8 +19914,7 @@ getSpotMarginLoanAccountInfo(): Promise< status: number; switchStatus: number; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/account'); + > ⋮---- /** * Borrow @@ -19975,8 +19923,7 @@ spotMarginBorrow(params: { coin: string; qty: string }): Promise< APIResponseV3WithTime<{ transactId: string; }> - > { - return this.postPrivate('/v5/spot-cross-margin-trade/loan', params); + > ⋮---- /** * Repay @@ -19989,8 +19936,7 @@ spotMarginRepay(params: { APIResponseV3WithTime<{ repayId: string; }> - > { - return this.postPrivate('/v5/spot-cross-margin-trade/repay', params); + > ⋮---- /** * Get Borrow Order Detail @@ -20017,8 +19963,7 @@ getSpotMarginBorrowOrderDetail(params?: { type: string; }[]; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/orders', params); + > ⋮---- /** * Get Repayment Order Detail @@ -20045,15 +19990,14 @@ getSpotMarginRepaymentOrderDetail(params?: { }[]; }[]; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/repay-history', params); + > ⋮---- /** * Turn spot margin trade on / off in your NORMAL account. */ toggleSpotCrossMarginTrade(params: { switch: 1 | 0; -}): Promise> ⋮---- /** * @@ -20076,8 +20020,7 @@ getCollateralCoins(params?: { APIResponseV3WithTime<{ vipCoinList: VipCollateralCoinsV5[]; }> - > { - return this.get('/v5/crypto-loan/collateral-data', params); + > ⋮---- /** * Get Borrowable Coins @@ -20092,8 +20035,7 @@ getBorrowableCoins(params?: { APIResponseV3WithTime<{ vipCoinList: VipBorrowableCoinsV5[]; }> - > { - return this.get('/v5/crypto-loan/loanable-data', params); + > ⋮---- /** * Get Account Borrow/Collateral Limit @@ -20105,7 +20047,7 @@ getBorrowableCoins(params?: { getAccountBorrowCollateralLimit(params: { loanCurrency: string; collateralCurrency: string; -}): Promise> + }): Promise> ⋮---- /** * Borrow Crypto Loan @@ -20121,8 +20063,7 @@ borrowCryptoLoan(params: BorrowCryptoLoanParamsV5): Promise< APIResponseV3WithTime<{ orderId: string; }> - > { - return this.postPrivate('/v5/crypto-loan/borrow', params); + > ⋮---- /** * Repay Crypto Loan @@ -20141,8 +20082,7 @@ repayCryptoLoan(params: { orderId: string; amount: string }): Promise< APIResponseV3WithTime<{ repayId: string; }> - > { - return this.postPrivate('/v5/crypto-loan/repay', params); + > ⋮---- /** * Get Unpaid Loan Orders @@ -20157,8 +20097,7 @@ getUnpaidLoanOrders(params?: GetUnpaidLoanOrdersParamsV5): Promise< list: UnpaidLoanOrderV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan/ongoing-orders', params); + > ⋮---- /** * Get Repayment Transaction History @@ -20177,8 +20116,7 @@ getRepaymentHistory(params?: GetRepaymentHistoryParamsV5): Promise< list: RepaymentHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan/repayment-history', params); + > ⋮---- /** * Get Completed Loan Order History @@ -20198,8 +20136,7 @@ getCompletedLoanOrderHistory( list: CompletedLoanOrderV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan/borrow-history', params); + > ⋮---- /** * Get Max. Allowed Reduction Collateral Amount @@ -20213,8 +20150,7 @@ getMaxAllowedReductionCollateralAmount(params: { orderId: string }): Promise< APIResponseV3WithTime<{ maxCollateralAmount: string; }> - > { - return this.getPrivate('/v5/crypto-loan/max-collateral-amount', params); + > ⋮---- /** * Adjust Collateral Amount @@ -20235,8 +20171,7 @@ adjustCollateralAmount(params: { APIResponseV3WithTime<{ adjustId: string; }> - > { - return this.postPrivate('/v5/crypto-loan/adjust-ltv', params); + > ⋮---- /** * Get Loan LTV Adjustment History @@ -20257,8 +20192,7 @@ getLoanLTVAdjustmentHistory( list: LoanLTVAdjustmentHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan/adjustment-history', params); + > ⋮---- /** * @@ -20274,8 +20208,7 @@ getLoanBorrowableCoins(params?: GetBorrowableCoinsParamsV5): Promise< APIResponseV3WithTime<{ list: BorrowableCoinV5[]; }> - > { - return this.get('/v5/crypto-loan-common/loanable-data', params); + > ⋮---- /** * Get Collateral Coins New @@ -20283,7 +20216,7 @@ getLoanBorrowableCoins(params?: GetBorrowableCoinsParamsV5): Promise< */ getLoanCollateralCoins( params?: GetCollateralCoinsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Max. Allowed Collateral Reduction Amount New @@ -20293,11 +20226,7 @@ getMaxCollateralAmount(params: GetMaxCollateralAmountParamsV5): Promise< APIResponseV3WithTime<{ maxCollateralAmount: string; }> - > { - return this.getPrivate( - '/v5/crypto-loan-common/max-collateral-amount', - params, - ); + > ⋮---- /** * Obtain Max Loan Amount @@ -20309,7 +20238,7 @@ getMaxCollateralAmount(params: GetMaxCollateralAmountParamsV5): Promise< */ getMaxLoanAmount( params: GetMaxLoanAmountParamsV5, -): Promise> + ): Promise> ⋮---- /** * Adjust Collateral Amount New @@ -20317,7 +20246,7 @@ getMaxLoanAmount( */ updateCollateralAmount( params: AdjustCollateralAmountParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Collateral Adjustment History New @@ -20331,8 +20260,7 @@ getCollateralAdjustmentHistory( list: CollateralAdjustmentHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-common/adjustment-history', params); + > ⋮---- /** * Get Crypto Loan Position New @@ -20340,8 +20268,7 @@ getCollateralAdjustmentHistory( */ getCryptoLoanPosition(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/crypto-loan-common/position'); + > ⋮---- /** * @@ -20356,7 +20283,7 @@ getCryptoLoanPosition(): Promise< */ borrowFlexible( params: BorrowFlexibleParamsV5, -): Promise> + ): Promise> ⋮---- /** * Repay Flexible Loan @@ -20365,7 +20292,7 @@ borrowFlexible( */ repayFlexible( params: RepayFlexibleParamsV5, -): Promise> + ): Promise> ⋮---- /** * Collateral Repayment @@ -20373,7 +20300,7 @@ repayFlexible( */ repayCollateralFlexible( params: RepayCollateralFlexibleParamsV5, -): Promise> ⋮---- /** * Get Flexible Loans @@ -20384,8 +20311,7 @@ getOngoingFlexibleLoans(params?: GetOngoingFlexibleLoansParamsV5): Promise< APIResponseV3WithTime<{ list: OngoingFlexibleLoanV5[]; }> - > { - return this.getPrivate('/v5/crypto-loan-flexible/ongoing-coin', params); + > ⋮---- /** * Get Borrow Orders History @@ -20396,8 +20322,7 @@ getBorrowHistoryFlexible(params?: GetBorrowHistoryFlexibleParamsV5): Promise< list: BorrowHistoryFlexibleV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-flexible/borrow-history', params); + > ⋮---- /** * Get Repayment Orders History @@ -20410,15 +20335,11 @@ getRepaymentHistoryFlexible( list: RepaymentHistoryFlexibleV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/crypto-loan-flexible/repayment-history', - params, - ); + > ⋮---- getFlexibleLoanAvailableInventory( params: GetFlexibleLoanAvailableInventoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -20435,8 +20356,7 @@ getSupplyOrderQuoteFixed(params: GetSupplyOrderQuoteFixedParamsV5): Promise< APIResponseV3WithTime<{ list: SupplyOrderQuoteFixedV5[]; }> - > { - return this.get('/v5/crypto-loan-fixed/supply-order-quote', params); + > ⋮---- /** * Get Borrowing Market @@ -20447,8 +20367,7 @@ getBorrowOrderQuoteFixed(params: GetBorrowOrderQuoteFixedParamsV5): Promise< APIResponseV3WithTime<{ list: BorrowOrderQuoteFixedV5[]; }> - > { - return this.get('/v5/crypto-loan-fixed/borrow-order-quote', params); + > ⋮---- /** * Create Borrow Order @@ -20457,7 +20376,7 @@ getBorrowOrderQuoteFixed(params: GetBorrowOrderQuoteFixedParamsV5): Promise< */ createBorrowOrderFixed( params: CreateBorrowOrderFixedParamsV5, -): Promise> + ): Promise> ⋮---- /** * Create Supply Order @@ -20468,7 +20387,7 @@ createBorrowOrderFixed( */ createSupplyOrderFixed( params: CreateSupplyOrderFixedParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel Borrow Order @@ -20476,7 +20395,7 @@ createSupplyOrderFixed( */ cancelBorrowOrderFixed( params: CancelBorrowOrderFixedParamsV5, -): Promise> ⋮---- /** * Cancel Supply Order @@ -20485,7 +20404,7 @@ cancelBorrowOrderFixed( */ cancelSupplyOrderFixed( params: CancelSupplyOrderFixedParamsV5, -): Promise> ⋮---- /** * Get Borrow Contract Info @@ -20498,11 +20417,7 @@ getBorrowContractInfoFixed( list: BorrowContractInfoFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/crypto-loan-fixed/borrow-contract-info', - params, - ); + > ⋮---- /** * Get Supply Contract Info @@ -20515,11 +20430,7 @@ getSupplyContractInfoFixed( list: SupplyContractInfoFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/crypto-loan-fixed/supply-contract-info', - params, - ); + > ⋮---- /** * Get Borrow Order Info @@ -20530,8 +20441,7 @@ getBorrowOrderInfoFixed(params?: GetBorrowOrderInfoFixedParamsV5): Promise< list: BorrowOrderInfoFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-fixed/borrow-order-info', params); + > ⋮---- /** * Get Supply Order Info @@ -20542,8 +20452,7 @@ getSupplyOrderInfoFixed(params?: GetSupplyOrderInfoFixedParamsV5): Promise< list: SupplyOrderInfoFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-fixed/supply-order-info', params); + > ⋮---- /** * Repay Fixed Loan @@ -20552,7 +20461,7 @@ getSupplyOrderInfoFixed(params?: GetSupplyOrderInfoFixedParamsV5): Promise< */ repayFixed( params: RepayFixedParamsV5, -): Promise> + ): Promise> ⋮---- /** * Collateral Repayment @@ -20561,7 +20470,7 @@ repayFixed( */ repayCollateralFixed( params: RepayCollateralFixedParamsV5, -): Promise> ⋮---- /** * Get Repayment History @@ -20572,8 +20481,7 @@ getRepaymentHistoryFixed(params?: GetRepaymentHistoryFixedParamsV5): Promise< list: RepaymentHistoryFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-fixed/repayment-history', params); + > ⋮---- /** * Renew Borrow Order @@ -20585,7 +20493,7 @@ getRepaymentHistoryFixed(params?: GetRepaymentHistoryFixedParamsV5): Promise< */ renewBorrowOrderFixed( params: RenewBorrowOrderFixedParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Renew Order Info @@ -20599,12 +20507,11 @@ getRenewOrderInfoFixed(params?: GetRenewOrderInfoFixedParamsV5): Promise< list: RenewOrderInfoFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-fixed/renew-info', params); + > ⋮---- getFixedLoanAvailableInventory( params: GetFixedLoanAvailableInventoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -20619,8 +20526,7 @@ getInstitutionalLendingProductInfo(productId?: string): Promise< APIResponseV3WithTime<{ marginProductInfo: InstitutionalLendingProductInfoV5[]; }> - > { -return this.get('/v5/ins-loan/product-infos', + > ⋮---- /** * Get Coin Delta Amount @@ -20628,15 +20534,14 @@ return this.get('/v5/ins-loan/product-infos', */ getInstitutionalLendingCoinDeltaAmount( params?: GetCoinDeltaAmountParamsV5, -): Promise> + ): Promise> ⋮---- /** * Current LTV, liquidation status, and delay-liquidation timing for an institutional loan account. */ getInstitutionalLendingDelayLiquidationStatus(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/ins-loan/delay-liq-status'); + > ⋮---- /** * Get Margin Coin Info @@ -20644,14 +20549,14 @@ getInstitutionalLendingDelayLiquidationStatus(): Promise< */ getInstitutionalLendingMarginCoinInfo( productId?: string, -): Promise> ⋮---- /** * Get Margin Coin Info With Conversion Rate */ getInstitutionalLendingMarginCoinInfoWithConversionRate( productId?: string, -): Promise> ⋮---- /** * Get Loan Orders @@ -20661,7 +20566,7 @@ getInstitutionalLendingLoanOrders(params?: { startTime?: number; endTime?: number; limit?: number; -}): Promise> ⋮---- /** * Get Repay Orders @@ -20670,7 +20575,7 @@ getInstitutionalLendingRepayOrders(params?: { startTime?: number; endTime?: number; limit?: number; -}): Promise> ⋮---- /** * Get LTV @@ -20678,16 +20583,14 @@ getInstitutionalLendingRepayOrders(params?: { */ getInstitutionalLendingLTV(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/ins-loan/ltv'); + > ⋮---- /** * Get LTV with Ladder Conversion Rate */ getInstitutionalLendingLTVWithLadderConversionRate(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/ins-loan/ltv-convert'); + > ⋮---- /** * Bind or unbind UID for the institutional loan product. @@ -20703,8 +20606,7 @@ bindOrUnbindUID(params: { uid: string; operate: '0' | '1' }): Promise< uid: string; operate: '0' | '1'; }> - > { - return this.postPrivate('/v5/ins-loan/association-uid', params); + > ⋮---- /** * Repay Institutional Loan @@ -20719,7 +20621,7 @@ bindOrUnbindUID(params: { uid: string; operate: '0' | '1' }): Promise< */ repayInstitutionalLoan( params: RepayInstitutionalLoanParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -20738,7 +20640,7 @@ repayInstitutionalLoan( */ getExchangeBrokerEarnings( params?: GetExchangeBrokerEarningsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Exchange Broker Account Info. @@ -20749,8 +20651,7 @@ getExchangeBrokerEarnings( */ getExchangeBrokerAccountInfo(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/broker/account-info'); + > ⋮---- /** * Get Sub Account Deposit Records. @@ -20767,18 +20668,14 @@ getBrokerSubAccountDeposits(params?: GetBrokerSubAccountDepositsV5): Promise< rows: ExchangeBrokerSubAccountDepositRecordV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/broker/asset/query-sub-member-deposit-record', - params, - ); + > ⋮---- /** * Query Voucher Spec */ getBrokerVoucherSpec(params: { id: string; -}): Promise> + }): Promise> ⋮---- /** * Issue a voucher to a user @@ -20788,7 +20685,7 @@ getBrokerVoucherSpec(params: { */ issueBrokerVoucher( params: IssueVoucherParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query an issued voucher @@ -20798,7 +20695,7 @@ issueBrokerVoucher( */ getBrokerIssuedVoucher( params: GetBrokerIssuedVoucherParamsV5, -): Promise> + ): Promise> ⋮---- /** * Set Rate Limit @@ -20815,8 +20712,7 @@ setBrokerRateLimit(params: SetBrokerRateLimitParamsV5): Promise< APIResponseV3WithTime<{ result: BrokerRateLimitSetResultItemV5[]; }> - > { - return this.postPrivate('/v5/broker/apilimit/set', params); + > ⋮---- /** * Get Rate Limit Cap @@ -20833,8 +20729,7 @@ getBrokerRateLimitCap(): Promise< APIResponseV3WithTime<{ list: BrokerRateLimitCapItemV5[]; }> - > { - return this.getPrivate('/v5/broker/apilimit/query-cap'); + > ⋮---- /** * Get All Rate Limits @@ -20851,8 +20746,7 @@ getAllBrokerRateLimits(params?: GetAllBrokerRateLimitsParamsV5): Promise< list: BrokerRateLimitAllItemV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/broker/apilimit/query-all', params); + > ⋮---- /** * @@ -20869,22 +20763,21 @@ getEarnProduct(params: { category: string; coin?: string }): Promise< APIResponseV3WithTime<{ list: EarnProductV5[]; }> - > { - return this.get('/v5/earn/product', params); + > ⋮---- /** * Query Flexible Saving auto savings settings. Omit coins to return every supported coin. */ getFlexibleSavingAutoSavings( params?: GetFlexibleSavingAutoSavingsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Enable or disable Flexible Saving auto savings for one coin, or globally when coin is omitted. */ setFlexibleSavingAutoSavings( params: SetFlexibleSavingAutoSavingsParamsV5, -): Promise> ⋮---- /** * Get Coupon List @@ -20892,7 +20785,7 @@ setFlexibleSavingAutoSavings( */ getEarnCouponList( params: GetEarnCouponListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get RWA Product List @@ -20900,7 +20793,7 @@ getEarnCouponList( */ getRWAProductList( params?: GetRWAProductListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Place RWA Order @@ -20908,22 +20801,21 @@ getRWAProductList( */ placeRWAOrder( params: PlaceRWAOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get RWA Position List */ getRWAPositionList(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/earn/rwa/position'); + > ⋮---- /** * Get RWA Order List */ getRWAOrderList( params?: GetRWAOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get RWA NAV Chart @@ -20931,7 +20823,7 @@ getRWAOrderList( */ getRWANavChart( params: GetRWANavChartParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Hold to Earn airdrop products (ByFi). @@ -20940,8 +20832,7 @@ getRWANavChart( */ getHoldToEarnAirdropProducts(): Promise< APIResponseV3WithTime - > { - return this.get('/v5/earn/hold-to-earn/product'); + > ⋮---- /** * Get Advanced Earn product info (Dual Asset, Double Win, Smart Leverage, etc. via `category`). @@ -20950,7 +20841,7 @@ getHoldToEarnAirdropProducts(): Promise< */ getAdvanceEarnProduct( params: GetAdvanceEarnProductParamsV5, -): Promise> + ): Promise> ⋮---- /** * Liquidity mining — product list (Advanced Earn). @@ -20959,7 +20850,7 @@ getAdvanceEarnProduct( */ getLiquidityMiningProduct( params?: GetLiquidityMiningProductParamsV5, -): Promise> + ): Promise> ⋮---- /** * Liquidity mining reinvest. Puts claimable yield of a position back into the pool. @@ -20970,7 +20861,7 @@ getLiquidityMiningProduct( */ reinvestLiquidityMining( params: ReinvestLiquidityMiningParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term / fixed saving — product list (Earn). @@ -20979,7 +20870,7 @@ reinvestLiquidityMining( */ getFixedTermEarnProduct( params?: GetFixedTermEarnProductParamsV5, -): Promise> + ): Promise> ⋮---- /** * Advanced Earn — quote / extra info (Discount Buy, Dual Assets, …). Call before place order where required. @@ -20989,7 +20880,7 @@ getFixedTermEarnProduct( */ getAdvanceEarnProductExtraInfo( params: GetAdvanceEarnProductExtraInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Advanced Earn — place order (Dual Assets, Discount Buy, …). Async; use getAdvanceEarnOrder to track. @@ -20998,7 +20889,7 @@ getAdvanceEarnProductExtraInfo( */ submitAdvanceEarnPlaceOrder( params: SubmitAdvanceEarnPlaceOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Advanced Earn — active positions (Dual Assets, Discount Buy, …). @@ -21007,7 +20898,7 @@ submitAdvanceEarnPlaceOrder( */ getAdvanceEarnPosition( params: GetAdvanceEarnPositionListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Advanced Earn — order list (Dual Assets, Discount Buy, …). Distinct from getEarnOrderHistory (/v5/earn/order). @@ -21016,7 +20907,7 @@ getAdvanceEarnPosition( */ getAdvanceEarnOrder( params: GetAdvanceEarnOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term earn — place order (stake). Async; use getFixedTermEarnOrder to track. @@ -21025,7 +20916,7 @@ getAdvanceEarnOrder( */ submitFixedTermEarnOrder( params: SubmitFixedTermEarnOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term earn — early redeem (FundPool only, when product allows). @@ -21034,7 +20925,7 @@ submitFixedTermEarnOrder( */ redeemFixedTermEarn( params: RedeemFixedTermEarnParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term earn — active positions. @@ -21043,7 +20934,7 @@ redeemFixedTermEarn( */ getFixedTermEarnPosition( params?: GetFixedTermEarnPositionParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term earn — order list. @@ -21052,7 +20943,7 @@ getFixedTermEarnPosition( */ getFixedTermEarnOrder( params?: GetFixedTermEarnOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term earn — enable or disable auto-invest on a position. @@ -21061,7 +20952,7 @@ getFixedTermEarnOrder( */ setFixedTermEarnAutoInvest( params: SetFixedTermEarnAutoInvestParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Stake or Redeem Earn products @@ -21078,8 +20969,7 @@ submitStakeRedeem(params: SubmitStakeRedeemParamsV5): Promise< orderId: string; orderLinkId: string; }> - > { - return this.postPrivate('/v5/earn/place-order', params); + > ⋮---- /** * Get Stake/Redeem Order History @@ -21096,8 +20986,7 @@ getEarnOrderHistory(params: GetEarnOrderHistoryParamsV5): Promise< list: EarnOrderHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/order', params); + > ⋮---- /** * Get Staked Position @@ -21112,8 +21001,7 @@ getEarnPosition(params: GetEarnPositionParamsV5): Promise< APIResponseV3WithTime<{ list: EarnPositionV5[]; }> - > { - return this.getPrivate('/v5/earn/position', params); + > ⋮---- /** * Modify OnChain Earn position (e.g. auto-reinvest for fixed duration products). @@ -21122,7 +21010,7 @@ getEarnPosition(params: GetEarnPositionParamsV5): Promise< */ modifyEarnPosition( params: ModifyEarnPositionParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get Yield History @@ -21136,8 +21024,7 @@ getEarnYieldHistory(params: GetEarnYieldHistoryParamsV5): Promise< yield: EarnYieldHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/yield', params); + > ⋮---- /** * Get Hold to Earn airdrop daily PnL records (ByFi). Up to 3 months of completed yield history. @@ -21146,7 +21033,7 @@ getEarnYieldHistory(params: GetEarnYieldHistoryParamsV5): Promise< */ getHoldToEarnAirdropYieldHistory( params: GetHoldToEarnAirdropYieldHistoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Hourly Yield History @@ -21158,8 +21045,7 @@ getEarnHourlyYieldHistory(params: GetEarnHourlyYieldHistoryParamsV5): Promise< list: EarnHourlyYieldHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/hourly-yield', params); + > ⋮---- /** * Get historical APR (FlexibleSaving / OnChain), up to ~6 months. @@ -21168,7 +21054,7 @@ getEarnHourlyYieldHistory(params: GetEarnHourlyYieldHistoryParamsV5): Promise< */ getEarnAprHistory( params: GetEarnAprHistoryParamsV5, -): Promise> ⋮---- /** * Earn token product (e.g. BYUSDT) — Get Product Info @@ -21176,14 +21062,14 @@ getEarnAprHistory( */ getEarnTokenProduct( params: GetEarnTokenProductParamsV5, -): Promise> + ): Promise> ⋮---- /** * Earn token — Place Order (Mint / Redeem). Accepted response is not final settlement; use `getEarnTokenOrders`. */ submitEarnTokenOrder( params: PlaceEarnTokenOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Earn token — Get Order List @@ -21193,15 +21079,14 @@ getEarnTokenOrders(params: GetEarnTokenOrderListParamsV5): Promise< list: EarnTokenOrderV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/token/order', params); + > ⋮---- /** * Earn token — Get Position Info */ getEarnTokenPosition( params: GetEarnTokenPositionParamsV5, -): Promise> + ): Promise> ⋮---- /** * Earn token — Get Daily Yield Records @@ -21211,8 +21096,7 @@ getEarnTokenDailyYield(params: GetEarnTokenDailyYieldParamsV5): Promise< list: EarnTokenDailyYieldRecordV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/token/yield', params); + > ⋮---- /** * Earn token — Get Hourly Yield Records @@ -21222,15 +21106,14 @@ getEarnTokenHourlyYield(params: GetEarnTokenHourlyYieldParamsV5): Promise< list: EarnTokenHourlyYieldRecordV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/token/hourly-yield', params); + > ⋮---- /** * Earn token — Get History APR (7/30/180 days). No authentication required. */ getEarnTokenHistoryApr( params: GetEarnTokenHistoryAprParamsV5, -): Promise> ⋮---- /** * @@ -21243,86 +21126,84 @@ getEarnTokenHistoryApr( */ getPwmInvestmentPlanList(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/earn/pwm/investment-plan/list'); + > ⋮---- /** * Get PWM investment plan detail (Active or Closed). */ getPwmInvestmentPlanDetail( params: GetPwmInvestmentPlanDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get pending PWM investment plan detail (PendingSubscription). */ getPwmPendingInvestmentPlanDetail( params: GetPwmPendingInvestmentPlanDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * Claim withdrawable funds from a PWM investment plan (Active). */ claimPwmWithdrawableFunds( params: ClaimPwmWithdrawableFundsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get PWM investment plan asset trend (default last 7 days). */ getPwmInvestmentPlanAssetTrend( params: GetPwmInvestmentPlanAssetTrendParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get PWM fund historical NAV (max 180 days between startTime and endTime). */ getPwmFundHistoricalNav( params: GetPwmFundHistoricalNavParamsV5, -): Promise> + ): Promise> ⋮---- /** * Subscribe to a PWM investment plan (PendingSubscription). */ subscribePwmInvestmentPlan( params: SubscribePwmInvestmentPlanParamsV5, -): Promise> + ): Promise> ⋮---- /** * Invest more into a PWM investment plan product (Active). */ investMorePwmInvestmentPlan( params: InvestMorePwmInvestmentPlanParamsV5, -): Promise> + ): Promise> ⋮---- /** * Redeem from a PWM investment plan product. */ redeemPwmInvestmentPlan( params: RedeemPwmInvestmentPlanParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get PWM investment plan orders (subscribe / redeem / auto-reinvest). */ getPwmInvestmentPlanOrders( params?: GetPwmInvestmentPlanOrdersParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get PWM subscribable product info for customize plan. No authentication required. */ getPwmSubscribableProductInfo(): Promise< APIResponseV3WithTime - > { - return this.get('/v5/earn/pwm/customize-plan/product'); + > ⋮---- /** * Create a customized PWM investment plan (max 20 Active + Pending plans per user). */ createPwmCustomizeInvestmentPlan( params: CreatePwmCustomizeInvestmentPlanParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21335,21 +21216,21 @@ createPwmCustomizeInvestmentPlan( */ getPwmAllFunds( params?: GetPwmAllFundsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Settle fund profit sharing (Active funds only). */ settlePwmFundProfit( params: SettlePwmFundProfitParamsV5, -): Promise> + ): Promise> ⋮---- /** * Create a PWM fund (PendingSubscribe). Max 10 funds per institution. */ createPwmFund( params: CreatePwmFundParamsV5, -): Promise> + ): Promise> ⋮---- /** * Create a PWM investment plan for a user (PendingSubscription). Max 10 plans per institution. @@ -21358,18 +21239,14 @@ createPwmAssetManagerInvestmentPlan( params: CreatePwmAssetManagerInvestmentPlanParamsV5, ): Promise< APIResponseV3WithTime - > { - return this.postPrivate( - '/v5/earn/pwm/asset-manager/create-investment-plan', - params, - ); + > ⋮---- /** * Get PWM investment plans created by the institution (asset manager). */ getPwmAssetManagerInvestmentPlans( params?: GetPwmAssetManagerInvestmentPlansParamsV5, -): Promise> + ): Promise> ⋮---- /** * Manage a PWM investment plan (status and/or fund allocation). @@ -21378,46 +21255,42 @@ managePwmAssetManagerInvestmentPlan( params: ManagePwmAssetManagerInvestmentPlanParamsV5, ): Promise< APIResponseV3WithTime - > { - return this.postPrivate( - '/v5/earn/pwm/asset-manager/manage-investment-plan', - params, - ); + > ⋮---- /** * Get all PWM fund orders (asset manager). Default time window: last 7 days. */ getPwmAllFundOrders( params?: GetPwmAllFundOrdersParamsV5, -): Promise> + ): Promise> ⋮---- /** * Manage a PWM fund order (approve / reject Pending Review orders). */ managePwmFundOrder( params: ManagePwmFundOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Create a PWM fund sub-account (async; max 30 per fund, fund must be Active). */ createPwmFundSubAccount( params: CreatePwmFundSubAccountParamsV5, -): Promise> + ): Promise> ⋮---- /** * Transfer funds between custodian sub-accounts (fund custodian API key required). */ pwmFundTransfer( params: PwmFundTransferParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query PWM fund transfer result (fund custodian API key required). */ getPwmFundTransferRecords( params?: GetPwmFundTransferRecordsParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21430,7 +21303,7 @@ getPwmFundTransferRecords( */ queryCardAssetRecords( params?: QueryCardAssetRecordsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Bybit Card — point balance (available, pending, account status, …). @@ -21442,7 +21315,7 @@ queryCardPointsBalance(): Promise> */ queryCardPointsRecords( params?: QueryCardPointRecordsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Bybit Card — reward tier, spending limit, auto cashback. @@ -21454,14 +21327,14 @@ queryCardPointsTier(): Promise> */ queryCardMallItemList( params?: QueryCardMallItemListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Bybit Card — cashback detail for a reward order. */ queryCardPointCashbackDetail( params: QueryCardPointCashbackDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21475,7 +21348,7 @@ queryCardPointCashbackDetail( */ createRFQ( params: CreateRFQParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get RFQ Configuration @@ -21491,7 +21364,7 @@ getRFQConfig(): Promise> */ cancelRFQ( params: CancelRFQParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel All RFQ @@ -21506,7 +21379,7 @@ cancelAllRFQ(): Promise> */ createRFQQuote( params: CreateRFQQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute Quote @@ -21515,7 +21388,7 @@ createRFQQuote( */ executeRFQQuote( params: ExecuteRFQQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel Quote @@ -21524,7 +21397,7 @@ executeRFQQuote( */ cancelRFQQuote( params: CancelRFQQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel All Quotes @@ -21534,8 +21407,7 @@ cancelAllRFQQuotes(): Promise< APIResponseV3WithTime<{ data: CancelRFQQuoteItemV5[]; // Array of cancellation results }> - > { - return this.postPrivate('/v5/rfq/cancel-all-quotes'); + > ⋮---- data: CancelRFQQuoteItemV5[]; // Array of cancellation results ⋮---- @@ -21547,7 +21419,7 @@ data: CancelRFQQuoteItemV5[]; // Array of cancellation results */ getRFQRealtimeInfo( params?: GetRFQRealtimeParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Historical RFQ Information @@ -21557,7 +21429,7 @@ getRFQRealtimeInfo( */ getRFQHistory( params?: GetRFQListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Real-time Quote Information @@ -21571,8 +21443,7 @@ getRFQRealtimeQuote(params?: GetRFQQuoteRealtimeParamsV5): Promise< APIResponseV3WithTime<{ list: RFQQuoteItemV5[]; }> - > { - return this.getPrivate('/v5/rfq/quote-realtime', params); + > ⋮---- /** * Get Historical Quote Information @@ -21586,8 +21457,7 @@ getRFQHistoryQuote(params?: GetRFQHistoryParamsV5): Promise< cursor: string; // Page turning mark list: RFQQuoteItemV5[]; // Array of quote items }> - > { - return this.getPrivate('/v5/rfq/quote-list', params); + > ⋮---- cursor: string; // Page turning mark list: RFQQuoteItemV5[]; // Array of quote items @@ -21601,8 +21471,7 @@ getRFQTrades(params?: GetRFQTradeListParamsV5): Promise< cursor: string; // Page turning mark list: RFQTradeV5[]; // Array of trade items }> - > { - return this.getPrivate('/v5/rfq/trade-list', params); + > ⋮---- cursor: string; // Page turning mark list: RFQTradeV5[]; // Array of trade items @@ -21616,8 +21485,7 @@ getRFQPublicTrades(params?: GetRFQPublicTradesParamsV5): Promise< cursor: string; // Page turning mark list: RFQPublicTradeV5[]; // Array of public trade items }> - > { - return this.getPrivate('/v5/rfq/public-trades', params); + > ⋮---- cursor: string; // Page turning mark list: RFQPublicTradeV5[]; // Array of public trade items @@ -21631,15 +21499,14 @@ list: RFQPublicTradeV5[]; // Array of public trade items */ acceptNonLPQuote( params: AcceptNonLPQuoteParamsV5, -): Promise> + ): Promise> ⋮---- getRFQDetails(params?: GetRFQDetailsParamsV5): Promise< APIResponseV3WithTime<{ cursor: string; list: RFQDetailItemV5[]; }> - > { - return this.getPrivate('/v5/rfq/rfq-detail-list', params); + > ⋮---- /** * @@ -21659,7 +21526,7 @@ getRFQDetails(params?: GetRFQDetailsParamsV5): Promise< */ getP2PAccountCoinsBalance( params: GetP2PAccountCoinsBalanceParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21671,14 +21538,14 @@ getP2PAccountCoinsBalance( */ getP2POnlineAds( params: GetP2POnlineAdsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Post new P2P advertisement */ createP2PAd( params: CreateP2PAdParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel P2P advertisement @@ -21690,15 +21557,14 @@ cancelP2PAd(params: { itemId: string }): Promise< riskVersion: string; needSecurityRisk: boolean; }> - > { - return this.postPrivate('/v5/p2p/item/cancel', params); + > ⋮---- /** * Update or relist P2P advertisement */ updateP2PAd( params: UpdateP2PAdParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get personal P2P ads list @@ -21706,14 +21572,14 @@ updateP2PAd( */ getP2PPersonalAds( params: GetP2PPersonalAdsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get P2P ad details */ getP2PAdDetail(params: { itemId: string; -}): Promise> + }): Promise> ⋮---- /** * @@ -21726,7 +21592,7 @@ getP2PAdDetail(params: { */ getP2POrders( params: GetP2POrdersParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get P2P order details @@ -21734,28 +21600,28 @@ getP2POrders( */ getP2POrderDetail(params: { orderId: string; -}): Promise> + }): Promise> ⋮---- /** * Get pending P2P orders */ getP2PPendingOrders( params: GetP2PPendingOrdersParamsV5, -): Promise> + ): Promise> ⋮---- /** * Mark P2P order as paid */ markP2POrderAsPaid( params: MarkP2POrderAsPaidParamsV5, -): Promise> + ): Promise> ⋮---- /** * Release digital assets in a P2P order */ releaseP2POrder(params: { orderId: string; -}): Promise> + }): Promise> ⋮---- /** * Buyer review of a pending seller cancel request. @@ -21765,14 +21631,14 @@ releaseP2POrder(params: { */ reviewP2PSellerCancelOrderApply( params: ReviewP2PSellerCancelOrderApplyParamsV5, -): Promise> + ): Promise> ⋮---- /** * Send chat message in a P2P order */ sendP2POrderMessage( params: SendP2POrderMessageParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21785,7 +21651,7 @@ sendP2POrderMessage( */ getP2PChatSessions( params: GetP2PChatSessionsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get the AES encrypted P2P chat session ID for a counterparty. @@ -21793,7 +21659,7 @@ getP2PChatSessions( */ getP2PChatSessionId( params: GetP2PChatSessionIdParamsV5, -): Promise> ⋮---- /** * Upload chat file for P2P order (Node.js only) @@ -21816,8 +21682,7 @@ uploadP2PChatFile(params: { type: string; uploadId: string | null; }> - > { - return this.postPrivateFile('/v5/p2p/oss/upload_file', params); + > ⋮---- fileName: string; // Required: the filename (used for MIME type detection) ⋮---- @@ -21826,7 +21691,11 @@ fileName: string; // Required: the filename (used for MIME type detection) * For files, first call uploadP2PChatFile and use its URL as the message. * @see https://bybit-exchange.github.io/docs/p2p/chat/send-chat-msg */ -sendP2PChatMessage(params: SendP2PChatMessageParamsV5): Promise< +sendP2PChatMessage(params: SendP2PChatMessageParamsV5): Promise<{ + ret_code: number; + ret_msg: string; + rateLimitApi?: APIRateLimit; + }> ⋮---- /** * Get P2P chat messages, ordered by creation time descending. @@ -21834,14 +21703,14 @@ sendP2PChatMessage(params: SendP2PChatMessageParamsV5): Promise< */ getP2PChatMessages( params: GetP2PChatMessagesParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get chat messages in a P2P order */ getP2POrderMessages( params: GetP2POrderMessagesParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21858,7 +21727,7 @@ getP2PUserInfo(): Promise> */ getP2PCounterpartyUserInfo( params: GetP2PCounterpartyUserInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get user payment information @@ -21897,8 +21766,7 @@ setApiRateLimit(params: { msg: string; }[]; }> - > { - return this.postPrivate('/v5/apilimit/set', params); + > ⋮---- /** * Query API rate limit @@ -21917,8 +21785,7 @@ queryApiRateLimit(params: { uids: string }): Promise< rate: number; }[]; }> - > { - return this.getPrivate('/v5/apilimit/query', params); + > ⋮---- /** * Get Rate Limit Cap @@ -21936,8 +21803,7 @@ getRateLimitCap(): Promise< uidCap: number; }[]; }> - > { - return this.getPrivate('/v5/apilimit/query-cap'); + > ⋮---- /** * Get All Rate Limits @@ -21958,8 +21824,7 @@ getAllRateLimits(params?: { }[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/apilimit/query-all', params); + > ⋮---- /** * @@ -21969,32 +21834,31 @@ getAllRateLimits(params?: { ⋮---- getLaunchpoolProjectList( params: GetLaunchpoolProjectListParamsV5, -): Promise> + ): Promise> ⋮---- getLaunchpoolUserActivityLog( params?: GetLaunchpoolUserActivityLogParamsV5, -): Promise> + ): Promise> ⋮---- getLaunchpoolCurrentStaking(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/spot-x/launchpool/user/current-staking'); + > ⋮---- getLaunchpoolUserHistory( params?: GetLaunchpoolUserHistoryParamsV5, -): Promise> + ): Promise> ⋮---- getPuzzleProjectList( params: GetPuzzleProjectListParamsV5, -): Promise> + ): Promise> ⋮---- getTokenSplashProjectList( params: GetTokenSplashProjectListParamsV5, -): Promise> + ): Promise> ⋮---- getTokenSplashUserActivityParams( params?: GetTokenSplashUserActivityParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -22012,7 +21876,7 @@ getTokenSplashUserActivityParams( */ getEventInstrumentsInfo( params?: GetEventInstrumentsInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract 25-level orderbook. Each level is [payoutRatio, orderValue]. @@ -22021,7 +21885,7 @@ getEventInstrumentsInfo( */ getEventOrderbook( params: GetEventOrderbookParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract order history (up to 2 years). Default query window is 7 days if start/end omitted. @@ -22030,7 +21894,7 @@ getEventOrderbook( */ getEventOrderHistory( params?: GetEventOrderHistoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract active (unfilled / partially filled) orders. @@ -22039,7 +21903,7 @@ getEventOrderHistory( */ getEventActiveOrders( params?: GetEventActiveOrdersParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract position info (UpDown, Target, Range). @@ -22048,7 +21912,7 @@ getEventActiveOrders( */ getEventPositionInfo( params?: GetEventPositionInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract trade (execution) history (up to 2 years). Default query window is 7 days if start/end omitted. @@ -22057,7 +21921,7 @@ getEventPositionInfo( */ getEventTradeHistory( params: GetEventTradeHistoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract settlement records (up to 2 years). Default query window is 7 days if start/end omitted. @@ -22066,7 +21930,7 @@ getEventTradeHistory( */ getEventSettlementRecords( params: GetEventSettlementRecordsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Submit an Event Contract payout-ratio quote. @@ -22075,7 +21939,7 @@ getEventSettlementRecords( */ submitEventQuote( params: SubmitEventQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel an Event Contract quote. Pass orderLinkId and/or orderId. @@ -22084,7 +21948,16 @@ submitEventQuote( */ cancelEventQuote( params?: CancelEventQuoteParamsV5, -): Promise> + ): Promise> +⋮---- +/** + * Cancel all active Event Contract quotes for a symbol. + * + * INFO: Event Contract maker accounts only. + */ +cancelAllEventQuotes( + params: CancelAllEventQuotesParamsV5, + ): Promise> ================ File: docs/BYBIT_SDK_QUICKSTART_GUIDE.md From b7cc86a81bdfe0a27c1a7b43e2da2054494d62f5 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Mon, 9 Nov 2026 10:47:15 +0100 Subject: [PATCH 6/9] docs: mark Bybit order history orderStatus default change as postponed --- src/rest-client-v5.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index d13f32ef..61da969f 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -923,10 +923,11 @@ export class RestClientV5 extends BaseRestClient { * - orderId & orderLinkId has a higher priority than startTime & endTime * - Fully canceled orders are stored for up to 24 hours * - Single leg orders can also be found with "createType"=CreateByFutureSpread via Get Order History - * - From 2026-11-12, omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * - Planned change (postponed by Bybit, no new date yet): omitting orderStatus will exclude Cancelled, Rejected and Deactivated orders from the last 24 hours. * Pass orderStatus explicitly to retrieve matching orders from that period. * Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. * @see https://t.me/Bybit_API_Announcements/464 + * @see https://t.me/Bybit_API_Announcements/468 */ getSpreadOrderHistory(params?: GetSpreadOrderHistoryParamsV5): Promise< APIResponseV3WithTime<{ @@ -1349,9 +1350,10 @@ export class RestClientV5 extends BaseRestClient { * * If you want to get real-time order information, you could query this endpoint or rely on the websocket stream (recommended). * - * From 2026-11-12, omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * Planned change (postponed by Bybit, no new date yet): omitting orderStatus will exclude Cancelled, Rejected and Deactivated orders from the last 24 hours. * Pass orderStatus explicitly to retrieve matching orders from that period. * @see https://t.me/Bybit_API_Announcements/464 + * @see https://t.me/Bybit_API_Announcements/468 */ getHistoricOrders( params: GetAccountHistoricOrdersParamsV5, From 97eb4781b19d4052b0e919f679b65d1837f2681b Mon Sep 17 00:00:00 2001 From: JJ-Cro sync bot Date: Mon, 9 Nov 2026 10:47:40 +0100 Subject: [PATCH 7/9] chore: regenerate endpoint docs and examples --- docs/endpointFunctionList.md | 836 +- llms.txt | 13884 +++++++++++++++++---------------- 2 files changed, 7361 insertions(+), 7359 deletions(-) diff --git a/docs/endpointFunctionList.md b/docs/endpointFunctionList.md index 8a6d02fa..6fa181ee 100644 --- a/docs/endpointFunctionList.md +++ b/docs/endpointFunctionList.md @@ -63,424 +63,424 @@ This table includes all endpoints from the official Exchange API docs and corres | [cancelSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L873) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel` | | [cancelAllSpreadOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L891) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel-all` | | [getSpreadOpenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L910) | :closed_lock_with_key: | GET | `/v5/spread/order/realtime` | -| [getSpreadOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L931) | :closed_lock_with_key: | GET | `/v5/spread/order/history` | -| [getSpreadTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L947) | :closed_lock_with_key: | GET | `/v5/spread/execution/list` | -| [getKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L967) | | GET | `/v5/market/kline` | -| [getMarkPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L984) | | GET | `/v5/market/mark-price-kline` | -| [getIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L999) | | GET | `/v5/market/index-price-kline` | -| [getPremiumIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1014) | | GET | `/v5/market/premium-index-price-kline` | -| [getInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1030) | | GET | `/v5/market/instruments-info` | -| [getInstrumentSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1044) | | GET | `/v5/market/instrument-summary` | -| [getOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1055) | | GET | `/v5/market/orderbook` | -| [getFullDepthOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1061) | | GET | `/v5/market/full_orderbook` | -| [getRPIOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1075) | | GET | `/v5/market/rpi_orderbook` | -| [getTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1081) | | GET | `/v5/market/tickers` | -| [getFundingRateHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1119) | | GET | `/v5/market/funding/history` | -| [getPublicTradingHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1134) | | GET | `/v5/market/recent-trade` | -| [getOpenInterest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1147) | | GET | `/v5/market/open-interest` | -| [getHistoricalVolatility()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1157) | | GET | `/v5/market/historical-volatility` | -| [getInsurance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1168) | | GET | `/v5/market/insurance` | -| [getRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1179) | | GET | `/v5/market/risk-limit` | -| [getOptionDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1194) | | GET | `/v5/market/delivery-price` | -| [getDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1207) | | GET | `/v5/market/delivery-price` | -| [getNewDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1223) | | GET | `/v5/market/new-delivery-price` | -| [getLongShortRatio()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1239) | | GET | `/v5/market/account-ratio` | -| [getIndexPriceComponents()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1249) | | GET | `/v5/market/index-price-components` | -| [getOrderPriceLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1255) | | GET | `/v5/market/price-limit` | -| [getADLAlert()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1269) | | GET | `/v5/market/adlAlert` | -| [getFeeGroupStructure()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1282) | | GET | `/v5/market/fee-group-info` | -| [getOptionBaseCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1291) | | GET | `/v5/market/option-base-coins` | -| [getCorporateActions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1297) | | GET | `/v5/market/corporate-action` | -| [submitOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1312) | :closed_lock_with_key: | POST | `/v5/order/create` | -| [amendOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1318) | :closed_lock_with_key: | POST | `/v5/order/amend` | -| [cancelOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1324) | :closed_lock_with_key: | POST | `/v5/order/cancel` | -| [getActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1333) | :closed_lock_with_key: | GET | `/v5/order/realtime` | -| [cancelAllOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1339) | :closed_lock_with_key: | POST | `/v5/order/cancel-all` | -| [getHistoricOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1356) | :closed_lock_with_key: | GET | `/v5/order/history` | -| [getExecutionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1368) | :closed_lock_with_key: | GET | `/v5/execution/list` | -| [batchSubmitOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1386) | :closed_lock_with_key: | POST | `/v5/order/create-batch` | -| [batchAmendOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1411) | :closed_lock_with_key: | POST | `/v5/order/amend-batch` | -| [batchCancelOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1436) | :closed_lock_with_key: | POST | `/v5/order/cancel-batch` | -| [getSpotBorrowCheck()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1458) | :closed_lock_with_key: | GET | `/v5/order/spot-borrow-check` | -| [setDisconnectCancelAllWindow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1479) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | -| [setDisconnectCancelAllWindowV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1497) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | -| [preCheckOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1512) | :closed_lock_with_key: | POST | `/v5/order/pre-check` | -| [createStrategyOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1529) | :closed_lock_with_key: | POST | `/v5/strategy/create` | -| [getStrategyList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1540) | :closed_lock_with_key: | GET | `/v5/strategy/list` | -| [getStrategyOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1551) | :closed_lock_with_key: | GET | `/v5/strategy/order-list` | -| [stopStrategy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1562) | :closed_lock_with_key: | POST | `/v5/strategy/stop` | -| [getPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1587) | :closed_lock_with_key: | GET | `/v5/position/list` | -| [getFuturesLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1599) | :closed_lock_with_key: | GET | `/v5/position/symbol-info` | -| [setLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1614) | :closed_lock_with_key: | POST | `/v5/position/set-leverage` | -| [switchIsolatedMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1627) | :closed_lock_with_key: | POST | `/v5/position/switch-isolated` | -| [setTPSLMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1641) | :closed_lock_with_key: | POST | `/v5/position/set-tpsl-mode` | -| [switchPositionMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1656) | :closed_lock_with_key: | POST | `/v5/position/switch-mode` | -| [setRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1670) | :closed_lock_with_key: | POST | `/v5/position/set-risk-limit` | -| [setTradingStop()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1685) | :closed_lock_with_key: | POST | `/v5/position/trading-stop` | -| [setAutoAddMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1696) | :closed_lock_with_key: | POST | `/v5/position/set-auto-add-margin` | -| [addOrReduceMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1708) | :closed_lock_with_key: | POST | `/v5/position/add-margin` | -| [getClosedPnL()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1720) | :closed_lock_with_key: | GET | `/v5/position/closed-pnl` | -| [getClosedOptionsPositions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1734) | :closed_lock_with_key: | GET | `/v5/position/get-closed-positions` | -| [movePosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1759) | :closed_lock_with_key: | POST | `/v5/position/move-positions` | -| [getMovePositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1770) | :closed_lock_with_key: | GET | `/v5/position/move-history` | -| [confirmNewRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1789) | :closed_lock_with_key: | POST | `/v5/position/confirm-pending-mmr` | -| [getPreUpgradeOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1809) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/order/history` | -| [getPreUpgradeTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1824) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/execution/list` | -| [getPreUpgradeClosedPnl()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1835) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/position/closed-pnl` | -| [getPreUpgradeTransactions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1849) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/account/transaction-log` | -| [getPreUpgradeOptionDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1866) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/delivery-record` | -| [getPreUpgradeUSDCSessionSettlements()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1880) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/settlement-record` | -| [getWalletBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1901) | :closed_lock_with_key: | GET | `/v5/account/wallet-balance` | -| [getTransferableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1912) | :closed_lock_with_key: | GET | `/v5/account/withdrawal` | -| [getAccountInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1929) | :closed_lock_with_key: | GET | `/v5/account/instruments-info` | -| [upgradeToUnifiedAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1940) | :closed_lock_with_key: | POST | `/v5/account/upgrade-to-uta` | -| [getBorrowHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1951) | :closed_lock_with_key: | GET | `/v5/account/borrow-history` | -| [repayLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1972) | :closed_lock_with_key: | POST | `/v5/account/quick-repayment` | -| [manualRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1997) | :closed_lock_with_key: | POST | `/v5/account/repay` | -| [setCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2006) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch` | -| [batchSetCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2012) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch-batch` | -| [getCollateralInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2022) | :closed_lock_with_key: | GET | `/v5/account/collateral-info` | -| [getCoinGreeks()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2031) | :closed_lock_with_key: | GET | `/v5/asset/coin-greeks` | -| [getFeeRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2044) | :closed_lock_with_key: | GET | `/v5/account/fee-rate` | -| [getAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2053) | :closed_lock_with_key: | GET | `/v5/account/info` | -| [getDCPInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2066) | :closed_lock_with_key: | GET | `/v5/account/query-dcp-info` | -| [getTransactionLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2073) | :closed_lock_with_key: | GET | `/v5/account/transaction-log` | -| [getClassicTransactionLogs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2084) | :closed_lock_with_key: | GET | `/v5/account/contract-transaction-log` | -| [getSMPGroup()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2095) | :closed_lock_with_key: | GET | `/v5/account/smp-group` | -| [setMarginMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2108) | :closed_lock_with_key: | POST | `/v5/account/set-margin-mode` | -| [setSpotHedging()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2125) | :closed_lock_with_key: | POST | `/v5/account/set-hedging-mode` | -| [setLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2138) | :closed_lock_with_key: | POST | `/v5/account/set-limit-px-action` | -| [getLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2149) | :closed_lock_with_key: | GET | `/v5/account/user-setting-config` | -| [setDeltaNeutralMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2157) | :closed_lock_with_key: | POST | `/v5/account/set-delta-mode` | -| [setMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2166) | :closed_lock_with_key: | POST | `/v5/account/mmp-modify` | -| [resetMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2173) | :closed_lock_with_key: | POST | `/v5/account/mmp-reset` | -| [getMMPState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2180) | :closed_lock_with_key: | GET | `/v5/account/mmp-state` | -| [getOptionAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2190) | :closed_lock_with_key: | GET | `/v5/account/option-asset-info` | -| [getPayInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2200) | :closed_lock_with_key: | GET | `/v5/account/pay-info` | -| [getTradeInfoForAnalysis()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2210) | :closed_lock_with_key: | GET | `/v5/account/trade-info-for-analysis` | -| [getAssetOverview()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2230) | :closed_lock_with_key: | GET | `/v5/asset/asset-overview` | -| [getPortfolioMarginInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2240) | :closed_lock_with_key: | GET | `/v5/asset/portfolio-margin` | -| [getTotalMembersAssets()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2250) | :closed_lock_with_key: | GET | `/v5/asset/total-members-assets` | -| [getFundingAccountTransactionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2262) | :closed_lock_with_key: | GET | `/v5/asset/fundinghistory` | -| [getDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2278) | :closed_lock_with_key: | GET | `/v5/asset/delivery-record` | -| [getSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2289) | :closed_lock_with_key: | GET | `/v5/asset/settlement-record` | -| [getCoinExchangeRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2302) | :closed_lock_with_key: | GET | `/v5/asset/exchange/order-record` | -| [getCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2317) | :closed_lock_with_key: | GET | `/v5/asset/coin/query-info` | -| [getSubUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2331) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-sub-member-list` | -| [getAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2346) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-asset-info` | -| [getAllCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2357) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | -| [getCoinBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2371) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coin-balance` | -| [getWithdrawableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2385) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/withdrawable-amount` | -| [getTransferableCoinList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2394) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-transfer-coin-list` | -| [createInternalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2410) | :closed_lock_with_key: | POST | `/v5/asset/transfer/inter-transfer` | -| [getInternalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2429) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-inter-transfer-list` | -| [enableUniversalTransferForSubUIDs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2449) | :closed_lock_with_key: | POST | `/v5/asset/transfer/save-transfer-sub-member` | -| [createUniversalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2460) | :closed_lock_with_key: | POST | `/v5/asset/transfer/universal-transfer` | -| [getUniversalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2472) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-universal-transfer-list` | -| [getAllowedDepositCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2485) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-allowed-list` | -| [setDepositAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2500) | :closed_lock_with_key: | POST | `/v5/asset/deposit/deposit-to-account` | -| [getDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2516) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-record` | -| [getSubAccountDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2531) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-record` | -| [getInternalDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2547) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-internal-record` | -| [getMasterDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2559) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-address` | -| [getSubDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2577) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | -| [querySubMemberAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2602) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | -| [getWithdrawalRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2622) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-record` | -| [getWithdrawalAddressList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2634) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-address` | -| [getExchangeEntities()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2648) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/vasp/list` | -| [submitDepositOriginatorInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2658) | :closed_lock_with_key: | POST | `/v5/asset/travel-rule/deposit/submit` | -| [submitWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2673) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/create` | -| [cancelWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2684) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/cancel` | -| [getConvertCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2693) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-coin-list` | -| [requestConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2704) | :closed_lock_with_key: | POST | `/v5/asset/exchange/quote-apply` | -| [confirmConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2713) | :closed_lock_with_key: | POST | `/v5/asset/exchange/convert-execute` | -| [getConvertStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2725) | :closed_lock_with_key: | GET | `/v5/asset/exchange/convert-result-query` | -| [getConvertHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2744) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-convert-history` | -| [getSmallBalanceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2761) | :closed_lock_with_key: | GET | `/v5/asset/covert/small-balance-list` | -| [getFiatTradingPairList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2775) | :closed_lock_with_key: | GET | `/v5/fiat/query-coin-list` | -| [createSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2793) | :closed_lock_with_key: | POST | `/v5/user/create-sub-member` | -| [createSubUIDAPIKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2805) | :closed_lock_with_key: | POST | `/v5/user/create-sub-api` | -| [getSubUIDList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2814) | :closed_lock_with_key: | GET | `/v5/user/query-sub-members` | -| [getSubUIDListUnlimited()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2823) | :closed_lock_with_key: | GET | `/v5/user/submembers` | -| [setSubUIDFrozenState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2841) | :closed_lock_with_key: | POST | `/v5/user/frozen-sub-member` | -| [getQueryApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2856) | :closed_lock_with_key: | GET | `/v5/user/query-api` | -| [getSubAccountAllApiKeys()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2863) | :closed_lock_with_key: | GET | `/v5/user/sub-apikeys` | -| [getUIDWalletType()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2872) | :closed_lock_with_key: | GET | `/v5/user/get-member-type` | -| [updateMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2891) | :closed_lock_with_key: | POST | `/v5/user/update-api` | -| [updateSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2905) | :closed_lock_with_key: | POST | `/v5/user/update-sub-api` | -| [deleteSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2918) | :closed_lock_with_key: | POST | `/v5/user/del-submember` | -| [deleteMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2933) | :closed_lock_with_key: | POST | `/v5/user/delete-api` | -| [deleteSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2947) | :closed_lock_with_key: | POST | `/v5/user/delete-sub-api` | -| [createTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2962) | :closed_lock_with_key: | POST | `/v5/fht/compliance/tax/private/batch_create` | -| [getTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2974) | :closed_lock_with_key: | GET | `/v5/fht/compliance/tax/private/batch_query` | -| [getAffiliateUserList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2997) | :closed_lock_with_key: | GET | `/v5/affiliate/aff-user-list` | -| [getAffiliateSubAffiliateList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3015) | :closed_lock_with_key: | GET | `/v5/affiliate/affiliate-sub-list` | -| [getAffiliateUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3031) | :closed_lock_with_key: | GET | `/v5/user/aff-customer-info` | -| [getFriendReferrals()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3043) | :closed_lock_with_key: | GET | `/v5/user/invitation/referrals` | -| [getReferralCode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3052) | :closed_lock_with_key: | GET | `/v5/user/invitation/code` | -| [getReferralCommissionRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3064) | :closed_lock_with_key: | POST | `/v5/referral/commission/records` | -| [getReferralCampaignRewards()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3077) | :closed_lock_with_key: | POST | `/v5/referral/campaign/rewards` | -| [getReferralUserIdentityProfile()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3092) | :closed_lock_with_key: | POST | `/v5/referral/user/identity-profile` | -| [getReferralUserInvitations()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3105) | :closed_lock_with_key: | POST | `/v5/referral/user/invitations` | -| [signAgreement()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3123) | :closed_lock_with_key: | POST | `/v5/user/agreement` | -| [getAlphaTradeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3140) | :closed_lock_with_key: | POST | `/v5/alpha/trade/quote` | -| [executeAlphaTradePurchase()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3151) | :closed_lock_with_key: | POST | `/v5/alpha/trade/purchase` | -| [executeAlphaTradeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3162) | :closed_lock_with_key: | POST | `/v5/alpha/trade/redeem` | -| [getAlphaPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3172) | :closed_lock_with_key: | POST | `/v5/alpha/trade/pay-token-list` | -| [getAlphaTradeOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3182) | :closed_lock_with_key: | POST | `/v5/alpha/trade/order-list` | -| [getAlphaBizTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3192) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-list` | -| [getAlphaBizTokenPriceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3202) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-price-list` | -| [getAlphaBizTokenDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3212) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-details` | -| [getAlphaAssetList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3222) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-list` | -| [getAlphaAssetDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3230) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-detail` | -| [getAlphaPredictionEngineStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3246) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/engine-status` | -| [getAlphaPredictionPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3256) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/pay-token-list` | -| [getAlphaPredictionEventDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3266) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/event-detail` | -| [getAlphaPredictionOrderEstimate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3276) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-estimate` | -| [executeAlphaPredictionBuy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3286) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/buy` | -| [executeAlphaPredictionSell()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3296) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sell` | -| [getAlphaPredictionOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3306) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-list` | -| [getAlphaPredictionOrderBook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3316) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-book` | -| [getAlphaPredictionTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3326) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/token-price` | -| [getAlphaPredictionPriceHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3336) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/price-history` | -| [getAlphaPredictionPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3346) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-list` | -| [getAlphaPredictionPositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3356) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-history` | -| [getAlphaPredictionPortfolioSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3366) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/portfolio-summary` | -| [getAlphaPredictionSideMarketList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3376) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/side-market-list` | -| [getAlphaPredictionSportsMatchList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3386) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/match-list` | -| [getAlphaPredictionSportsTimelineStages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3396) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/sports/timeline-stages` | -| [getAlphaPredictionSportsGroupStageDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3409) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/group-stage-detail` | -| [getAlphaLPPoolList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3428) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-list` | -| [getAlphaLPPoolInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3438) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-info` | -| [executeAlphaLPStake()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3448) | :closed_lock_with_key: | POST | `/v5/alpha/lp/stake` | -| [executeAlphaLPRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3458) | :closed_lock_with_key: | POST | `/v5/alpha/lp/redeem` | -| [getAlphaLPOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3468) | :closed_lock_with_key: | POST | `/v5/alpha/lp/order-list` | -| [getAlphaLPPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3478) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-list` | -| [getAlphaLPPayTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3488) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-price` | -| [getAlphaLPPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3498) | :closed_lock_with_key: | POST | `/v5/alpha/lp/position-list` | -| [getVIPMarginData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3518) | | GET | `/v5/spot-margin-trade/data` | -| [getHistoricalInterestRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3529) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/interest-rate-history` | -| [getSpotMarginCurrencyData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3554) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/currency-data` | -| [toggleSpotMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3566) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/switch-mode` | -| [setSpotMarginLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3577) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | -| [setSpotMarginLeverageV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3585) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | -| [getSpotMarginState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3596) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/state` | -| [manualBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3603) | :closed_lock_with_key: | POST | `/v5/account/borrow` | -| [getMaxBorrowableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3618) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/max-borrowable` | -| [getPositionTiers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3627) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/position-tiers` | -| [getCoinState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3638) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/coinstate` | -| [getAvailableAmountToRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3649) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/repayment-available-amount` | -| [manualRepayWithoutConversion()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3668) | :closed_lock_with_key: | POST | `/v5/account/no-convert-repay` | -| [getAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3681) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-auto-repay-mode` | -| [setAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3699) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-auto-repay-mode` | -| [getTradeAutoRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3714) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-trade-auto-repay` | -| [setTradeAutoRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3725) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-trade-auto-repay` | -| [getSpotMarginLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3737) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/liability` | -| [submitFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3746) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow` | -| [getFixedRateBorrowOrderInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3755) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-info` | -| [getFixedRateBorrowContractInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3772) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-contract-info` | -| [getFixedRateBorrowOrderQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3789) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-quote` | -| [renewFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3801) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-renew` | -| [getFixedRateBorrowInterestAccrued()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3807) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-interest-accrued` | -| [cancelFixedRateBorrowOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3821) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-order-cancel` | -| [getFlexibleAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3830) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/flexible-available-inventory` | -| [getFixedRateAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3839) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixed-available-inventory` | -| [getSpotMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3857) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/pledge-token` | -| [getSpotMarginBorrowableCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3874) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/borrow-token` | -| [getSpotMarginInterestAndQuota()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3891) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/loan-info` | -| [getSpotMarginLoanAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3909) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/account` | -| [spotMarginBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3933) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/loan` | -| [spotMarginRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3944) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/repay` | -| [getSpotMarginBorrowOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3959) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/orders` | -| [getSpotMarginRepaymentOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3988) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/repay-history` | -| [toggleSpotCrossMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4017) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/switch` | -| [getCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4037) | | GET | `/v5/crypto-loan/collateral-data` | -| [getBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4054) | | GET | `/v5/crypto-loan/loanable-data` | -| [getAccountBorrowCollateralLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4072) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrowable-collateralisable-number` | -| [borrowCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4092) | :closed_lock_with_key: | POST | `/v5/crypto-loan/borrow` | -| [repayCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4113) | :closed_lock_with_key: | POST | `/v5/crypto-loan/repay` | -| [getUnpaidLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4129) | :closed_lock_with_key: | GET | `/v5/crypto-loan/ongoing-orders` | -| [getRepaymentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4150) | :closed_lock_with_key: | GET | `/v5/crypto-loan/repayment-history` | -| [getCompletedLoanOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4170) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrow-history` | -| [getMaxAllowedReductionCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4189) | :closed_lock_with_key: | GET | `/v5/crypto-loan/max-collateral-amount` | -| [adjustCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4208) | :closed_lock_with_key: | POST | `/v5/crypto-loan/adjust-ltv` | -| [getLoanLTVAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4232) | :closed_lock_with_key: | GET | `/v5/crypto-loan/adjustment-history` | -| [getLoanBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4253) | | GET | `/v5/crypto-loan-common/loanable-data` | -| [getLoanCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4265) | | GET | `/v5/crypto-loan-common/collateral-data` | -| [getMaxCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4275) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/max-collateral-amount` | -| [getMaxLoanAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4294) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/max-loan` | -| [updateCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4304) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/adjust-ltv` | -| [getCollateralAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4315) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/adjustment-history` | -| [getCryptoLoanPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4330) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/position` | -| [borrowFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4347) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/borrow` | -| [repayFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4358) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay` | -| [repayCollateralFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4368) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | -| [getOngoingFlexibleLoans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4382) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/ongoing-coin` | -| [getBorrowHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4394) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/borrow-history` | -| [getRepaymentHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4407) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/repayment-history` | -| [getFlexibleLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4421) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/available-inventory` | -| [getSupplyOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4441) | | GET | `/v5/crypto-loan-fixed/supply-order-quote` | -| [getBorrowOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4454) | | GET | `/v5/crypto-loan-fixed/borrow-order-quote` | -| [createBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4467) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow` | -| [createSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4480) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply` | -| [cancelBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4490) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow-order-cancel` | -| [cancelSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4504) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply-order-cancel` | -| [getBorrowContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4517) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-contract-info` | -| [getSupplyContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4535) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-contract-info` | -| [getBorrowOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4553) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-order-info` | -| [getSupplyOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4566) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-order-info` | -| [repayFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4580) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/fully-repay` | -| [repayCollateralFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4591) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | -| [getRepaymentHistoryFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4604) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/repayment-history` | -| [renewBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4621) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/renew` | -| [getRenewOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4634) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/renew-info` | -| [getFixedLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4643) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/available-inventory` | -| [getInstitutionalLendingProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4658) | | GET | `/v5/ins-loan/product-infos` | -| [getInstitutionalLendingCoinDeltaAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4670) | :closed_lock_with_key: | GET | `/v5/ins-loan/coin-delta-amount` | -| [getInstitutionalLendingDelayLiquidationStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4679) | :closed_lock_with_key: | GET | `/v5/ins-loan/delay-liq-status` | -| [getInstitutionalLendingMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4689) | | GET | `/v5/ins-loan/ensure-tokens` | -| [getInstitutionalLendingMarginCoinInfoWithConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4698) | | GET | `/v5/ins-loan/ensure-tokens-convert` | -| [getInstitutionalLendingLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4707) | :closed_lock_with_key: | GET | `/v5/ins-loan/loan-order` | -| [getInstitutionalLendingRepayOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4719) | :closed_lock_with_key: | GET | `/v5/ins-loan/repaid-history` | -| [getInstitutionalLendingLTV()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4731) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv` | -| [getInstitutionalLendingLTVWithLadderConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4740) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv-convert` | -| [bindOrUnbindUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4755) | :closed_lock_with_key: | POST | `/v5/ins-loan/association-uid` | -| [repayInstitutionalLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4775) | :closed_lock_with_key: | POST | `/v5/ins-loan/repay-loan` | -| [getExchangeBrokerEarnings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4796) | :closed_lock_with_key: | GET | `/v5/broker/earnings-info` | -| [getExchangeBrokerAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4809) | :closed_lock_with_key: | GET | `/v5/broker/account-info` | -| [getBrokerSubAccountDeposits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4825) | :closed_lock_with_key: | GET | `/v5/broker/asset/query-sub-member-deposit-record` | -| [getBrokerVoucherSpec()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4840) | :closed_lock_with_key: | POST | `/v5/broker/award/info` | -| [issueBrokerVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4852) | :closed_lock_with_key: | POST | `/v5/broker/award/distribute-award` | -| [getBrokerIssuedVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4864) | :closed_lock_with_key: | POST | `/v5/broker/award/distribution-record` | -| [setBrokerRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4881) | :closed_lock_with_key: | POST | `/v5/broker/apilimit/set` | -| [getBrokerRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4900) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-cap` | -| [getAllBrokerRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4918) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-all` | -| [getEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4938) | | GET | `/v5/earn/product` | -| [getFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4949) | :closed_lock_with_key: | GET | `/v5/earn/flexible-saving/auto-savings` | -| [setFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4960) | :closed_lock_with_key: | POST | `/v5/earn/flexible-saving/auto-savings` | -| [getEarnCouponList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4970) | :closed_lock_with_key: | GET | `/v5/earn/coupons` | -| [getRWAProductList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4980) | | GET | `/v5/earn/rwa/product` | -| [placeRWAOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4990) | :closed_lock_with_key: | POST | `/v5/earn/rwa/place-order` | -| [getRWAPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4999) | :closed_lock_with_key: | GET | `/v5/earn/rwa/position` | -| [getRWAOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5008) | :closed_lock_with_key: | GET | `/v5/earn/rwa/order` | -| [getRWANavChart()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5018) | | GET | `/v5/earn/rwa/nav-chart` | -| [getHoldToEarnAirdropProducts()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5029) | | GET | `/v5/earn/hold-to-earn/product` | -| [getAdvanceEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5040) | | GET | `/v5/earn/advance/product` | -| [getLiquidityMiningProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5051) | | GET | `/v5/earn/liquidity-mining/product` | -| [reinvestLiquidityMining()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5064) | :closed_lock_with_key: | POST | `/v5/earn/liquidity-mining/reinvest` | -| [getFixedTermEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5075) | | GET | `/v5/earn/fixed-term/product` | -| [getAdvanceEarnProductExtraInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5087) | | GET | `/v5/earn/advance/product-extra-info` | -| [submitAdvanceEarnPlaceOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5098) | :closed_lock_with_key: | POST | `/v5/earn/advance/place-order` | -| [getAdvanceEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5109) | :closed_lock_with_key: | GET | `/v5/earn/advance/position` | -| [getAdvanceEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5120) | :closed_lock_with_key: | GET | `/v5/earn/advance/order` | -| [submitFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5131) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/place-order` | -| [redeemFixedTermEarn()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5142) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/redeem` | -| [getFixedTermEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5153) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/position` | -| [getFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5164) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/order` | -| [setFixedTermEarnAutoInvest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5175) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/position/auto-invest` | -| [submitStakeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5191) | :closed_lock_with_key: | POST | `/v5/earn/place-order` | -| [getEarnOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5210) | :closed_lock_with_key: | GET | `/v5/earn/order` | -| [getEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5228) | :closed_lock_with_key: | GET | `/v5/earn/position` | -| [modifyEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5241) | :closed_lock_with_key: | POST | `/v5/earn/position/modify` | -| [getEarnYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5254) | :closed_lock_with_key: | GET | `/v5/earn/yield` | -| [getHoldToEarnAirdropYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5268) | :closed_lock_with_key: | GET | `/v5/earn/hold-to-earn/yield-history` | -| [getEarnHourlyYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5279) | :closed_lock_with_key: | GET | `/v5/earn/hourly-yield` | -| [getEarnAprHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5293) | | GET | `/v5/earn/apr-history` | -| [getEarnTokenProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5303) | | GET | `/v5/earn/token/product` | -| [submitEarnTokenOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5312) | :closed_lock_with_key: | POST | `/v5/earn/token/place-order` | -| [getEarnTokenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5321) | :closed_lock_with_key: | GET | `/v5/earn/token/order` | -| [getEarnTokenPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5333) | :closed_lock_with_key: | GET | `/v5/earn/token/position` | -| [getEarnTokenDailyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5342) | :closed_lock_with_key: | GET | `/v5/earn/token/yield` | -| [getEarnTokenHourlyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5354) | :closed_lock_with_key: | GET | `/v5/earn/token/hourly-yield` | -| [getEarnTokenHistoryApr()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5366) | | GET | `/v5/earn/token/history-apr` | -| [getPwmInvestmentPlanList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5381) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/list` | -| [getPwmInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5390) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/detail` | -| [getPwmPendingInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5399) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/new-plan` | -| [claimPwmWithdrawableFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5408) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/claim` | -| [getPwmInvestmentPlanAssetTrend()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5417) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/asset-trend` | -| [getPwmFundHistoricalNav()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5426) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/fund-nav` | -| [subscribePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5435) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/subscribe` | -| [investMorePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5444) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/invest-more` | -| [redeemPwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5453) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/redeem` | -| [getPwmInvestmentPlanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5462) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/order` | -| [getPwmSubscribableProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5471) | | GET | `/v5/earn/pwm/customize-plan/product` | -| [createPwmCustomizeInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5480) | :closed_lock_with_key: | POST | `/v5/earn/pwm/customize-plan/create` | -| [getPwmAllFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5495) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-funds` | -| [settlePwmFundProfit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5504) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/settle-profit` | -| [createPwmFund()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5513) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-fund` | -| [createPwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5522) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-investment-plan` | -| [getPwmAssetManagerInvestmentPlans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5536) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/get-investment-plan` | -| [managePwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5548) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-investment-plan` | -| [getPwmAllFundOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5562) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-order` | -| [managePwmFundOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5571) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-order` | -| [createPwmFundSubAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5580) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-sub-account` | -| [pwmFundTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5592) | :closed_lock_with_key: | POST | `/v5/earn/pwm/fund-transfer` | -| [getPwmFundTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5601) | :closed_lock_with_key: | GET | `/v5/earn/pwm/query-fund-transfer-result` | -| [queryCardAssetRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5616) | :closed_lock_with_key: | POST | `/v5/card/transaction/query-asset-records` | -| [queryCardPointsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5625) | :closed_lock_with_key: | POST | `/v5/card/reward/points/balance` | -| [queryCardPointsRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5632) | :closed_lock_with_key: | POST | `/v5/card/reward/points/records` | -| [queryCardPointsTier()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5641) | :closed_lock_with_key: | POST | `/v5/card/reward/points/tier` | -| [queryCardMallItemList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5648) | :closed_lock_with_key: | POST | `/v5/card/reward/mall/item/list` | -| [queryCardPointCashbackDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5657) | :closed_lock_with_key: | POST | `/v5/card/reward/point/cashback/detail` | -| [createRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5673) | :closed_lock_with_key: | POST | `/v5/rfq/create-rfq` | -| [getRFQConfig()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5684) | :closed_lock_with_key: | GET | `/v5/rfq/config` | -| [cancelRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5693) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-rfq` | -| [cancelAllRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5703) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-rfq` | -| [createRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5712) | :closed_lock_with_key: | POST | `/v5/rfq/create-quote` | -| [executeRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5723) | :closed_lock_with_key: | POST | `/v5/rfq/execute-quote` | -| [cancelRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5734) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-quote` | -| [cancelAllRFQQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5744) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-quotes` | -| [getRFQRealtimeInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5758) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-realtime` | -| [getRFQHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5770) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-list` | -| [getRFQRealtimeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5784) | :closed_lock_with_key: | GET | `/v5/rfq/quote-realtime` | -| [getRFQHistoryQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5799) | :closed_lock_with_key: | GET | `/v5/rfq/quote-list` | -| [getRFQTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5812) | :closed_lock_with_key: | GET | `/v5/rfq/trade-list` | -| [getRFQPublicTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5825) | :closed_lock_with_key: | GET | `/v5/rfq/public-trades` | -| [acceptNonLPQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5841) | :closed_lock_with_key: | POST | `/v5/rfq/accept-other-quote` | -| [getRFQDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5847) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-detail-list` | -| [getP2PAccountCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5872) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | -| [getP2POnlineAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5889) | :closed_lock_with_key: | POST | `/v5/p2p/item/online` | -| [createP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5898) | :closed_lock_with_key: | POST | `/v5/p2p/item/create` | -| [cancelP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5907) | :closed_lock_with_key: | POST | `/v5/p2p/item/cancel` | -| [updateP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5921) | :closed_lock_with_key: | POST | `/v5/p2p/item/update` | -| [getP2PPersonalAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5931) | :closed_lock_with_key: | POST | `/v5/p2p/item/personal/list` | -| [getP2PAdDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5940) | :closed_lock_with_key: | POST | `/v5/p2p/item/info` | -| [getP2POrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5955) | :closed_lock_with_key: | POST | `/v5/p2p/order/simplifyList` | -| [getP2POrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5965) | :closed_lock_with_key: | POST | `/v5/p2p/order/info` | -| [getP2PPendingOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5974) | :closed_lock_with_key: | POST | `/v5/p2p/order/pending/simplifyList` | -| [markP2POrderAsPaid()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5983) | :closed_lock_with_key: | POST | `/v5/p2p/order/pay` | -| [releaseP2POrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5992) | :closed_lock_with_key: | POST | `/v5/p2p/order/finish` | -| [reviewP2PSellerCancelOrderApply()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6004) | :closed_lock_with_key: | POST | `/v5/p2p/order/buyer/examine/sellerCancelOrderApply` | -| [sendP2POrderMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6016) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/send` | -| [getP2PChatSessions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6031) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/list_v1` | -| [getP2PChatSessionId()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6041) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/getSessionId` | -| [sendP2PChatMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6077) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/send_v1` | -| [getP2PChatMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6089) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/listpage_v1` | -| [getP2POrderMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6098) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/listpage` | -| [getP2PUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6112) | :closed_lock_with_key: | POST | `/v5/p2p/user/personal/info` | -| [getP2PCounterpartyUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6119) | :closed_lock_with_key: | POST | `/v5/p2p/user/order/personal/info` | -| [getP2PUserPayments()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6128) | :closed_lock_with_key: | POST | `/v5/p2p/user/payment/list` | -| [setApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6148) | :closed_lock_with_key: | POST | `/v5/apilimit/set` | -| [queryApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6177) | :closed_lock_with_key: | GET | `/v5/apilimit/query` | -| [getRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6196) | :closed_lock_with_key: | GET | `/v5/apilimit/query-cap` | -| [getAllRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6215) | :closed_lock_with_key: | GET | `/v5/apilimit/query-all` | -| [getLaunchpoolProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6238) | | GET | `/v5/spot-x/launchpool/project/list` | -| [getLaunchpoolUserActivityLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6244) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/activity-log` | -| [getLaunchpoolCurrentStaking()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6250) | :closed_lock_with_key: | GET | `/v5/spot-x/launchpool/user/current-staking` | -| [getLaunchpoolUserHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6256) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/history` | -| [getPuzzleProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6262) | | GET | `/v5/spot-x/puzzle/project/list` | -| [getTokenSplashProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6268) | | GET | `/v5/spot-x/token-splash/project/list` | -| [getTokenSplashUserActivityParams()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6274) | :closed_lock_with_key: | GET | `/v5/spot-x/token-splash/user/activity-params` | -| [getEventInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6297) | | GET | `/v5/event/instruments-info` | -| [getEventOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6308) | | GET | `/v5/event/orderbook` | -| [getEventOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6319) | :closed_lock_with_key: | GET | `/v5/event/order-list` | -| [getEventActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6330) | :closed_lock_with_key: | GET | `/v5/event/order-realtime` | -| [getEventPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6341) | :closed_lock_with_key: | GET | `/v5/event/positions` | -| [getEventTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6352) | :closed_lock_with_key: | GET | `/v5/event/trades` | -| [getEventSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6363) | :closed_lock_with_key: | GET | `/v5/event/settlements` | -| [submitEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6374) | :closed_lock_with_key: | POST | `/v5/event/quotes` | -| [cancelEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6385) | :closed_lock_with_key: | POST | `/v5/event/cancel` | -| [cancelAllEventQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6396) | :closed_lock_with_key: | POST | `/v5/event/cancel-all` | +| [getSpreadOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L932) | :closed_lock_with_key: | GET | `/v5/spread/order/history` | +| [getSpreadTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L948) | :closed_lock_with_key: | GET | `/v5/spread/execution/list` | +| [getKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L968) | | GET | `/v5/market/kline` | +| [getMarkPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L985) | | GET | `/v5/market/mark-price-kline` | +| [getIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1000) | | GET | `/v5/market/index-price-kline` | +| [getPremiumIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1015) | | GET | `/v5/market/premium-index-price-kline` | +| [getInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1031) | | GET | `/v5/market/instruments-info` | +| [getInstrumentSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1045) | | GET | `/v5/market/instrument-summary` | +| [getOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1056) | | GET | `/v5/market/orderbook` | +| [getFullDepthOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1062) | | GET | `/v5/market/full_orderbook` | +| [getRPIOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1076) | | GET | `/v5/market/rpi_orderbook` | +| [getTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1082) | | GET | `/v5/market/tickers` | +| [getFundingRateHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1120) | | GET | `/v5/market/funding/history` | +| [getPublicTradingHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1135) | | GET | `/v5/market/recent-trade` | +| [getOpenInterest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1148) | | GET | `/v5/market/open-interest` | +| [getHistoricalVolatility()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1158) | | GET | `/v5/market/historical-volatility` | +| [getInsurance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1169) | | GET | `/v5/market/insurance` | +| [getRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1180) | | GET | `/v5/market/risk-limit` | +| [getOptionDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1195) | | GET | `/v5/market/delivery-price` | +| [getDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1208) | | GET | `/v5/market/delivery-price` | +| [getNewDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1224) | | GET | `/v5/market/new-delivery-price` | +| [getLongShortRatio()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1240) | | GET | `/v5/market/account-ratio` | +| [getIndexPriceComponents()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1250) | | GET | `/v5/market/index-price-components` | +| [getOrderPriceLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1256) | | GET | `/v5/market/price-limit` | +| [getADLAlert()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1270) | | GET | `/v5/market/adlAlert` | +| [getFeeGroupStructure()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1283) | | GET | `/v5/market/fee-group-info` | +| [getOptionBaseCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1292) | | GET | `/v5/market/option-base-coins` | +| [getCorporateActions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1298) | | GET | `/v5/market/corporate-action` | +| [submitOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1313) | :closed_lock_with_key: | POST | `/v5/order/create` | +| [amendOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1319) | :closed_lock_with_key: | POST | `/v5/order/amend` | +| [cancelOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1325) | :closed_lock_with_key: | POST | `/v5/order/cancel` | +| [getActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1334) | :closed_lock_with_key: | GET | `/v5/order/realtime` | +| [cancelAllOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1340) | :closed_lock_with_key: | POST | `/v5/order/cancel-all` | +| [getHistoricOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1358) | :closed_lock_with_key: | GET | `/v5/order/history` | +| [getExecutionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1370) | :closed_lock_with_key: | GET | `/v5/execution/list` | +| [batchSubmitOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1388) | :closed_lock_with_key: | POST | `/v5/order/create-batch` | +| [batchAmendOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1413) | :closed_lock_with_key: | POST | `/v5/order/amend-batch` | +| [batchCancelOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1438) | :closed_lock_with_key: | POST | `/v5/order/cancel-batch` | +| [getSpotBorrowCheck()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1460) | :closed_lock_with_key: | GET | `/v5/order/spot-borrow-check` | +| [setDisconnectCancelAllWindow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1481) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | +| [setDisconnectCancelAllWindowV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1499) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | +| [preCheckOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1514) | :closed_lock_with_key: | POST | `/v5/order/pre-check` | +| [createStrategyOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1531) | :closed_lock_with_key: | POST | `/v5/strategy/create` | +| [getStrategyList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1542) | :closed_lock_with_key: | GET | `/v5/strategy/list` | +| [getStrategyOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1553) | :closed_lock_with_key: | GET | `/v5/strategy/order-list` | +| [stopStrategy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1564) | :closed_lock_with_key: | POST | `/v5/strategy/stop` | +| [getPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1589) | :closed_lock_with_key: | GET | `/v5/position/list` | +| [getFuturesLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1601) | :closed_lock_with_key: | GET | `/v5/position/symbol-info` | +| [setLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1616) | :closed_lock_with_key: | POST | `/v5/position/set-leverage` | +| [switchIsolatedMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1629) | :closed_lock_with_key: | POST | `/v5/position/switch-isolated` | +| [setTPSLMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1643) | :closed_lock_with_key: | POST | `/v5/position/set-tpsl-mode` | +| [switchPositionMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1658) | :closed_lock_with_key: | POST | `/v5/position/switch-mode` | +| [setRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1672) | :closed_lock_with_key: | POST | `/v5/position/set-risk-limit` | +| [setTradingStop()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1687) | :closed_lock_with_key: | POST | `/v5/position/trading-stop` | +| [setAutoAddMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1698) | :closed_lock_with_key: | POST | `/v5/position/set-auto-add-margin` | +| [addOrReduceMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1710) | :closed_lock_with_key: | POST | `/v5/position/add-margin` | +| [getClosedPnL()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1722) | :closed_lock_with_key: | GET | `/v5/position/closed-pnl` | +| [getClosedOptionsPositions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1736) | :closed_lock_with_key: | GET | `/v5/position/get-closed-positions` | +| [movePosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1761) | :closed_lock_with_key: | POST | `/v5/position/move-positions` | +| [getMovePositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1772) | :closed_lock_with_key: | GET | `/v5/position/move-history` | +| [confirmNewRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1791) | :closed_lock_with_key: | POST | `/v5/position/confirm-pending-mmr` | +| [getPreUpgradeOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1811) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/order/history` | +| [getPreUpgradeTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1826) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/execution/list` | +| [getPreUpgradeClosedPnl()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1837) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/position/closed-pnl` | +| [getPreUpgradeTransactions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1851) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/account/transaction-log` | +| [getPreUpgradeOptionDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1868) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/delivery-record` | +| [getPreUpgradeUSDCSessionSettlements()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1882) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/settlement-record` | +| [getWalletBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1903) | :closed_lock_with_key: | GET | `/v5/account/wallet-balance` | +| [getTransferableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1914) | :closed_lock_with_key: | GET | `/v5/account/withdrawal` | +| [getAccountInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1931) | :closed_lock_with_key: | GET | `/v5/account/instruments-info` | +| [upgradeToUnifiedAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1942) | :closed_lock_with_key: | POST | `/v5/account/upgrade-to-uta` | +| [getBorrowHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1953) | :closed_lock_with_key: | GET | `/v5/account/borrow-history` | +| [repayLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1974) | :closed_lock_with_key: | POST | `/v5/account/quick-repayment` | +| [manualRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1999) | :closed_lock_with_key: | POST | `/v5/account/repay` | +| [setCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2008) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch` | +| [batchSetCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2014) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch-batch` | +| [getCollateralInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2024) | :closed_lock_with_key: | GET | `/v5/account/collateral-info` | +| [getCoinGreeks()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2033) | :closed_lock_with_key: | GET | `/v5/asset/coin-greeks` | +| [getFeeRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2046) | :closed_lock_with_key: | GET | `/v5/account/fee-rate` | +| [getAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2055) | :closed_lock_with_key: | GET | `/v5/account/info` | +| [getDCPInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2068) | :closed_lock_with_key: | GET | `/v5/account/query-dcp-info` | +| [getTransactionLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2075) | :closed_lock_with_key: | GET | `/v5/account/transaction-log` | +| [getClassicTransactionLogs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2086) | :closed_lock_with_key: | GET | `/v5/account/contract-transaction-log` | +| [getSMPGroup()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2097) | :closed_lock_with_key: | GET | `/v5/account/smp-group` | +| [setMarginMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2110) | :closed_lock_with_key: | POST | `/v5/account/set-margin-mode` | +| [setSpotHedging()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2127) | :closed_lock_with_key: | POST | `/v5/account/set-hedging-mode` | +| [setLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2140) | :closed_lock_with_key: | POST | `/v5/account/set-limit-px-action` | +| [getLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2151) | :closed_lock_with_key: | GET | `/v5/account/user-setting-config` | +| [setDeltaNeutralMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2159) | :closed_lock_with_key: | POST | `/v5/account/set-delta-mode` | +| [setMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2168) | :closed_lock_with_key: | POST | `/v5/account/mmp-modify` | +| [resetMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2175) | :closed_lock_with_key: | POST | `/v5/account/mmp-reset` | +| [getMMPState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2182) | :closed_lock_with_key: | GET | `/v5/account/mmp-state` | +| [getOptionAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2192) | :closed_lock_with_key: | GET | `/v5/account/option-asset-info` | +| [getPayInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2202) | :closed_lock_with_key: | GET | `/v5/account/pay-info` | +| [getTradeInfoForAnalysis()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2212) | :closed_lock_with_key: | GET | `/v5/account/trade-info-for-analysis` | +| [getAssetOverview()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2232) | :closed_lock_with_key: | GET | `/v5/asset/asset-overview` | +| [getPortfolioMarginInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2242) | :closed_lock_with_key: | GET | `/v5/asset/portfolio-margin` | +| [getTotalMembersAssets()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2252) | :closed_lock_with_key: | GET | `/v5/asset/total-members-assets` | +| [getFundingAccountTransactionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2264) | :closed_lock_with_key: | GET | `/v5/asset/fundinghistory` | +| [getDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2280) | :closed_lock_with_key: | GET | `/v5/asset/delivery-record` | +| [getSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2291) | :closed_lock_with_key: | GET | `/v5/asset/settlement-record` | +| [getCoinExchangeRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2304) | :closed_lock_with_key: | GET | `/v5/asset/exchange/order-record` | +| [getCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2319) | :closed_lock_with_key: | GET | `/v5/asset/coin/query-info` | +| [getSubUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2333) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-sub-member-list` | +| [getAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2348) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-asset-info` | +| [getAllCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2359) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | +| [getCoinBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2373) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coin-balance` | +| [getWithdrawableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2387) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/withdrawable-amount` | +| [getTransferableCoinList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2396) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-transfer-coin-list` | +| [createInternalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2412) | :closed_lock_with_key: | POST | `/v5/asset/transfer/inter-transfer` | +| [getInternalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2431) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-inter-transfer-list` | +| [enableUniversalTransferForSubUIDs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2451) | :closed_lock_with_key: | POST | `/v5/asset/transfer/save-transfer-sub-member` | +| [createUniversalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2462) | :closed_lock_with_key: | POST | `/v5/asset/transfer/universal-transfer` | +| [getUniversalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2474) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-universal-transfer-list` | +| [getAllowedDepositCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2487) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-allowed-list` | +| [setDepositAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2502) | :closed_lock_with_key: | POST | `/v5/asset/deposit/deposit-to-account` | +| [getDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2518) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-record` | +| [getSubAccountDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2533) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-record` | +| [getInternalDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2549) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-internal-record` | +| [getMasterDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2561) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-address` | +| [getSubDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2579) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | +| [querySubMemberAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2604) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | +| [getWithdrawalRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2624) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-record` | +| [getWithdrawalAddressList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2636) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-address` | +| [getExchangeEntities()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2650) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/vasp/list` | +| [submitDepositOriginatorInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2660) | :closed_lock_with_key: | POST | `/v5/asset/travel-rule/deposit/submit` | +| [submitWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2675) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/create` | +| [cancelWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2686) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/cancel` | +| [getConvertCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2695) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-coin-list` | +| [requestConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2706) | :closed_lock_with_key: | POST | `/v5/asset/exchange/quote-apply` | +| [confirmConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2715) | :closed_lock_with_key: | POST | `/v5/asset/exchange/convert-execute` | +| [getConvertStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2727) | :closed_lock_with_key: | GET | `/v5/asset/exchange/convert-result-query` | +| [getConvertHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2746) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-convert-history` | +| [getSmallBalanceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2763) | :closed_lock_with_key: | GET | `/v5/asset/covert/small-balance-list` | +| [getFiatTradingPairList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2777) | :closed_lock_with_key: | GET | `/v5/fiat/query-coin-list` | +| [createSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2795) | :closed_lock_with_key: | POST | `/v5/user/create-sub-member` | +| [createSubUIDAPIKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2807) | :closed_lock_with_key: | POST | `/v5/user/create-sub-api` | +| [getSubUIDList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2816) | :closed_lock_with_key: | GET | `/v5/user/query-sub-members` | +| [getSubUIDListUnlimited()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2825) | :closed_lock_with_key: | GET | `/v5/user/submembers` | +| [setSubUIDFrozenState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2843) | :closed_lock_with_key: | POST | `/v5/user/frozen-sub-member` | +| [getQueryApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2858) | :closed_lock_with_key: | GET | `/v5/user/query-api` | +| [getSubAccountAllApiKeys()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2865) | :closed_lock_with_key: | GET | `/v5/user/sub-apikeys` | +| [getUIDWalletType()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2874) | :closed_lock_with_key: | GET | `/v5/user/get-member-type` | +| [updateMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2893) | :closed_lock_with_key: | POST | `/v5/user/update-api` | +| [updateSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2907) | :closed_lock_with_key: | POST | `/v5/user/update-sub-api` | +| [deleteSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2920) | :closed_lock_with_key: | POST | `/v5/user/del-submember` | +| [deleteMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2935) | :closed_lock_with_key: | POST | `/v5/user/delete-api` | +| [deleteSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2949) | :closed_lock_with_key: | POST | `/v5/user/delete-sub-api` | +| [createTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2964) | :closed_lock_with_key: | POST | `/v5/fht/compliance/tax/private/batch_create` | +| [getTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2976) | :closed_lock_with_key: | GET | `/v5/fht/compliance/tax/private/batch_query` | +| [getAffiliateUserList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2999) | :closed_lock_with_key: | GET | `/v5/affiliate/aff-user-list` | +| [getAffiliateSubAffiliateList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3017) | :closed_lock_with_key: | GET | `/v5/affiliate/affiliate-sub-list` | +| [getAffiliateUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3033) | :closed_lock_with_key: | GET | `/v5/user/aff-customer-info` | +| [getFriendReferrals()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3045) | :closed_lock_with_key: | GET | `/v5/user/invitation/referrals` | +| [getReferralCode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3054) | :closed_lock_with_key: | GET | `/v5/user/invitation/code` | +| [getReferralCommissionRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3066) | :closed_lock_with_key: | POST | `/v5/referral/commission/records` | +| [getReferralCampaignRewards()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3079) | :closed_lock_with_key: | POST | `/v5/referral/campaign/rewards` | +| [getReferralUserIdentityProfile()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3094) | :closed_lock_with_key: | POST | `/v5/referral/user/identity-profile` | +| [getReferralUserInvitations()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3107) | :closed_lock_with_key: | POST | `/v5/referral/user/invitations` | +| [signAgreement()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3125) | :closed_lock_with_key: | POST | `/v5/user/agreement` | +| [getAlphaTradeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3142) | :closed_lock_with_key: | POST | `/v5/alpha/trade/quote` | +| [executeAlphaTradePurchase()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3153) | :closed_lock_with_key: | POST | `/v5/alpha/trade/purchase` | +| [executeAlphaTradeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3164) | :closed_lock_with_key: | POST | `/v5/alpha/trade/redeem` | +| [getAlphaPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3174) | :closed_lock_with_key: | POST | `/v5/alpha/trade/pay-token-list` | +| [getAlphaTradeOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3184) | :closed_lock_with_key: | POST | `/v5/alpha/trade/order-list` | +| [getAlphaBizTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3194) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-list` | +| [getAlphaBizTokenPriceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3204) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-price-list` | +| [getAlphaBizTokenDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3214) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-details` | +| [getAlphaAssetList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3224) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-list` | +| [getAlphaAssetDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3232) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-detail` | +| [getAlphaPredictionEngineStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3248) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/engine-status` | +| [getAlphaPredictionPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3258) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/pay-token-list` | +| [getAlphaPredictionEventDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3268) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/event-detail` | +| [getAlphaPredictionOrderEstimate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3278) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-estimate` | +| [executeAlphaPredictionBuy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3288) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/buy` | +| [executeAlphaPredictionSell()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3298) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sell` | +| [getAlphaPredictionOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3308) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-list` | +| [getAlphaPredictionOrderBook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3318) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-book` | +| [getAlphaPredictionTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3328) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/token-price` | +| [getAlphaPredictionPriceHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3338) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/price-history` | +| [getAlphaPredictionPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3348) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-list` | +| [getAlphaPredictionPositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3358) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-history` | +| [getAlphaPredictionPortfolioSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3368) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/portfolio-summary` | +| [getAlphaPredictionSideMarketList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3378) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/side-market-list` | +| [getAlphaPredictionSportsMatchList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3388) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/match-list` | +| [getAlphaPredictionSportsTimelineStages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3398) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/sports/timeline-stages` | +| [getAlphaPredictionSportsGroupStageDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3411) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/group-stage-detail` | +| [getAlphaLPPoolList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3430) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-list` | +| [getAlphaLPPoolInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3440) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-info` | +| [executeAlphaLPStake()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3450) | :closed_lock_with_key: | POST | `/v5/alpha/lp/stake` | +| [executeAlphaLPRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3460) | :closed_lock_with_key: | POST | `/v5/alpha/lp/redeem` | +| [getAlphaLPOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3470) | :closed_lock_with_key: | POST | `/v5/alpha/lp/order-list` | +| [getAlphaLPPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3480) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-list` | +| [getAlphaLPPayTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3490) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-price` | +| [getAlphaLPPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3500) | :closed_lock_with_key: | POST | `/v5/alpha/lp/position-list` | +| [getVIPMarginData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3520) | | GET | `/v5/spot-margin-trade/data` | +| [getHistoricalInterestRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3531) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/interest-rate-history` | +| [getSpotMarginCurrencyData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3556) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/currency-data` | +| [toggleSpotMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3568) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/switch-mode` | +| [setSpotMarginLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3579) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | +| [setSpotMarginLeverageV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3587) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | +| [getSpotMarginState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3598) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/state` | +| [manualBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3605) | :closed_lock_with_key: | POST | `/v5/account/borrow` | +| [getMaxBorrowableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3620) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/max-borrowable` | +| [getPositionTiers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3629) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/position-tiers` | +| [getCoinState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3640) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/coinstate` | +| [getAvailableAmountToRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3651) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/repayment-available-amount` | +| [manualRepayWithoutConversion()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3670) | :closed_lock_with_key: | POST | `/v5/account/no-convert-repay` | +| [getAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3683) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-auto-repay-mode` | +| [setAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3701) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-auto-repay-mode` | +| [getTradeAutoRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3716) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-trade-auto-repay` | +| [setTradeAutoRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3727) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-trade-auto-repay` | +| [getSpotMarginLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3739) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/liability` | +| [submitFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3748) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow` | +| [getFixedRateBorrowOrderInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3757) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-info` | +| [getFixedRateBorrowContractInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3774) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-contract-info` | +| [getFixedRateBorrowOrderQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3791) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-quote` | +| [renewFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3803) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-renew` | +| [getFixedRateBorrowInterestAccrued()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3809) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-interest-accrued` | +| [cancelFixedRateBorrowOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3823) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-order-cancel` | +| [getFlexibleAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3832) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/flexible-available-inventory` | +| [getFixedRateAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3841) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixed-available-inventory` | +| [getSpotMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3859) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/pledge-token` | +| [getSpotMarginBorrowableCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3876) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/borrow-token` | +| [getSpotMarginInterestAndQuota()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3893) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/loan-info` | +| [getSpotMarginLoanAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3911) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/account` | +| [spotMarginBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3935) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/loan` | +| [spotMarginRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3946) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/repay` | +| [getSpotMarginBorrowOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3961) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/orders` | +| [getSpotMarginRepaymentOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3990) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/repay-history` | +| [toggleSpotCrossMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4019) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/switch` | +| [getCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4039) | | GET | `/v5/crypto-loan/collateral-data` | +| [getBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4056) | | GET | `/v5/crypto-loan/loanable-data` | +| [getAccountBorrowCollateralLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4074) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrowable-collateralisable-number` | +| [borrowCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4094) | :closed_lock_with_key: | POST | `/v5/crypto-loan/borrow` | +| [repayCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4115) | :closed_lock_with_key: | POST | `/v5/crypto-loan/repay` | +| [getUnpaidLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4131) | :closed_lock_with_key: | GET | `/v5/crypto-loan/ongoing-orders` | +| [getRepaymentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4152) | :closed_lock_with_key: | GET | `/v5/crypto-loan/repayment-history` | +| [getCompletedLoanOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4172) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrow-history` | +| [getMaxAllowedReductionCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4191) | :closed_lock_with_key: | GET | `/v5/crypto-loan/max-collateral-amount` | +| [adjustCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4210) | :closed_lock_with_key: | POST | `/v5/crypto-loan/adjust-ltv` | +| [getLoanLTVAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4234) | :closed_lock_with_key: | GET | `/v5/crypto-loan/adjustment-history` | +| [getLoanBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4255) | | GET | `/v5/crypto-loan-common/loanable-data` | +| [getLoanCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4267) | | GET | `/v5/crypto-loan-common/collateral-data` | +| [getMaxCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4277) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/max-collateral-amount` | +| [getMaxLoanAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4296) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/max-loan` | +| [updateCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4306) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/adjust-ltv` | +| [getCollateralAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4317) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/adjustment-history` | +| [getCryptoLoanPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4332) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/position` | +| [borrowFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4349) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/borrow` | +| [repayFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4360) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay` | +| [repayCollateralFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4370) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | +| [getOngoingFlexibleLoans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4384) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/ongoing-coin` | +| [getBorrowHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4396) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/borrow-history` | +| [getRepaymentHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4409) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/repayment-history` | +| [getFlexibleLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4423) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/available-inventory` | +| [getSupplyOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4443) | | GET | `/v5/crypto-loan-fixed/supply-order-quote` | +| [getBorrowOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4456) | | GET | `/v5/crypto-loan-fixed/borrow-order-quote` | +| [createBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4469) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow` | +| [createSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4482) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply` | +| [cancelBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4492) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow-order-cancel` | +| [cancelSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4506) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply-order-cancel` | +| [getBorrowContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4519) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-contract-info` | +| [getSupplyContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4537) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-contract-info` | +| [getBorrowOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4555) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-order-info` | +| [getSupplyOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4568) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-order-info` | +| [repayFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4582) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/fully-repay` | +| [repayCollateralFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4593) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | +| [getRepaymentHistoryFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4606) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/repayment-history` | +| [renewBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4623) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/renew` | +| [getRenewOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4636) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/renew-info` | +| [getFixedLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4645) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/available-inventory` | +| [getInstitutionalLendingProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4660) | | GET | `/v5/ins-loan/product-infos` | +| [getInstitutionalLendingCoinDeltaAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4672) | :closed_lock_with_key: | GET | `/v5/ins-loan/coin-delta-amount` | +| [getInstitutionalLendingDelayLiquidationStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4681) | :closed_lock_with_key: | GET | `/v5/ins-loan/delay-liq-status` | +| [getInstitutionalLendingMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4691) | | GET | `/v5/ins-loan/ensure-tokens` | +| [getInstitutionalLendingMarginCoinInfoWithConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4700) | | GET | `/v5/ins-loan/ensure-tokens-convert` | +| [getInstitutionalLendingLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4709) | :closed_lock_with_key: | GET | `/v5/ins-loan/loan-order` | +| [getInstitutionalLendingRepayOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4721) | :closed_lock_with_key: | GET | `/v5/ins-loan/repaid-history` | +| [getInstitutionalLendingLTV()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4733) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv` | +| [getInstitutionalLendingLTVWithLadderConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4742) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv-convert` | +| [bindOrUnbindUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4757) | :closed_lock_with_key: | POST | `/v5/ins-loan/association-uid` | +| [repayInstitutionalLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4777) | :closed_lock_with_key: | POST | `/v5/ins-loan/repay-loan` | +| [getExchangeBrokerEarnings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4798) | :closed_lock_with_key: | GET | `/v5/broker/earnings-info` | +| [getExchangeBrokerAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4811) | :closed_lock_with_key: | GET | `/v5/broker/account-info` | +| [getBrokerSubAccountDeposits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4827) | :closed_lock_with_key: | GET | `/v5/broker/asset/query-sub-member-deposit-record` | +| [getBrokerVoucherSpec()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4842) | :closed_lock_with_key: | POST | `/v5/broker/award/info` | +| [issueBrokerVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4854) | :closed_lock_with_key: | POST | `/v5/broker/award/distribute-award` | +| [getBrokerIssuedVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4866) | :closed_lock_with_key: | POST | `/v5/broker/award/distribution-record` | +| [setBrokerRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4883) | :closed_lock_with_key: | POST | `/v5/broker/apilimit/set` | +| [getBrokerRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4902) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-cap` | +| [getAllBrokerRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4920) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-all` | +| [getEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4940) | | GET | `/v5/earn/product` | +| [getFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4951) | :closed_lock_with_key: | GET | `/v5/earn/flexible-saving/auto-savings` | +| [setFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4962) | :closed_lock_with_key: | POST | `/v5/earn/flexible-saving/auto-savings` | +| [getEarnCouponList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4972) | :closed_lock_with_key: | GET | `/v5/earn/coupons` | +| [getRWAProductList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4982) | | GET | `/v5/earn/rwa/product` | +| [placeRWAOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4992) | :closed_lock_with_key: | POST | `/v5/earn/rwa/place-order` | +| [getRWAPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5001) | :closed_lock_with_key: | GET | `/v5/earn/rwa/position` | +| [getRWAOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5010) | :closed_lock_with_key: | GET | `/v5/earn/rwa/order` | +| [getRWANavChart()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5020) | | GET | `/v5/earn/rwa/nav-chart` | +| [getHoldToEarnAirdropProducts()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5031) | | GET | `/v5/earn/hold-to-earn/product` | +| [getAdvanceEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5042) | | GET | `/v5/earn/advance/product` | +| [getLiquidityMiningProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5053) | | GET | `/v5/earn/liquidity-mining/product` | +| [reinvestLiquidityMining()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5066) | :closed_lock_with_key: | POST | `/v5/earn/liquidity-mining/reinvest` | +| [getFixedTermEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5077) | | GET | `/v5/earn/fixed-term/product` | +| [getAdvanceEarnProductExtraInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5089) | | GET | `/v5/earn/advance/product-extra-info` | +| [submitAdvanceEarnPlaceOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5100) | :closed_lock_with_key: | POST | `/v5/earn/advance/place-order` | +| [getAdvanceEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5111) | :closed_lock_with_key: | GET | `/v5/earn/advance/position` | +| [getAdvanceEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5122) | :closed_lock_with_key: | GET | `/v5/earn/advance/order` | +| [submitFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5133) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/place-order` | +| [redeemFixedTermEarn()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5144) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/redeem` | +| [getFixedTermEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5155) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/position` | +| [getFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5166) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/order` | +| [setFixedTermEarnAutoInvest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5177) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/position/auto-invest` | +| [submitStakeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5193) | :closed_lock_with_key: | POST | `/v5/earn/place-order` | +| [getEarnOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5212) | :closed_lock_with_key: | GET | `/v5/earn/order` | +| [getEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5230) | :closed_lock_with_key: | GET | `/v5/earn/position` | +| [modifyEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5243) | :closed_lock_with_key: | POST | `/v5/earn/position/modify` | +| [getEarnYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5256) | :closed_lock_with_key: | GET | `/v5/earn/yield` | +| [getHoldToEarnAirdropYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5270) | :closed_lock_with_key: | GET | `/v5/earn/hold-to-earn/yield-history` | +| [getEarnHourlyYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5281) | :closed_lock_with_key: | GET | `/v5/earn/hourly-yield` | +| [getEarnAprHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5295) | | GET | `/v5/earn/apr-history` | +| [getEarnTokenProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5305) | | GET | `/v5/earn/token/product` | +| [submitEarnTokenOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5314) | :closed_lock_with_key: | POST | `/v5/earn/token/place-order` | +| [getEarnTokenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5323) | :closed_lock_with_key: | GET | `/v5/earn/token/order` | +| [getEarnTokenPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5335) | :closed_lock_with_key: | GET | `/v5/earn/token/position` | +| [getEarnTokenDailyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5344) | :closed_lock_with_key: | GET | `/v5/earn/token/yield` | +| [getEarnTokenHourlyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5356) | :closed_lock_with_key: | GET | `/v5/earn/token/hourly-yield` | +| [getEarnTokenHistoryApr()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5368) | | GET | `/v5/earn/token/history-apr` | +| [getPwmInvestmentPlanList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5383) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/list` | +| [getPwmInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5392) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/detail` | +| [getPwmPendingInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5401) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/new-plan` | +| [claimPwmWithdrawableFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5410) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/claim` | +| [getPwmInvestmentPlanAssetTrend()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5419) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/asset-trend` | +| [getPwmFundHistoricalNav()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5428) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/fund-nav` | +| [subscribePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5437) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/subscribe` | +| [investMorePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5446) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/invest-more` | +| [redeemPwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5455) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/redeem` | +| [getPwmInvestmentPlanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5464) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/order` | +| [getPwmSubscribableProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5473) | | GET | `/v5/earn/pwm/customize-plan/product` | +| [createPwmCustomizeInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5482) | :closed_lock_with_key: | POST | `/v5/earn/pwm/customize-plan/create` | +| [getPwmAllFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5497) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-funds` | +| [settlePwmFundProfit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5506) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/settle-profit` | +| [createPwmFund()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5515) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-fund` | +| [createPwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5524) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-investment-plan` | +| [getPwmAssetManagerInvestmentPlans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5538) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/get-investment-plan` | +| [managePwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5550) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-investment-plan` | +| [getPwmAllFundOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5564) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-order` | +| [managePwmFundOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5573) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-order` | +| [createPwmFundSubAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5582) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-sub-account` | +| [pwmFundTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5594) | :closed_lock_with_key: | POST | `/v5/earn/pwm/fund-transfer` | +| [getPwmFundTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5603) | :closed_lock_with_key: | GET | `/v5/earn/pwm/query-fund-transfer-result` | +| [queryCardAssetRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5618) | :closed_lock_with_key: | POST | `/v5/card/transaction/query-asset-records` | +| [queryCardPointsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5627) | :closed_lock_with_key: | POST | `/v5/card/reward/points/balance` | +| [queryCardPointsRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5634) | :closed_lock_with_key: | POST | `/v5/card/reward/points/records` | +| [queryCardPointsTier()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5643) | :closed_lock_with_key: | POST | `/v5/card/reward/points/tier` | +| [queryCardMallItemList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5650) | :closed_lock_with_key: | POST | `/v5/card/reward/mall/item/list` | +| [queryCardPointCashbackDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5659) | :closed_lock_with_key: | POST | `/v5/card/reward/point/cashback/detail` | +| [createRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5675) | :closed_lock_with_key: | POST | `/v5/rfq/create-rfq` | +| [getRFQConfig()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5686) | :closed_lock_with_key: | GET | `/v5/rfq/config` | +| [cancelRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5695) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-rfq` | +| [cancelAllRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5705) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-rfq` | +| [createRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5714) | :closed_lock_with_key: | POST | `/v5/rfq/create-quote` | +| [executeRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5725) | :closed_lock_with_key: | POST | `/v5/rfq/execute-quote` | +| [cancelRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5736) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-quote` | +| [cancelAllRFQQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5746) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-quotes` | +| [getRFQRealtimeInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5760) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-realtime` | +| [getRFQHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5772) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-list` | +| [getRFQRealtimeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5786) | :closed_lock_with_key: | GET | `/v5/rfq/quote-realtime` | +| [getRFQHistoryQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5801) | :closed_lock_with_key: | GET | `/v5/rfq/quote-list` | +| [getRFQTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5814) | :closed_lock_with_key: | GET | `/v5/rfq/trade-list` | +| [getRFQPublicTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5827) | :closed_lock_with_key: | GET | `/v5/rfq/public-trades` | +| [acceptNonLPQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5843) | :closed_lock_with_key: | POST | `/v5/rfq/accept-other-quote` | +| [getRFQDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5849) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-detail-list` | +| [getP2PAccountCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5874) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | +| [getP2POnlineAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5891) | :closed_lock_with_key: | POST | `/v5/p2p/item/online` | +| [createP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5900) | :closed_lock_with_key: | POST | `/v5/p2p/item/create` | +| [cancelP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5909) | :closed_lock_with_key: | POST | `/v5/p2p/item/cancel` | +| [updateP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5923) | :closed_lock_with_key: | POST | `/v5/p2p/item/update` | +| [getP2PPersonalAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5933) | :closed_lock_with_key: | POST | `/v5/p2p/item/personal/list` | +| [getP2PAdDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5942) | :closed_lock_with_key: | POST | `/v5/p2p/item/info` | +| [getP2POrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5957) | :closed_lock_with_key: | POST | `/v5/p2p/order/simplifyList` | +| [getP2POrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5967) | :closed_lock_with_key: | POST | `/v5/p2p/order/info` | +| [getP2PPendingOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5976) | :closed_lock_with_key: | POST | `/v5/p2p/order/pending/simplifyList` | +| [markP2POrderAsPaid()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5985) | :closed_lock_with_key: | POST | `/v5/p2p/order/pay` | +| [releaseP2POrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5994) | :closed_lock_with_key: | POST | `/v5/p2p/order/finish` | +| [reviewP2PSellerCancelOrderApply()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6006) | :closed_lock_with_key: | POST | `/v5/p2p/order/buyer/examine/sellerCancelOrderApply` | +| [sendP2POrderMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6018) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/send` | +| [getP2PChatSessions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6033) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/list_v1` | +| [getP2PChatSessionId()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6043) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/getSessionId` | +| [sendP2PChatMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6079) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/send_v1` | +| [getP2PChatMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6091) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/listpage_v1` | +| [getP2POrderMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6100) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/listpage` | +| [getP2PUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6114) | :closed_lock_with_key: | POST | `/v5/p2p/user/personal/info` | +| [getP2PCounterpartyUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6121) | :closed_lock_with_key: | POST | `/v5/p2p/user/order/personal/info` | +| [getP2PUserPayments()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6130) | :closed_lock_with_key: | POST | `/v5/p2p/user/payment/list` | +| [setApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6150) | :closed_lock_with_key: | POST | `/v5/apilimit/set` | +| [queryApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6179) | :closed_lock_with_key: | GET | `/v5/apilimit/query` | +| [getRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6198) | :closed_lock_with_key: | GET | `/v5/apilimit/query-cap` | +| [getAllRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6217) | :closed_lock_with_key: | GET | `/v5/apilimit/query-all` | +| [getLaunchpoolProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6240) | | GET | `/v5/spot-x/launchpool/project/list` | +| [getLaunchpoolUserActivityLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6246) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/activity-log` | +| [getLaunchpoolCurrentStaking()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6252) | :closed_lock_with_key: | GET | `/v5/spot-x/launchpool/user/current-staking` | +| [getLaunchpoolUserHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6258) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/history` | +| [getPuzzleProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6264) | | GET | `/v5/spot-x/puzzle/project/list` | +| [getTokenSplashProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6270) | | GET | `/v5/spot-x/token-splash/project/list` | +| [getTokenSplashUserActivityParams()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6276) | :closed_lock_with_key: | GET | `/v5/spot-x/token-splash/user/activity-params` | +| [getEventInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6299) | | GET | `/v5/event/instruments-info` | +| [getEventOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6310) | | GET | `/v5/event/orderbook` | +| [getEventOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6321) | :closed_lock_with_key: | GET | `/v5/event/order-list` | +| [getEventActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6332) | :closed_lock_with_key: | GET | `/v5/event/order-realtime` | +| [getEventPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6343) | :closed_lock_with_key: | GET | `/v5/event/positions` | +| [getEventTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6354) | :closed_lock_with_key: | GET | `/v5/event/trades` | +| [getEventSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6365) | :closed_lock_with_key: | GET | `/v5/event/settlements` | +| [submitEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6376) | :closed_lock_with_key: | POST | `/v5/event/quotes` | +| [cancelEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6387) | :closed_lock_with_key: | POST | `/v5/event/cancel` | +| [cancelAllEventQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6398) | :closed_lock_with_key: | POST | `/v5/event/cancel-all` | # websocket-api-client.ts diff --git a/llms.txt b/llms.txt index 968de5cf..b137dcfc 100644 --- a/llms.txt +++ b/llms.txt @@ -530,6 +530,67 @@ import { RestClientV5 } from '../../src/index'; // }); // console.log('openInterest: ', openInterest.result.list); +================ +File: examples/Websocket/Private/ws-private-v5.ts +================ +/* eslint-disable @typescript-eslint/no-empty-function */ +import { DefaultLogger, WebsocketClient, WS_KEY_MAP } from '../../../src'; +⋮---- +// or +// import { DefaultLogger, WS_KEY_MAP, WebsocketClient } from 'bybit-api'; +⋮---- +// Create & inject a custom logger to enable the trace logging level (empty function) +⋮---- +// trace: (...params) => console.log('trace', ...params), +⋮---- +/** + * Prepare an instance of the WebSocket client. This client handles all aspects of connectivity for you: + * - Connections are opened when you subscribe to topics + * - If key & secret are provided, authentication is handled automatically + * - If you subscribe to topics from different v5 products (e.g. spot and linear perps), + * subscription events are automatically routed to the different ws endpoints on bybit's side + * - Heartbeats/ping/pong/reconnects are all handled automatically. + * If a connection drops, the client will clean it up, respawn a fresh connection and resubscribe for you. + */ +⋮---- +// testnet: false, +// demoTrading: false, // set testnet to false, if you plan on using demo trading +⋮---- +// console.log('raw message received ', JSON.stringify(data, null, 2)); +⋮---- +// wsClient.on('exception', (data) => { +// console.error('ws exception: ', data); +// }); +⋮---- +/** + * For private V5 topics, us the subscribeV5() method on the ws client or use the original subscribe() method. + * + * Note: for private endpoints the "category" field is ignored since there is only one private endpoint + * (compared to one public one per category). + * The "category" is only needed for public topics since bybit has one endpoint for public events per category. + */ +⋮---- +// wsClient.subscribeV5('execution.fast', 'linear'); +// wsClient.subscribeV5('execution.fast.linear', 'linear'); +// wsClient.subscribeV5('execution.fast.spot', 'spot'); +// wsClient.subscribeV5('execution.fast.option', 'option'); +⋮---- +/** + * The following has the same effect as above, since there's only one private endpoint for V5 account topics: + */ +// wsClient.subscribe('position'); +// wsClient.subscribe('execution'); +// wsClient.subscribe(['order', 'wallet', 'greek']); +⋮---- +// To unsubscribe from topics (after a 5 second delay, in this example): +// setTimeout(() => { +// console.log('unsubscribing'); +// wsClient.unsubscribeV5('execution', 'linear'); +// }, 5 * 1000); +⋮---- +// Topics are tracked per websocket type +// Get a list of subscribed topics (e.g. for public v3 spot topics) (after a 5 second delay) + ================ File: examples/Websocket/Public/ws-public-allLiquidations.ts ================ @@ -2208,3755 +2269,4074 @@ export interface USDCPositionsRequest { } ================ -File: src/types/request/v5-pre-upgrade.ts +File: src/types/request/v5-alpha-trade.ts ================ -import { ExecTypeV5 } from '../shared-v5'; +/** + * V5 private Alpha / on-chain (Web3) trade requests. + */ ⋮---- -export interface GetPreUpgradeOrderHistoryParamsV5 { - category: 'linear' | 'inverse'; - symbol?: string; - baseCoin?: string; - orderId?: string; - orderLinkId?: string; - orderFilter?: 'Order' | 'StopOrder'; - orderStatus?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface GetAlphaTradeQuoteParamsV5 { + tradeType: 1 | 2; + fromTokenCode: string; + fromTokenAmount: string; + toTokenCode: string; + quoteMode?: 0 | 1 | 2; } ⋮---- -export interface GetPreUpgradeTradeHistoryParamsV5 { - category: 'linear' | 'inverse'; - symbol?: string; - orderId?: string; - orderLinkId?: string; - baseCoin?: string; - startTime?: number; - endTime?: number; - execType?: ExecTypeV5; - limit?: number; - cursor?: string; +export interface ExecuteAlphaTradeParamsV5 { + fromTokenCode: string; + fromTokenAmount: string; + toTokenCode: string; + slippage: string; + quoteData: string; + gas: string; + quoteMode: 0 | 1 | 2; + correctingCode: string; + tenant?: string; } ⋮---- -export interface GetPreUpgradeClosedPnlParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface GetAlphaPayTokenListParamsV5 { + chainCode: string; + tokenAddress: string; } ⋮---- -export interface GetPreUpgradeTransactionLogParamsV5 { - category: 'linear' | 'option'; - baseCoin?: string; - type?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface GetAlphaTradeOrderListParamsV5 { + limit: number; + pageIndex: number; + tradeType?: number; + tokenCode?: string; + orderStatus?: number[]; + days?: number; + direction?: 'prev' | 'next'; } ⋮---- -export interface GetPreUpgradeOptionDeliveryRecordParamsV5 { - category: 'option'; - symbol?: string; - expDate?: string; - limit?: number; - cursor?: string; +export interface GetAlphaBizTokenListParamsV5 { + tokenTag?: number; } ⋮---- -export interface GetPreUpgradeUSDCSessionParamsV5 { - category: 'linear'; - symbol?: string; - limit?: number; - cursor?: string; -} - -================ -File: src/types/response/account-asset.ts -================ -export interface UniversalTransferCreateResponse { - transferId: string; +export interface AlphaTokenAddressInfoV5 { + chainCode: string; + tokenAddress: string; } ⋮---- -export interface UniversalTransferListResponseV3 { - list: { - transferId: string; - coin: string; - amount: string; - timestamp: string; - status: string; - fromAccountType: string; - toAccountType: string; - fromMemberId: string; - toMemberId: string; - }[]; - nextPageCursor: string; +export interface GetAlphaBizTokenPriceListParamsV5 { + tokenAddressInfo: AlphaTokenAddressInfoV5[]; } ⋮---- -export interface QueryInternalTransferSResponseV3 { - list: { - transferId: string; - coin: string; - amount: string; - fromAccountType: string; - toAccountType: string; - timestamp: string; - status: string; - }[]; - nextPageCursor: string; +export interface GetAlphaBizTokenDetailsParamsV5 { + chainCode: string; + tokenAddress: string; } ⋮---- -export interface SubAccountTransferResponseV3 { - list: { - transferId: string; - coin: string; - amount: string; - memberId: number; - subMemberId: number; - timestamp: string; - status: string; - type: 'IN' | 'OUT'; - }[]; - nextPageCursor: string; +export interface GetAlphaAssetDetailParamsV5 { + chainCode: string; + tokenAddress: string; } + +================ +File: src/types/request/v5-card.ts +================ +/** + * Bybit Card — /v5/card/* + * Authenticated; API key permission per Bybit (often card-related). + */ ⋮---- -export interface AccountCoinBalanceResponseV3 { - accountType: string; - bizType: number; - accountId: string; - memberId: string; - balance: { - coin: string; - walletBalance: string; - transferBalance: string; - bonus: string; - }; +export interface QueryCardAssetRecordsParamsV5 { + /** 0: Pending, 1: Cleared, 2: Declined */ + statusCode?: string; + /** Default 100, range [1, 500] */ + limit?: number; + /** Default 1, min 1 */ + page?: number; + /** Last 2/4 digits of card number */ + pan4?: string; + createBeginTime?: number; + createEndTime?: number; + /** Fuzzy search */ + merchName?: string; + /** Authorization / Clearing / Refund (see Bybit) */ + type?: string; + txnId?: string; + cardToken?: string; + orderNo?: string; } ⋮---- -export interface AccountCoinBalancesResponseV3 { - accountType: string; - memberId: string; - balance: { - coin: string; - walletBalance: string; - transferBalance: string; - bonus: string; - }[]; -} +/** 0: Pending, 1: Cleared, 2: Declined */ ⋮---- -export interface AssetInfoResponseV3 { - spot: { - status: 'ACCOUNT_STATUS_NORMAL' | 'ACCOUNT_STATUS_UNSPECIFIED'; - assets: { - coin: string; - frozen: string; - free: string; - withdraw: string; - }[]; - }; +/** Default 100, range [1, 500] */ +⋮---- +/** Default 1, min 1 */ +⋮---- +/** Last 2/4 digits of card number */ +⋮---- +/** Fuzzy search */ +⋮---- +/** Authorization / Clearing / Refund (see Bybit) */ +⋮---- +export interface QueryCardPointRecordsParamsV5 { + type?: string; + pageSize?: number; + pageNo?: number; + startTime?: number; + endTime?: number; + outOrderId?: string; + bizId?: string; + bizTxnId?: string; + /** 1: Earn, 2: Deduct */ + side?: string; } ⋮---- -interface SupportedDepositV3 { - coin: string; - chain: string; - coinShowName: string; - chainType: string; - blockConfirmNumber: number; - minDepositAmount: string; +/** 1: Earn, 2: Deduct */ +⋮---- +export interface QueryCardMallItemListParamsV5 { + pageNo?: number; + pageSize?: number; + /** 1: Virtual, 2: Physical */ + itemType?: number; + /** 1: POINTS, 2: CURRENCY */ + itemBizType?: number; + /** 1: Priority, 2: Listing time, 3: Price */ + orderBy?: number; + asc?: boolean; + /** 0: Default, 1: VIP */ + source?: number; } ⋮---- -export interface SupportedDepositListResponseV3 { - configList: SupportedDepositV3[]; - nextPageCursor: string; +/** 1: Virtual, 2: Physical */ +⋮---- +/** 1: POINTS, 2: CURRENCY */ +⋮---- +/** 1: Priority, 2: Listing time, 3: Price */ +⋮---- +/** 0: Default, 1: VIP */ +⋮---- +export interface QueryCardPointCashbackDetailParamsV5 { + bizTxnId: string; } + +================ +File: src/types/request/v5-earn-advance-discount.ts +================ +/** + * /v5/earn/advance/ — product-extra, place order, position, order (Discount Buy, Dual Assets, etc.) + */ +export type GetAdvanceEarnProductExtraInfoParamsV5 = + | { + category: 'DiscountBuy'; + productId?: string; + } + | { + category: 'DualAssets'; + /** Required for Dual Assets quote. */ + productId: string; + }; ⋮---- -interface DepositRecordV3 { - coin: string; - chain: string; - amount: string; - txID: string; - status: number; - toAddress: string; - tag: string; - depositFee: string; - successAt: string; - confirmations: string; - txIndex: string; - blockHash: string; +/** Required for Dual Assets quote. */ +⋮---- +export interface AdvanceEarnDiscountBuyExtraV5 { + initialPrice: string; + purchasePrice: string; + knockoutPrice: string; + knockoutCouponE8: string; + settleType: 'Base' | 'Quote'; + instUid: string; } ⋮---- -export interface DepositRecordQueryResponseV3 { - rows: DepositRecordV3[]; - nextPageCursor: string; +export interface AdvanceEarnDualAssetsExtraV5 { + orderDirection: 'BuyLow' | 'SellHigh'; + selectPrice: string; + /** Expected APY in e8 precision; API may return int. */ + apyE8: string | number; } ⋮---- -export interface WithdrawRecordsQueryResponseV3 { - rows: { - coin: string; - chain: string; - amount: string; - txID: string; - status: number; - toAddress: string; - tag: string; - withdrawFee: string; - createTime: string; - updateTime: string; - withdrawId: string; - withdrawType: number; - }[]; - nextPageCursor: string; +/** Expected APY in e8 precision; API may return int. */ +⋮---- +export interface AdvanceEarnInterestCardExtraV5 { + awardId: string | number; + specCode: string; } ⋮---- -export interface CoinInfoV3 { - name: string; +/** + * POST /v5/earn/advance/place-order — Discount Buy + */ +export interface SubmitAdvanceEarnPlaceOrderDiscountBuyV5 { + category: 'DiscountBuy'; + productId: string; + orderType: 'Stake'; + amount: string; coin: string; - remainAmount: string; - chains: { - chainType: string; - confirmation: string; - withdrawFee: string; - depositMin: string; - withdrawMin: string; - chain: string; - chainDeposit: string; - chainWithdraw: string; - minAccuracy: string; - }[]; + accountType: 'FUND' | 'UNIFIED'; + orderLinkId: string; + discountBuyExtra: AdvanceEarnDiscountBuyExtraV5; } ⋮---- -export interface CoinInfoQueryResponseV3 { - rows: CoinInfoV3[]; +/** + * POST /v5/earn/advance/place-order — Dual Assets + */ +export interface SubmitAdvanceEarnPlaceOrderDualAssetsV5 { + category: 'DualAssets'; + productId: string; + orderType: 'Stake'; + amount: string; + coin: string; + accountType: 'FUND' | 'UNIFIED'; + orderLinkId: string; + dualAssetsExtra: AdvanceEarnDualAssetsExtraV5; + interestCard?: AdvanceEarnInterestCardExtraV5; } ⋮---- -export interface DepositAddressChainV3 { - chainType: string; - addressDeposit: string; - tagDeposit: string; - chain: string; +export type SubmitAdvanceEarnPlaceOrderParamsV5 = + | SubmitAdvanceEarnPlaceOrderDiscountBuyV5 + | SubmitAdvanceEarnPlaceOrderDualAssetsV5; +⋮---- +export interface GetAdvanceEarnPositionListParamsV5 { + category: 'DiscountBuy' | 'DualAssets' | string; + productId?: string; + coin?: string; + limit?: number; + cursor?: string; } ⋮---- -export interface DepositAddressResponseV3 { - coin: string; - chains: DepositAddressChainV3[]; +export interface GetAdvanceEarnOrderListParamsV5 { + category: 'DiscountBuy' | 'DualAssets' | string; + orderId?: string; + orderLinkId?: string; + productId?: string; + /** Dual Assets docs use string ms; other categories may use number. */ + startTime?: string | number; + endTime?: string | number; + limit?: number; + cursor?: string; } ⋮---- -export interface CreateSubMemberResponseV3 { - uid: number; - username: string; - memberType: 1 | 6; - switch: 0 | 1; - note: string; +/** Dual Assets docs use string ms; other categories may use number. */ + +================ +File: src/types/request/v5-earn-fixed-term.ts +================ +/** + * /v5/earn/fixed-term/* + */ +export interface GetFixedTermEarnProductParamsV5 { + coin?: string; } ⋮---- -export interface CreateSubAPIKeyResponseV3 { - id: string; - note: string; - apiKey: string; - readOnly: string; - secret: string; - permissions: { - ContractTrade: string[]; - Spot: string[]; - Wallet: string[]; - Options: string[]; - Derivatives: string[]; - CopyTrading: string[]; - BlockTrade: string[]; - Exchange: string[]; - NFT: string[]; - }; +export interface SubmitFixedTermEarnOrderParamsV5 { + productId: string; + category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; + coin: string; + amount: string; + accountType: 'FUND' | 'UNIFIED'; + orderLinkId: string; + autoInvest?: boolean; } ⋮---- -export interface SubMemberV3 { - uid: string; - username: string; - memberType: 1 | 6; - status: 1 | 2 | 4; - remark: string; +export interface RedeemFixedTermEarnParamsV5 { + productId: string; + /** Early redemption: FundPool only */ + category: 'FundPool'; + positionId: string; } ⋮---- -export interface SubMemberResponseV3 { - subMembers: SubMemberV3[]; +/** Early redemption: FundPool only */ +⋮---- +export interface GetFixedTermEarnPositionParamsV5 { + productId?: string; + category?: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; + coin?: string; } ⋮---- -export interface APIKeyInfoV3 { - id: string; - note: string; - apiKey: string; - readOnly: string; - secret: string; - permissions: { - ContractTrade: string[]; - Spot: string[]; - Wallet: string[]; - Options: string[]; - Derivatives: string[]; - CopyTrading: string[]; - BlockTrade: string[]; - Exchange: string[]; - NFT: string[]; - }; - ips: string[]; - type: number; - deadlineDay: number; - expiredAt: string; - createdAt: string; - unified: number; - uta: number; - userID: number; - inviterID: number; - vipLevel: string; - mktMakerLevel: string; - affiliateID: number; +export interface GetFixedTermEarnOrderListParamsV5 { + orderType?: 'Stake' | 'Redeem' | 'Reinvest'; + productId?: string; + category?: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; + orderId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} +⋮---- +export interface SetFixedTermEarnAutoInvestParamsV5 { + productId: string; + category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; + positionId: string; + status: 'Enable' | 'Disable'; } ================ -File: src/types/response/shared.ts +File: src/types/request/v5-earn-token.ts ================ -export interface SymbolWalletBalance { - equity: number; - available_balance: number; - used_margin: number; - order_margin: number; - position_margin: number; - occ_closing_fee: number; - occ_funding_fee: number; - wallet_balance: number; - realised_pnl: number; - unrealised_pnl: number; - cum_realised_pnl: number; - given_cash: number; - service_cash: number; +/** + * Earn token product (e.g. BYUSDT) — /v5/earn/token/* + */ +⋮---- +export interface GetEarnTokenProductParamsV5 { + /** Currently only BYUSDT */ + coin: string; } ⋮---- -export interface WalletBalances { - [symbol: string]: SymbolWalletBalance | undefined; +/** Currently only BYUSDT */ +⋮---- +export interface PlaceEarnTokenOrderParamsV5 { + coin: string; + orderLinkId: string; + orderType: 'Mint' | 'Redeem'; + amount: string; + /** Mint: FlexibleSaving; Redeem: UNIFIED */ + accountType: 'FlexibleSaving' | 'UNIFIED'; } - -================ -File: src/types/response/spot.ts -================ -export interface SpotBalance { +⋮---- +/** Mint: FlexibleSaving; Redeem: UNIFIED */ +⋮---- +export interface GetEarnTokenOrderListParamsV5 { coin: string; - coinId: string; - coinName: string; - total: string; - free: string; - locked: string; + orderLinkId?: string; + orderId?: string; + orderType?: 'Mint' | 'Redeem'; + /** seconds */ + startTime?: number; + /** seconds */ + endTime?: number; + cursor?: string; + limit?: number; } ⋮---- -export interface SpotBalances { - balances: SpotBalance[]; +/** seconds */ +⋮---- +/** seconds */ +⋮---- +export interface GetEarnTokenPositionParamsV5 { + coin: string; } ⋮---- -export interface SpotLastPrice { - symbol: string; - price: string; +export interface GetEarnTokenDailyYieldParamsV5 { + coin: string; + startTime?: number; + endTime?: number; + cursor?: string; + limit?: number; +} +⋮---- +export interface GetEarnTokenHourlyYieldParamsV5 { + coin: string; + startTime?: number; + endTime?: number; + cursor?: string; + limit?: number; +} +⋮---- +export interface GetEarnTokenHistoryAprParamsV5 { + coin: string; + /** 1 = 7d, 2 = 30d, 3 = 180d */ + range: 1 | 2 | 3; } +⋮---- +/** 1 = 7d, 2 = 30d, 3 = 180d */ ================ -File: src/types/response/unified-margin.ts +File: src/types/request/v5-pre-upgrade.ts ================ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export interface UMPaginatedResult { - nextPageCursor: string; - category: string; - list: List[]; +import { ExecTypeV5 } from '../shared-v5'; +⋮---- +export interface GetPreUpgradeOrderHistoryParamsV5 { + category: 'linear' | 'inverse'; + symbol?: string; + baseCoin?: string; + orderId?: string; + orderLinkId?: string; + orderFilter?: 'Order' | 'StopOrder'; + orderStatus?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface UMLeverageFilter { - minLeverage: string; - maxLeverage: string; - leverageStep: string; +export interface GetPreUpgradeTradeHistoryParamsV5 { + category: 'linear' | 'inverse'; + symbol?: string; + orderId?: string; + orderLinkId?: string; + baseCoin?: string; + startTime?: number; + endTime?: number; + execType?: ExecTypeV5; + limit?: number; + cursor?: string; } ⋮---- -export interface UMPriceFilter { - minPrice: string; - maxPrice: string; - tickSize: string; +export interface GetPreUpgradeClosedPnlParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface UMLotSizeFilter { - maxTradingQty: string; - minTradingQty: string; - qtyStep: string; +export interface GetPreUpgradeTransactionLogParamsV5 { + category: 'linear' | 'option'; + baseCoin?: string; + type?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface UMInstrumentInfo { - symbol: string; - contractType: string; - status: string; - baseCoin: string; - quoteCoin: string; - launchTime: string; - deliveryTime: string; - deliveryFeeRate: string; - priceScale: string; - leverageFilter: UMLeverageFilter; - priceFilter: UMPriceFilter; - lotSizeFilter: UMLotSizeFilter; +export interface GetPreUpgradeOptionDeliveryRecordParamsV5 { + category: 'option'; + symbol?: string; + expDate?: string; + limit?: number; + cursor?: string; } ⋮---- -export interface UMHistoricOrder { - symbol: string; - orderType: string; - orderLinkId: string; - orderId: string; - stopOrderType: string; - orderStatus: string; - takeProfit: string; - cumExecValue: string; - blockTradeId: string; - rejectReason: string; - price: string; - createdTime: number; - tpTriggerBy: string; - timeInForce: string; - basePrice: string; - leavesValue: string; - updatedTime: number; - side: string; - triggerPrice: string; - cumExecFee: string; - slTriggerBy: string; - leavesQty: string; - closeOnTrigger: boolean; - cumExecQty: string; - reduceOnly: boolean; - qty: string; - stopLoss: string; - triggerBy: string; - orderIM: string; +export interface GetPreUpgradeUSDCSessionParamsV5 { + category: 'linear'; + symbol?: string; + limit?: number; + cursor?: string; } ================ -File: src/types/response/usdt-perp.ts +File: src/types/response/account-asset.ts ================ -export interface PerpPosition { - user_id: number; - symbol: string; - side: string; - size: number; - position_value: number; - entry_price: number; - liq_price: number; - bust_price: number; - leverage: number; - auto_add_margin: number; - is_isolated: boolean; - position_margin: number; - occ_closing_fee: number; - realised_pnl: number; - cum_realised_pnl: number; - free_qty: number; - tp_sl_mode: string; - unrealised_pnl: number; - deleverage_indicator: number; - risk_id: number; - stop_loss: number; - take_profit: number; - trailing_stop: number; - position_idx: number; - mode: string; +export interface UniversalTransferCreateResponse { + transferId: string; } ⋮---- -export interface PerpPositionRoot { - data: PerpPosition; - is_valid: boolean; +export interface UniversalTransferListResponseV3 { + list: { + transferId: string; + coin: string; + amount: string; + timestamp: string; + status: string; + fromAccountType: string; + toAccountType: string; + fromMemberId: string; + toMemberId: string; + }[]; + nextPageCursor: string; } ⋮---- -export interface LinearOrder { - order_id: string; - user_id: number; - symbol: string; - side: string; - order_type: string; - price: number; - qty: number; - time_in_force: string; - order_status: string; - last_exec_price: number; - cum_exec_qty: number; - cum_exec_value: number; - cum_exec_fee: number; - reduce_only: boolean; - close_on_trigger: boolean; - order_link_id: string; - created_time: string; - updated_time: string; - take_profit: number; - stop_loss: number; - tp_trigger_by: string; - sl_trigger_by: string; - position_idx: number; -} - -================ -File: src/types/response/v5-preupgrade.ts -================ -export interface PreUpgradeTransaction { - symbol: string; - category: string; - side: 'Buy' | 'Sell' | 'None'; - transactionTime: string; - type: string; - qty: string; - size: string; - currency: 'USDC' | 'USDT' | 'BTC' | 'ETH'; - tradePrice: string; - funding: string; - fee: string; - cashFlow: string; - change: string; - cashBalance: string; - feeRate: string; - bonusChange: string; - tradeId: string; - orderId: string; - orderLinkId: string; - extraFees: string; +export interface QueryInternalTransferSResponseV3 { + list: { + transferId: string; + coin: string; + amount: string; + fromAccountType: string; + toAccountType: string; + timestamp: string; + status: string; + }[]; + nextPageCursor: string; } ⋮---- -export interface PreUpgradeOptionsDelivery { - deliveryTime: number; - symbol: string; - side: 'Buy' | 'Sell'; - position: string; - deliveryPrice: string; - strike: string; - fee: string; - deliveryRpl: string; +export interface SubAccountTransferResponseV3 { + list: { + transferId: string; + coin: string; + amount: string; + memberId: number; + subMemberId: number; + timestamp: string; + status: string; + type: 'IN' | 'OUT'; + }[]; + nextPageCursor: string; } ⋮---- -export interface PreUpgradeUSDCSessionSettlement { - symbol: string; - side: 'Buy' | 'Sell'; - size: string; - sessionAvgPrice: string; - markPrice: string; - realisedPnl: string; - createdTime: string; +export interface AccountCoinBalanceResponseV3 { + accountType: string; + bizType: number; + accountId: string; + memberId: string; + balance: { + coin: string; + walletBalance: string; + transferBalance: string; + bonus: string; + }; } - -================ -File: src/types/websockets/index.ts -================ - - -================ -File: src/types/websockets/ws-api.ts -================ -import { APIID, WS_KEY_MAP } from '../../util'; -import { - AmendOrderParamsV5, - BatchAmendOrderParamsV5, - BatchCancelOrderParamsV5, - BatchOrderParamsV5, - CancelOrderParamsV5, - OrderParamsV5, -} from '../request'; -import { - BatchAmendOrderResultV5, - BatchCancelOrderResultV5, - BatchCreateOrderResultV5, - BatchOrdersRetExtInfoV5, - OrderResultV5, -} from '../response'; -import { WsKey } from './ws-general'; -⋮---- -// When new WS API operations are added, make sure to also update WS_API_Operations[] below -export type WSAPIOperation = - | 'order.create' - | 'order.amend' - | 'order.cancel' - | 'order.create-batch' - | 'order.amend-batch' - | 'order.cancel-batch'; -⋮---- -export type WsOperation = - | 'subscribe' - | 'unsubscribe' - | 'auth' - | 'ping' - | 'pong'; ⋮---- -export interface WsRequestOperationBybit { - req_id: string; - op: WsOperation; - args?: (TWSTopic | string | number)[]; +export interface AccountCoinBalancesResponseV3 { + accountType: string; + memberId: string; + balance: { + coin: string; + walletBalance: string; + transferBalance: string; + bonus: string; + }[]; } ⋮---- -export interface WSAPIRequest< - TRequestParams = undefined, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - TWSOperation extends WSAPIOperation = any, -> { - reqId: string; - op: TWSOperation; - header: { - 'X-BAPI-TIMESTAMP': string; - 'X-BAPI-RECV-WINDOW': string; - Referer: typeof APIID; +export interface AssetInfoResponseV3 { + spot: { + status: 'ACCOUNT_STATUS_NORMAL' | 'ACCOUNT_STATUS_UNSPECIFIED'; + assets: { + coin: string; + frozen: string; + free: string; + withdraw: string; + }[]; }; - args: [TRequestParams]; } ⋮---- -// eslint-disable-next-line @typescript-eslint/no-explicit-any -⋮---- -export interface WSAPIResponse< - TResponseData extends object = object, - TOperation extends WSAPIOperation = WSAPIOperation, - TResponseExtInfo = {}, // added as optional for batch calls -> { - wsKey: WsKey; - /** Auto-generated */ - reqId: string; - retCode: 0 | number; - retMsg: 'OK' | string; - op: TOperation; - data: TResponseData; - retExtInfo: TResponseExtInfo; - header?: { - 'X-Bapi-Limit': string; - 'X-Bapi-Limit-Status': string; - 'X-Bapi-Limit-Reset-Timestamp': string; - Traceid: string; - Timenow: string; - }; - connId: string; +interface SupportedDepositV3 { + coin: string; + chain: string; + coinShowName: string; + chainType: string; + blockConfirmNumber: number; + minDepositAmount: string; } ⋮---- -TResponseExtInfo = {}, // added as optional for batch calls -⋮---- -/** Auto-generated */ -⋮---- -export type Exact = { - // This part says: if there's any key that's not in T, it's an error - [K: string]: never; -} & { - [K in keyof T]: T[K]; -}; +export interface SupportedDepositListResponseV3 { + configList: SupportedDepositV3[]; + nextPageCursor: string; +} ⋮---- -// This part says: if there's any key that's not in T, it's an error +interface DepositRecordV3 { + coin: string; + chain: string; + amount: string; + txID: string; + status: number; + toAddress: string; + tag: string; + depositFee: string; + successAt: string; + confirmations: string; + txIndex: string; + blockHash: string; +} ⋮---- -/** - * List of operations supported for this WsKey (connection) - */ -export interface WsAPIWsKeyTopicMap { - [WS_KEY_MAP.v5PrivateTrade]: WSAPIOperation; +export interface DepositRecordQueryResponseV3 { + rows: DepositRecordV3[]; + nextPageCursor: string; } ⋮---- -/** - * Request parameters expected per operation - */ -export interface WsAPITopicRequestParamMap { - 'order.create': OrderParamsV5; - 'order.amend': AmendOrderParamsV5; - 'order.cancel': CancelOrderParamsV5; - - 'order.create-batch': { - category: 'option' | 'linear'; - request: BatchOrderParamsV5[]; - }; - 'order.amend-batch': { - category: 'option' | 'linear'; - request: BatchAmendOrderParamsV5[]; - }; - 'order.cancel-batch': { - category: 'option' | 'linear'; - request: BatchCancelOrderParamsV5[]; - }; +export interface WithdrawRecordsQueryResponseV3 { + rows: { + coin: string; + chain: string; + amount: string; + txID: string; + status: number; + toAddress: string; + tag: string; + withdrawFee: string; + createTime: string; + updateTime: string; + withdrawId: string; + withdrawType: number; + }[]; + nextPageCursor: string; } ⋮---- -/** - * Response structure expected for each operation - */ -export interface WsAPIOperationResponseMap { - 'order.create': WSAPIResponse; - 'order.amend': WSAPIResponse; - 'order.cancel': WSAPIResponse; - - 'order.create-batch': WSAPIResponse< - { list: BatchCreateOrderResultV5[] }, - 'order.create-batch' - > & { - retExtInfo: BatchOrdersRetExtInfoV5; - }; - 'order.amend-batch': WSAPIResponse< - { list: BatchAmendOrderResultV5[] }, - 'order.amend-batch' - > & { - retExtInfo: BatchOrdersRetExtInfoV5; - }; - 'order.cancel-batch': WSAPIResponse< - { list: BatchCancelOrderResultV5[] }, - 'order.cancel-batch' - > & { - retExtInfo: BatchOrdersRetExtInfoV5; - }; - - ping: { - retCode: 0 | number; - retMsg: 'OK' | string; - op: 'pong'; - data: [string]; - connId: string; +export interface CoinInfoV3 { + name: string; + coin: string; + remainAmount: string; + chains: { + chainType: string; + confirmation: string; + withdrawFee: string; + depositMin: string; + withdrawMin: string; + chain: string; + chainDeposit: string; + chainWithdraw: string; + minAccuracy: string; + }[]; +} +⋮---- +export interface CoinInfoQueryResponseV3 { + rows: CoinInfoV3[]; +} +⋮---- +export interface DepositAddressChainV3 { + chainType: string; + addressDeposit: string; + tagDeposit: string; + chain: string; +} +⋮---- +export interface DepositAddressResponseV3 { + coin: string; + chains: DepositAddressChainV3[]; +} +⋮---- +export interface CreateSubMemberResponseV3 { + uid: number; + username: string; + memberType: 1 | 6; + switch: 0 | 1; + note: string; +} +⋮---- +export interface CreateSubAPIKeyResponseV3 { + id: string; + note: string; + apiKey: string; + readOnly: string; + secret: string; + permissions: { + ContractTrade: string[]; + Spot: string[]; + Wallet: string[]; + Options: string[]; + Derivatives: string[]; + CopyTrading: string[]; + BlockTrade: string[]; + Exchange: string[]; + NFT: string[]; }; } - -================ -File: src/types/websockets/ws-confirmations.ts -================ -export interface WebsocketTopicSubscriptionConfirmationEvent { - op: 'subscribe'; - req_id: string; - conn_id: string; - ret_msg: string; - success: boolean; +⋮---- +export interface SubMemberV3 { + uid: string; + username: string; + memberType: 1 | 6; + status: 1 | 2 | 4; + remark: string; } ⋮---- -export interface WebsocketSucceededTopicSubscriptionConfirmationEvent - extends WebsocketTopicSubscriptionConfirmationEvent { - success: true; +export interface SubMemberResponseV3 { + subMembers: SubMemberV3[]; } ⋮---- -export interface WebsocketFailedTopicSubscriptionConfirmationEvent - extends WebsocketTopicSubscriptionConfirmationEvent { - success: false; +export interface APIKeyInfoV3 { + id: string; + note: string; + apiKey: string; + readOnly: string; + secret: string; + permissions: { + ContractTrade: string[]; + Spot: string[]; + Wallet: string[]; + Options: string[]; + Derivatives: string[]; + CopyTrading: string[]; + BlockTrade: string[]; + Exchange: string[]; + NFT: string[]; + }; + ips: string[]; + type: number; + deadlineDay: number; + expiredAt: string; + createdAt: string; + unified: number; + uta: number; + userID: number; + inviterID: number; + vipLevel: string; + mktMakerLevel: string; + affiliateID: number; } ================ -File: src/types/index.ts +File: src/types/response/shared.ts ================ - +export interface SymbolWalletBalance { + equity: number; + available_balance: number; + used_margin: number; + order_margin: number; + position_margin: number; + occ_closing_fee: number; + occ_funding_fee: number; + wallet_balance: number; + realised_pnl: number; + unrealised_pnl: number; + cum_realised_pnl: number; + given_cash: number; + service_cash: number; +} +⋮---- +export interface WalletBalances { + [symbol: string]: SymbolWalletBalance | undefined; +} ================ -File: src/index.ts +File: src/types/response/spot.ts ================ - +export interface SpotBalance { + coin: string; + coinId: string; + coinName: string; + total: string; + free: string; + locked: string; +} +⋮---- +export interface SpotBalances { + balances: SpotBalance[]; +} +⋮---- +export interface SpotLastPrice { + symbol: string; + price: string; +} ================ -File: src/spot-client-v3.ts +File: src/types/response/unified-margin.ts ================ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { APIResponseV3, numberInString } from './types'; -import { REST_CLIENT_TYPE_ENUM } from './util'; -import BaseRestClient from './util/BaseRestClient'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export interface UMPaginatedResult { + nextPageCursor: string; + category: string; + list: List[]; +} ⋮---- -/** - * REST API client for newer Spot V3 APIs. - * @deprecated WARNING - * These endpoints are being switched off gradually and are expected to be completely turned off by the end of 2024. - * They may stop working at any point before then. - * Please update your code as soon as possible to use the V5 APIs instead. - */ -export class SpotClientV3 extends BaseRestClient -⋮---- -getClientType() -⋮---- -// Doesn't really matter here, since the only remaining endpoint does not require auth. -⋮---- -async fetchServerTime(): Promise +export interface UMLeverageFilter { + minLeverage: string; + maxLeverage: string; + leverageStep: string; +} ⋮---- -/** - * - * Market Data Endpoints - * - */ +export interface UMPriceFilter { + minPrice: string; + maxPrice: string; + tickSize: string; +} ⋮---- -/** - * Get merged orderbook for symbol - * - * This is the only known pre-V5 endpoint to still be online. - */ -getMergedOrderBook( - symbol: string, - scale?: number, - limit?: number, - ): Promise> +export interface UMLotSizeFilter { + maxTradingQty: string; + minTradingQty: string; + qtyStep: string; +} ⋮---- -/** - * - * API Data Endpoints - * - */ +export interface UMInstrumentInfo { + symbol: string; + contractType: string; + status: string; + baseCoin: string; + quoteCoin: string; + launchTime: string; + deliveryTime: string; + deliveryFeeRate: string; + priceScale: string; + leverageFilter: UMLeverageFilter; + priceFilter: UMPriceFilter; + lotSizeFilter: UMLotSizeFilter; +} ⋮---- -getServerTime(): Promise<{ time_now: numberInString }> +export interface UMHistoricOrder { + symbol: string; + orderType: string; + orderLinkId: string; + orderId: string; + stopOrderType: string; + orderStatus: string; + takeProfit: string; + cumExecValue: string; + blockTradeId: string; + rejectReason: string; + price: string; + createdTime: number; + tpTriggerBy: string; + timeInForce: string; + basePrice: string; + leavesValue: string; + updatedTime: number; + side: string; + triggerPrice: string; + cumExecFee: string; + slTriggerBy: string; + leavesQty: string; + closeOnTrigger: boolean; + cumExecQty: string; + reduceOnly: boolean; + qty: string; + stopLoss: string; + triggerBy: string; + orderIM: string; +} ================ -File: src/websocket-api-client.ts +File: src/types/response/usdt-perp.ts ================ -import { - AmendOrderParamsV5, - BatchAmendOrderParamsV5, - BatchAmendOrderResultV5, - BatchCancelOrderParamsV5, - BatchCancelOrderResultV5, - BatchCreateOrderResultV5, - BatchOrderParamsV5, - BatchOrdersRetExtInfoV5, - CancelOrderParamsV5, - OrderParamsV5, - OrderResultV5, -} from './types'; -import { WSAPIResponse } from './types/websockets/ws-api'; -import { WSClientConfigurableOptions } from './types/websockets/ws-general'; -import { DefaultLogger } from './util'; -import { WS_KEY_MAP } from './util/websockets/websocket-util'; -import { WebsocketClient } from './websocket-client'; -⋮---- -/** - * Configurable options specific to only the REST-like WebsocketAPIClient - */ -export interface WSAPIClientConfigurableOptions { - /** - * Default: true - * - * Attach default event listeners, which will console log any high level - * events (opened/reconnecting/reconnected/etc). - * - * If you disable this, you should set your own event listeners - * on the embedded WS Client `wsApiClient.getWSClient().on(....)`. - */ - attachEventListeners: boolean; +export interface PerpPosition { + user_id: number; + symbol: string; + side: string; + size: number; + position_value: number; + entry_price: number; + liq_price: number; + bust_price: number; + leverage: number; + auto_add_margin: number; + is_isolated: boolean; + position_margin: number; + occ_closing_fee: number; + realised_pnl: number; + cum_realised_pnl: number; + free_qty: number; + tp_sl_mode: string; + unrealised_pnl: number; + deleverage_indicator: number; + risk_id: number; + stop_loss: number; + take_profit: number; + trailing_stop: number; + position_idx: number; + mode: string; } ⋮---- -/** - * Default: true - * - * Attach default event listeners, which will console log any high level - * events (opened/reconnecting/reconnected/etc). - * - * If you disable this, you should set your own event listeners - * on the embedded WS Client `wsApiClient.getWSClient().on(....)`. - */ +export interface PerpPositionRoot { + data: PerpPosition; + is_valid: boolean; +} ⋮---- +export interface LinearOrder { + order_id: string; + user_id: number; + symbol: string; + side: string; + order_type: string; + price: number; + qty: number; + time_in_force: string; + order_status: string; + last_exec_price: number; + cum_exec_qty: number; + cum_exec_value: number; + cum_exec_fee: number; + reduce_only: boolean; + close_on_trigger: boolean; + order_link_id: string; + created_time: string; + updated_time: string; + take_profit: number; + stop_loss: number; + tp_trigger_by: string; + sl_trigger_by: string; + position_idx: number; +} + +================ +File: src/types/response/v5-alpha-trade.ts +================ /** - * This is a minimal Websocket API wrapper around the WebsocketClient. - * - * Some methods support passing in a custom "wsKey". This is a reference to which WS connection should - * be used to transmit that message. This is only useful if you wish to use an alternative wss - * domain that is supported by the SDK. - * - * Note: To use testnet, don't set the wsKey - use `testnet: true` in - * the constructor instead. - * - * Note: You can also directly use the sendWSAPIRequest() method to make WS API calls, but some - * may find the below methods slightly more intuitive. - * - * Refer to the WS API promises example for a more detailed example on using sendWSAPIRequest() directly: - * https://github.com/tiagosiebler/bybit-api/blob/master/examples/ws-api-raw-promises.ts + * V5 private Alpha / on-chain (Web3) trade responses. */ -export class WebsocketAPIClient ⋮---- -constructor( - options?: WSClientConfigurableOptions & - Partial, - logger?: DefaultLogger, - ) +export interface AlphaTradeQuoteModeEstimationV5 { + quoteMode: number; + estimatedGas: string; + estimatedGasUsd: string; + estimatedSlippage: string; +} ⋮---- -public getWSClient(): WebsocketClient +export interface AlphaTradeQuoteResultV5 { + tradeType: number; + fromTokenCode: string; + fromTokenAmount: string; + fromTokenAmountUsd: string; + toTokenCode: string; + toTokenAmount: string; + toTokenAmountUsd: string; + minToTokenAmount: string; + slippage: string; + gas: string; + gasUsd: string; + platformFee: string; + platformFeeUsd: string; + swapRate: string; + lossRate: string; + quoteData: string; + correctingCode: string; + quoteMode: number; + quoteDataId: string; + expireTime: number; + modeEstimations: AlphaTradeQuoteModeEstimationV5[]; + chargeAmount?: string; + timestamp?: number; +} ⋮---- -public setTimeOffsetMs(newOffset: number): void +export interface ExecuteAlphaTradeResultV5 { + orderNo: string; +} ⋮---- -/* - * Bybit WebSocket API Methods - * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline - */ -⋮---- -/** - * Submit a new order - * - * @param params - * @returns - */ -submitNewOrder( - params: OrderParamsV5, - ): Promise> -⋮---- -/** - * Amend an order - * - * @param params - * @returns - */ -amendOrder( - params: AmendOrderParamsV5, - ): Promise> -⋮---- -/** - * Cancel an order - * - * @param params - * @returns - */ -cancelOrder( - params: CancelOrderParamsV5, - ): Promise> -⋮---- -/** - * Batch submit orders - * - * @param params - * @returns - */ -batchSubmitOrders( - category: 'option' | 'linear', - orders: BatchOrderParamsV5[], - ): Promise< - WSAPIResponse< - { - list: BatchCreateOrderResultV5[]; - }, - 'order.create-batch', - BatchOrdersRetExtInfoV5 - > - > +export interface AlphaPayTokenV5 { + tokenCode: string; + symbol: string; + tokenDecimals: number; + tokenIconUrlDay: string; + tokenIconUrlNight: string; + limit: string; + supportChains: string[]; +} ⋮---- -/** - * Batch amend orders - * - * @param params - * @returns - */ -batchAmendOrder( - category: 'option' | 'linear', - orders: BatchAmendOrderParamsV5[], - ): Promise< - WSAPIResponse< - { - list: BatchAmendOrderResultV5[]; - }, - 'order.amend-batch', - BatchOrdersRetExtInfoV5 - > - > +export interface AlphaTradeOrderV5 { + orderType: number; + tradeType: number; + orderNo: string; + orderStatus: number; + fromTokenCode: string; + fromTokenAmount: string; + fromTokenSymbol: string; + fromTokenDecimals: number; + fromTokenIconUrlDay?: string; + fromTokenIconUrlNight?: string; + fromChainCode: string; + fromChainIconUrl?: string; + toTokenCode: string; + toTokenAmount: string; + toTokenSymbol: string; + toTokenDecimals: number; + toTokenIconUrlDay?: string; + toTokenIconUrlNight?: string; + toChainCode: string; + toChainIconUrl?: string; + gasTokenSymbol: string; + gasOnchain: string; + gasUsd: string | null; + platformFee: string; + platformFeeUsd: string | null; + quoteMode: number; + createTime: number; + executionTime?: number; + failureReasonCode?: string; + source?: string; + swapRate: string; + actualFromTokenAmount: string; +} ⋮---- -/** - * Batch cancel orders - * - * @param params - * @returns - */ -batchCancelOrder( - category: 'option' | 'linear', - orders: BatchCancelOrderParamsV5[], - ): Promise< - WSAPIResponse< - { - list: BatchCancelOrderResultV5[]; - }, - 'order.cancel-batch', - BatchOrdersRetExtInfoV5 - > - > +export interface AlphaTradeOrderListResultV5 { + total: number; + pageIndex: number; + orders: AlphaTradeOrderV5[]; +} ⋮---- -/** - * - * - * - * - * - * - * - * Private methods for handling some of the convenience/automation provided by the WS API Client - * - * - * - * - * - * - * - */ +export interface AlphaBizTokenV5 { + tokenCode: string; + chainCode: string; + chainIconUrl: string; + tokenAddress: string; + symbol: string; + tokenDecimals: number; + tokenIconUrlDay: string; + tokenIconUrlNight: string; + createTime: number; + createTimeOnchain: number; + riskFlag: number; + minOrderQuantity: number; + maxOrderQuantity: number; + tokenTags: number[]; + payTokenCodes: string[]; +} ⋮---- -private setupDefaultEventListeners() +export interface AlphaBizTokenPriceV5 { + chainCode: string; + tokenAddress: string; + price: string; + change24h: string; + vol24h: string; + marketCap: string; + liquidity: string; + holders: string; +} ⋮---- -/** - * General event handlers for monitoring the WebsocketClient - */ +export interface AlphaBizTokenPriceListResultV5 { + tokenPriceInfoList: AlphaBizTokenPriceV5[]; +} ⋮---- -// Blind JSON.stringify can fail on circular references +export interface AlphaBizTokenDetailsV5 { + tokenCode: string; + chainCode: string; + chainIconUrl: string; + tokenAddress: string; + symbol: string; + tokenDecimals: number; + tokenIconUrlDay: string; + tokenIconUrlNight: string; + minOrderQuantity: string; + maxOrderQuantity: string; + maxPositionQuantity: string; + tokenDesc: string; + xUrl: string; + officialUrl: string; + whitePaperUrl: string; + tokenTag: number; + riskFlag: number; + createTimeOnchain: number; + status: number; + tokenTags: number[]; + showMessage: number; + content?: string; + linkName?: string; + linkAddress?: string; +} ⋮---- -// JSON.stringify({ ...data, target: 'WebSocket' }), - -================ -File: .eslintrc.cjs -================ -// 'require-extensions', // only once moved to ESM +export interface AlphaAssetV5 { + chainCode: string; + chainIconUrl: string; + tokenAddress: string; + tokenCode: string; + tokenSymbol: string; + tokenDecimals: number; + tokenIconUrlDay: string; + tokenIconUrlNight: string; + tokenAmount: string; + tokenAmountUsd: string; + tradeFlag: number; + pnl: string | null; + pnlRatio: string | null; + costPrice: string | null; + lastPrice: string; + costTotalValue: string | null; + assetStatus: number; + announcementUrl?: string; + estimatedOfflineTime?: number; + delistingTime?: number; +} ⋮---- -// 'plugin:require-extensions/recommended', // only once moved to ESM +export interface AlphaAssetListResultV5 { + totalAssetUsd: string; + assetList: AlphaAssetV5[]; +} ⋮---- -// 'no-unused-vars': ['warn'], +export interface AlphaAssetDetailResultV5 { + assetList: AlphaAssetV5[]; +} ================ -File: .jshintrc +File: src/types/response/v5-card.ts ================ -{ - "esversion": 8, - "asi": true, - "laxbreak": true, - "predef": [ "-Promise" ] +export interface CardAssetRecordV5 { + pan4: string; + pan6: string; + tradeStatus: string; + side: string; + basicAmount: string; + basicCurrency: string; + transactionAmount: string; + transactionCurrency: string; + txnCreate: number; + merchCountry: string; + merchCity: string; + merchName: string; + txnId: string; + declinedReason: string; + totalFees: string; + uid: number; + transactionCurrencyAmount: string; + fxPad: string; + interchangeFee: string; + billAmount: string; + paidAmount: string; + paidCurrency: string; + bonusAmount: string; + foreignTransactionFee: string; + totalTax: string; + paidFiat: string; + withdrawalFee: string; + status: string; + orderNo: string; + mccCode: string; + merchCategoryDesc: string; } - -================ -File: .prettierrc -================ -{ - "tabWidth": 2, - "singleQuote": true, - "trailingComma": "all" +⋮---- +export interface CardAssetRecordsResultV5 { + pageSize: number; + pageNo: number; + totalCount: number; + data: CardAssetRecordV5[]; } - -================ -File: index.js -================ - - -================ -File: jsconfig.json -================ -{ - "compilerOptions": { - "target": "ES6", - "module": "commonjs" - }, - "exclude": [ - "node_modules", - "**/node_modules/*", - "coverage", - "doc", - "examples/ignored/*" - ] +⋮---- +export interface CardPointBalanceV5 { + accountId: string; + availablePoint: string | number; + pendingPoint: string | number; + status: string; + updateTime: string | number; + settlementPeriod: number; } - -================ -File: LICENSE.md -================ -Copyright 2024 Tiago Siebler - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -================ -File: tsconfig.build.json -================ -{ - "extends": "./tsconfig.json", - "exclude": [ - "node_modules", - "test", - "dist", - "**/*spec.ts", - "**/*test.ts", - "jest.config.ts" - ] +⋮---- +export interface CardPointRecordV5 { + outOrderId: string; + point: number; + side: string; + type: string; + subType: string; + createTime: number; + updateTime: number; + bizId: string; + bizTxnId: string; + transactionDate: string; + transactionId: string; + transactionAmount: string; + basicCurrency: string; + merchCategoryDesc: string; + merchName: string; + merchCountry: string; + merchCity: string; + pan4: string; + payFiatAmount: string; + transactionCurrencyAmount: string; } - -================ -File: tsconfig.examples.json -================ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "distExamples", - "allowJs": true - }, - "include": ["examples/**/*.ts", "examples/**/*.js"] +⋮---- +export interface CardPointRecordsResultV5 { + pageSize: number; + pageNo: number; + totalCount: number; + data: CardPointRecordV5[]; } - -================ -File: tsconfig.json -================ -{ - "compileOnSave": true, - "compilerOptions": { - "allowJs": true, - "target": "es6", - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "removeComments": false, - "noEmitOnError": true, - "noImplicitAny": false, - "strictNullChecks": true, - "skipLibCheck": true, - "sourceMap": true, - "esModuleInterop": true, - "lib": ["es2017", "dom"], - "baseUrl": ".", - "outDir": "./lib" - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "**/node_modules/*", "coverage", "doc"] +⋮---- +export interface CardPointTierInfoV5 { + usedLimit: string; + limit: string; + unit: string; + tier: string; + autoCashback: boolean; } - -================ -File: tsconfig.linting.json -================ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "target": "esnext", - "rootDir": "../", - "allowJs": true - }, - "include": [ - "src/**/*.*", - "test/**/*.*", - "examples/**/*.*", - ".eslintrc.cjs", - "jest.config.ts" - ] +⋮---- +export interface CardMallItemV5 { + itemId: string; + itemName: string; + priority: number; + onTime: string; + offTime: string; + price: string; + discountPrice: string; + totalNum: number; + redeemNum: number; + picPath: string; + currency: string; + currencyType: number; + itemType: number; + itemBizType: number; } - -================ -File: tsconfig.test.json -================ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "./distTest", - "allowJs": true - }, - "include": ["test/**/*.ts", "test/**/*.js"] +⋮---- +export interface CardMallItemListResultV5 { + pageNo: number; + pageSize: number; + totalCount: number; + data: CardMallItemV5[]; +} +⋮---- +export interface CardPointCashbackDetailV5 { + points: string; + amt: string; + ccy: string; + ccyType: string; + createTime: string; + bizTxnId: string; + sourceId: number; + sourceCode: string; + orderStatus: number; + orderSubStatus: number; + orderShowStatus: string; + failedBizCode: string; } ================ -File: examples/Websocket/Private/ws-private-v5.ts +File: src/types/response/v5-earn-advance-discount.ts ================ -/* eslint-disable @typescript-eslint/no-empty-function */ -import { DefaultLogger, WebsocketClient, WS_KEY_MAP } from '../../../src'; +export interface AdvanceEarnDiscountBuyOfferV5 { + productId: string; + currentPrice: string; + purchasePrice: string; + knockoutPrice: string; + knockoutCouponE8: string; + maxInvestmentAmount: string; + instUid: string; + expiredAt: string; + category: string; +} ⋮---- -// or -// import { DefaultLogger, WS_KEY_MAP, WebsocketClient } from 'bybit-api'; +/** GET /v5/earn/advance/product-extra-info?category=DiscountBuy */ +export interface AdvanceEarnProductExtraInfoDiscountBuyV5 { + offers: AdvanceEarnDiscountBuyOfferV5[]; +} ⋮---- -// Create & inject a custom logger to enable the trace logging level (empty function) +export interface AdvanceEarnDualAssetQuoteLevelV5 { + selectPrice: string; + apyE8: string; + maxInvestmentAmount: string; + expiredAt: string; +} ⋮---- -// trace: (...params) => console.log('trace', ...params), +export interface AdvanceEarnDualAssetQuoteProductV5 { + productId: string; + currentPrice: string; + buyLowPrice: AdvanceEarnDualAssetQuoteLevelV5[]; + sellHighPrice: AdvanceEarnDualAssetQuoteLevelV5[]; +} ⋮---- -/** - * Prepare an instance of the WebSocket client. This client handles all aspects of connectivity for you: - * - Connections are opened when you subscribe to topics - * - If key & secret are provided, authentication is handled automatically - * - If you subscribe to topics from different v5 products (e.g. spot and linear perps), - * subscription events are automatically routed to the different ws endpoints on bybit's side - * - Heartbeats/ping/pong/reconnects are all handled automatically. - * If a connection drops, the client will clean it up, respawn a fresh connection and resubscribe for you. - */ +/** GET /v5/earn/advance/product-extra-info?category=DualAssets&productId= */ +export interface AdvanceEarnProductExtraInfoDualAssetsV5 { + category: 'DualAssets'; + list: AdvanceEarnDualAssetQuoteProductV5[]; +} ⋮---- -// testnet: false, -// demoTrading: false, // set testnet to false, if you plan on using demo trading +export type AdvanceEarnProductExtraInfoV5 = + | AdvanceEarnProductExtraInfoDiscountBuyV5 + | AdvanceEarnProductExtraInfoDualAssetsV5; ⋮---- -// console.log('raw message received ', JSON.stringify(data, null, 2)); +export interface AdvanceEarnPlaceOrderResultV5 { + orderId: string; + orderLinkId: string; +} ⋮---- -// wsClient.on('exception', (data) => { -// console.error('ws exception: ', data); -// }); +export interface AdvanceEarnDiscountBuyPositionV5 { + positionId: string; + productId: string; + category: string; + coin: string; + underlyingAsset: string; + amount: string; + purchasePrice: string; + knockoutPrice: string; + knockoutCouponE8: string; + status: string; + orderId: string; + duration: string; + settlementTime: string; + accountType: string; + toAccountType: string; + settleType: string; + expectReceiveAt: string; +} ⋮---- -/** - * For private V5 topics, us the subscribeV5() method on the ws client or use the original subscribe() method. - * - * Note: for private endpoints the "category" field is ignored since there is only one private endpoint - * (compared to one public one per category). - * The "category" is only needed for public topics since bybit has one endpoint for public events per category. - */ +export interface AdvanceEarnDualAssetsPositionV5 { + positionId: string; + productId: string; + category: string; + baseCoin: string; + quoteCoin: string; + investCoin: string; + amount: string; + apyE8: string; + direction: 'BuyLow' | 'SellHigh' | string; + targetPrice: string; + settlementTime: string; + status: string; + orderId: string; + duration: string; + expectReturnCoin: string; + expectReturnAmount: string; + accountType: string; + toAccountType: string; + yieldStartAt: string | number; + yieldEndAt: string | number; +} ⋮---- -// wsClient.subscribeV5('execution.fast', 'linear'); -// wsClient.subscribeV5('execution.fast.linear', 'linear'); -// wsClient.subscribeV5('execution.fast.spot', 'spot'); -// wsClient.subscribeV5('execution.fast.option', 'option'); +export interface AdvanceEarnPositionListV5 { + category: string; + list: (AdvanceEarnDiscountBuyPositionV5 | AdvanceEarnDualAssetsPositionV5)[]; + nextPageCursor: string; +} ⋮---- -/** - * The following has the same effect as above, since there's only one private endpoint for V5 account topics: - */ -// wsClient.subscribe('position'); -// wsClient.subscribe('execution'); -// wsClient.subscribe(['order', 'wallet', 'greek']); +export interface AdvanceEarnDiscountBuyOrderV5 { + orderId: string; + orderLinkId: string; + productId: string; + category: string; + orderType: string; + amount: string; + coin: string; + underlyingAsset: string; + status: string; + createdTime: string; + purchasePrice: string; + knockoutPrice: string; + knockoutCouponE8: string; + duration: string; + settlementTime: string; + accountType: string; + toAccountType: string; + settleType: string; + settlementPrice: string; + settlementCoin: string; + settlementAmount: string; + isVip: boolean; + refundStatus: string; +} ⋮---- -// To unsubscribe from topics (after a 5 second delay, in this example): -// setTimeout(() => { -// console.log('unsubscribing'); -// wsClient.unsubscribeV5('execution', 'linear'); -// }, 5 * 1000); +export interface AdvanceEarnDualAssetsOrderV5 { + orderId: string; + orderLinkId: string; + productId: string; + category: string; + orderType: string; + amount: string; + coin: string; + baseCoin: string; + quoteCoin: string; + status: string; + createdTime: string; + updatedTime: string; + direction: 'BuyLow' | 'SellHigh' | string; + targetPrice: string; + settlementTime: string | number; + estimateApyE8: string | number; + duration: string; + accountType: string; + toAccountType: string; + selectApyE8: string | number; + isVip: boolean; + settlementCoin: string; + settlementAmount: string; + orderMode: string; + settlementPrice: string; + refundStatus: string; + trialBonusAmount: string; + trialBonusPnl: string; +} ⋮---- -// Topics are tracked per websocket type -// Get a list of subscribed topics (e.g. for public v3 spot topics) (after a 5 second delay) +export interface AdvanceEarnOrderListV5 { + category: string; + list: (AdvanceEarnDiscountBuyOrderV5 | AdvanceEarnDualAssetsOrderV5)[]; + nextPageCursor: string; +} ================ -File: src/constants/enum.ts +File: src/types/response/v5-earn-fixed-term.ts ================ -/** Full take profit/stop loss mode (a single TP order and a single SL order can be placed, covering the entire position) */ -⋮---- -/** Partial take profit/stop loss mode (multiple TP and SL orders can be placed, covering portions of the position) */ -⋮---- -/** This could mean bad request, incorrect value types or even incorrect/missing values */ -⋮---- -/** API key requires specific whitelisted IPs, and this IP was not in the list */ -⋮---- -/** Account not unified margin, update required */ -⋮---- -/** Seen when placing an order */ -⋮---- -/** Seen if a conditional order is too large */ -⋮---- -/** E.g. trying to change position margin while on cross */ +export interface FixedTermEarnTieredApyV5 { + min: string; + max: string; + apy: string; +} ⋮---- -/** E.g. USDC Options trading, trying to access a symbol that is no longer active */ +export interface FixedTermEarnInterestCoinApyV5 { + coin: string; + apy: string; + expectUnitEarning: string; + currentPrice: string; +} ⋮---- -/** E.g. USDC Options trading when the account hasn't been opened for USDC Options yet */ +export interface FixedTermEarnProductV5 { + productId: string; + category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium' | string; + coin: string; + duration: string; + status: 'Available' | 'SoldOut' | 'NotStarted' | string; + tieredApyList: FixedTermEarnTieredApyV5[]; + minStakeAmount: string; + maxStakeAmount: string; + precision: number; + subscribeStartAt: string; + subscribeEndAt: string; + allowEarlyRedemption: boolean; + earlyRedemptionApy: string; + redemptionLimitDuration: string; + allowAutoReinvest: boolean; + interestCoinApyList: FixedTermEarnInterestCoinApyV5[]; + isVip: boolean; + creditTime: string; + specialUserGroupRequired: boolean; + specialUserGroupInfo: string; +} ⋮---- -/** - * Position idx, used to identify positions in different position modes. - * Required if you are under One-Way Mode: - */ -export enum LinearPositionIdx { - OneWayMode = 0, - BuySide = 1, - SellSide = 2, +export interface FixedTermEarnProductListV5 { + list: FixedTermEarnProductV5[]; } - -================ -File: src/types/request/v5-alpha-lp.ts -================ -/** - * V5 private Alpha LP requests. - */ ⋮---- -export interface GetAlphaLPPoolListParamsV5 { - tokenSymbol?: string; +export interface FixedTermEarnPlaceOrderResultV5 { + orderId: string; + orderLinkId: string; } ⋮---- -export interface GetAlphaLPPoolInfoParamsV5 { - poolAddress: string; +export interface RedeemFixedTermEarnResultV5 { + redeemAmount: string; + estEarnings: string; } ⋮---- -export interface ExecuteAlphaLPStakeParamsV5 { - positionId: number; - poolAddress: string; - payTokenAmount: string; - payTokenCode: string; - rangeUpper?: string; - rangeLower?: string; - priceUpper?: string; - priceLower?: string; -} -⋮---- -export interface ExecuteAlphaLPRedeemParamsV5 { - positionId: number; - poolAddress: string; - dercRatio: string; - receiveTokenCode?: string; -} -⋮---- -export interface GetAlphaLPOrderListParamsV5 { - orderType?: 0 | 1 | 2; - tokenCode?: string; - orderStatus?: number[]; - days?: number; - limit?: number; - pageIndex?: number; - poolAddress?: string; +export interface FixedTermEarnEarlyRedeemInfoV5 { + allowEarlyRedeem: boolean; + earlyRedeemEarning: string; + returnCoin: string; + redemptionLimitDuration: string; } ⋮---- -export interface GetAlphaLPPayTokenListParamsV5 { - chainCode?: string; - tokenAddress?: string; +export interface FixedTermEarnPositionInterestV5 { + coin: string; + apy: string; + expectReturnEarning: string; + price: string; } ⋮---- -export interface GetAlphaLPPayTokenPriceParamsV5 { - tokenCode: string[]; - chainCode?: string; +export interface FixedTermEarnPositionV5 { + positionId: string; + productId: string; + category: string; + coin: string; + amount: string; + effectiveAmount: string; + duration: string; + status: string; + settlementTime: string; + createdAt: string; + orderId: string; + earlyRedeemInfo: FixedTermEarnEarlyRedeemInfoV5 | null; + allowAutoReinvest: boolean; + autoReinvest: string; + interestCoinApyList: FixedTermEarnPositionInterestV5[]; } - -================ -File: src/types/request/v5-alpha-prediction.ts -================ -/** - * V5 private Alpha prediction market requests. - */ ⋮---- -export interface GetAlphaPredictionEventDetailParamsV5 { - eventId?: string; - slug?: string; - hasMoreMarkets?: boolean; +export interface FixedTermEarnPositionListV5 { + list: FixedTermEarnPositionV5[]; } ⋮---- -export interface GetAlphaPredictionOrderEstimateParamsV5 { - tokenId: string; - side: 1 | 2; - eventId: string; +export interface FixedTermEarnOrderYieldInfoV5 { + coin: string; amount: string; - orderType: 1; - payTokenCode?: string; + status: string; + createdAt: string; + apy: string; } ⋮---- -export interface ExecuteAlphaPredictionBuyParamsV5 { - tokenId: string; +export interface FixedTermEarnOrderV5 { + orderId: string; + orderLinkId: string; + orderType: string; + status: string; + productId: string; + category: string; + coin: string; amount: string; - payTokenCode: string; - orderType: 1; - slippage: string; - eventId: string; -} -⋮---- -export interface ExecuteAlphaPredictionSellParamsV5 { - tokenId: string; - size: string; - orderType: 1; - slippage: string; - eventId: string; - toTokenCode?: string; -} -⋮---- -export interface GetAlphaPredictionOrderListParamsV5 { - status?: number; - tokenId?: string; - eventId?: string; - side?: 1 | 2; - days?: number; - limit?: number; - pageIndex?: number; -} -⋮---- -export interface GetAlphaPredictionOrderBookParamsV5 { - tokenIds: string[]; -} -⋮---- -export interface GetAlphaPredictionTokenPriceParamsV5 { - tokenIds: string[]; + duration: string; + accountType: string; + settlementTime: string; + createdAt: string; + yieldInfoList: FixedTermEarnOrderYieldInfoV5[]; } ⋮---- -export interface GetAlphaPredictionPriceHistoryParamsV5 { - tokenId: string; - interval: string; +export interface FixedTermEarnOrderListV5 { + list: FixedTermEarnOrderV5[]; + nextPageCursor: string; } + +================ +File: src/types/response/v5-earn-token.ts +================ +/** + * Earn token product (e.g. BYUSDT) — /v5/earn/token/* + */ ⋮---- -export interface GetAlphaPredictionPositionListParamsV5 { - tokenId?: string; - eventId?: string; - limit?: number; - pageIndex?: number; +export interface EarnTokenProductV5 { + productId: string; + coin: string; + mintFeeRateE8: string; + redeemFeeRateE8: string; + minInvestment: string; + userHolding: string; + leftQuota: string; + canMint: boolean; + savingsBalance: string; + aprE8: string; + bonusAprE8: string; + bonusMaxAmount: string; + baseCoinPrecision: number; + tokenPrecision: number; } ⋮---- -export interface GetAlphaPredictionPositionHistoryParamsV5 { - tokenId?: string; - eventId?: string; - result?: number; - days?: number; - limit?: number; - pageIndex?: number; +export interface PlaceEarnTokenOrderResultV5 { + orderId: string; + orderLinkId: string; } ⋮---- -export interface GetAlphaPredictionPortfolioSummaryParamsV5 { - eventType?: number; +export interface EarnTokenOrderV5 { + orderId: string; + orderLinkId: string; + orderType: 'Mint' | 'Redeem'; + fromCoin: string; + toCoin: string; + fromAmount: string; + toAmount: string; + serviceFee: string; + status: 'Success' | 'Processing' | 'Fail'; + createdTime: string; } ⋮---- -export interface GetAlphaPredictionSideMarketListParamsV5 { - eventId: string; - sortBy?: string; - marketType?: number; - limit?: number; - pageIndex?: number; +export interface EarnTokenPositionV5 { + totalAmount: string; + totalYield: string; + yesterdayYield: string; + aprE8: number; + bonusAprE8: number; + bonusMaxAmount: string; + hasQuota: boolean; } ⋮---- -export interface GetAlphaPredictionSportsMatchListParamsV5 { - eventType: number; - status?: number; - startTime?: number; - endTime?: number; - stageCode?: string; - limit?: number; - pageIndex?: number; +export interface EarnTokenDailyYieldRecordV5 { + yield: string; + bonusYield: string; + status: 'Success' | 'Processing'; + createdTime: string; } ⋮---- -export interface GetAlphaPredictionSportsTimelineStagesParamsV5 { - eventType: number; +export interface EarnTokenHourlyYieldRecordV5 { + effectiveAmount: string; + yield: string; + rewardType: 0 | 1; + aprE8: string; + hourlyDate: string; + createdTime: string; } ⋮---- -export interface GetAlphaPredictionSportsGroupStageDetailParamsV5 { - eventType: number; - groupName?: string; +export interface EarnTokenHistoryAprPointV5 { + timestamp: string; + aprE8: string; } ================ -File: src/types/request/v5-alpha-trade.ts +File: src/types/response/v5-preupgrade.ts ================ -/** - * V5 private Alpha / on-chain (Web3) trade requests. - */ +export interface PreUpgradeTransaction { + symbol: string; + category: string; + side: 'Buy' | 'Sell' | 'None'; + transactionTime: string; + type: string; + qty: string; + size: string; + currency: 'USDC' | 'USDT' | 'BTC' | 'ETH'; + tradePrice: string; + funding: string; + fee: string; + cashFlow: string; + change: string; + cashBalance: string; + feeRate: string; + bonusChange: string; + tradeId: string; + orderId: string; + orderLinkId: string; + extraFees: string; +} ⋮---- -export interface GetAlphaTradeQuoteParamsV5 { - tradeType: 1 | 2; - fromTokenCode: string; - fromTokenAmount: string; - toTokenCode: string; - quoteMode?: 0 | 1 | 2; +export interface PreUpgradeOptionsDelivery { + deliveryTime: number; + symbol: string; + side: 'Buy' | 'Sell'; + position: string; + deliveryPrice: string; + strike: string; + fee: string; + deliveryRpl: string; } ⋮---- -export interface ExecuteAlphaTradeParamsV5 { - fromTokenCode: string; - fromTokenAmount: string; - toTokenCode: string; - slippage: string; - quoteData: string; - gas: string; - quoteMode: 0 | 1 | 2; - correctingCode: string; - tenant?: string; +export interface PreUpgradeUSDCSessionSettlement { + symbol: string; + side: 'Buy' | 'Sell'; + size: string; + sessionAvgPrice: string; + markPrice: string; + realisedPnl: string; + createdTime: string; } -⋮---- -export interface GetAlphaPayTokenListParamsV5 { - chainCode: string; - tokenAddress: string; + +================ +File: src/types/response/v5-spreadtrading.ts +================ +export interface SpreadInstrumentInfoV5 { + symbol: string; + contractType: 'FundingRateArb' | 'CarryTrade' | 'FutureSpread' | 'PerpBasis'; + status: 'Trading' | 'Settling'; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + tickSize: string; + minPrice: string; + maxPrice: string; + lotSize: string; + minSize: string; + maxSize: string; + launchTime: string; + deliveryTime: string; + legs: { + symbol: string; + contractType: 'LinearPerpetual' | 'LinearFutures' | 'Spot'; + }[]; } ⋮---- -export interface GetAlphaTradeOrderListParamsV5 { - limit: number; - pageIndex: number; - tradeType?: number; - tokenCode?: string; - orderStatus?: number[]; - days?: number; - direction?: 'prev' | 'next'; +export interface SpreadOrderbookResponseV5 { + s: string; // Symbol + b: [string, string][]; // Bids array [price, size] + a: [string, string][]; // Asks array [price, size] + u: number; // Update ID + ts: number; // Timestamp + seq: number; // Sequence + cts: number; // Cross timestamp } ⋮---- -export interface GetAlphaBizTokenListParamsV5 { - tokenTag?: number; -} +s: string; // Symbol +b: [string, string][]; // Bids array [price, size] +a: [string, string][]; // Asks array [price, size] +u: number; // Update ID +ts: number; // Timestamp +seq: number; // Sequence +cts: number; // Cross timestamp ⋮---- -export interface AlphaTokenAddressInfoV5 { - chainCode: string; - tokenAddress: string; +export interface SpreadTickerV5 { + symbol: string; // Spread combination symbol name + bidPrice: string; // Bid 1 price + bidSize: string; // Bid 1 size + askPrice: string; // Ask 1 price + askSize: string; // Ask 1 size + lastPrice: string; // Last trade price + highPrice24h: string; // The highest price in the last 24 hours + lowPrice24h: string; // The lowest price in the last 24 hours + prevPrice24h: string; // Price 24 hours ago + volume24h: string; // Volume for 24h } ⋮---- -export interface GetAlphaBizTokenPriceListParamsV5 { - tokenAddressInfo: AlphaTokenAddressInfoV5[]; -} +symbol: string; // Spread combination symbol name +bidPrice: string; // Bid 1 price +bidSize: string; // Bid 1 size +askPrice: string; // Ask 1 price +askSize: string; // Ask 1 size +lastPrice: string; // Last trade price +highPrice24h: string; // The highest price in the last 24 hours +lowPrice24h: string; // The lowest price in the last 24 hours +prevPrice24h: string; // Price 24 hours ago +volume24h: string; // Volume for 24h ⋮---- -export interface GetAlphaBizTokenDetailsParamsV5 { - chainCode: string; - tokenAddress: string; +export interface SpreadRecentTradeV5 { + execId: string; // Execution ID + symbol: string; // Spread combination symbol name + price: string; // Trade price + size: string; // Trade size + side: 'Buy' | 'Sell'; // Side of taker + time: string; // Trade time (ms) + seq?: string; } ⋮---- -export interface GetAlphaAssetDetailParamsV5 { - chainCode: string; - tokenAddress: string; -} - -================ -File: src/types/request/v5-broker.ts -================ -export interface GetExchangeBrokerEarningsParamsV5 { - bizType?: 'SPOT' | 'DERIVATIVES' | 'OPTIONS' | 'CONVERT' | 'FIAT_CONVERT'; - begin?: string; - end?: string; - uid?: string; - limit?: number; - cursor?: string; -} +execId: string; // Execution ID +symbol: string; // Spread combination symbol name +price: string; // Trade price +size: string; // Trade size +side: 'Buy' | 'Sell'; // Side of taker +time: string; // Trade time (ms) ⋮---- -export interface GetBrokerSubAccountDepositsV5 { - id?: string; - txID?: string; - subMemberId?: string; - coin?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface SpreadOpenOrderV5 { + symbol: string; + baseCoin: string; + orderType: 'Market' | 'Limit'; + orderLinkId: string; + side: 'Buy' | 'Sell'; + timeInForce: 'GTC' | 'FOK' | 'IOC' | 'PostOnly'; + orderId: string; + leavesQty: string; + orderStatus: 'New' | 'PartiallyFilled'; + cumExecQty: string; + price: string; + qty: string; + createdTime: string; + updatedTime: string; } ⋮---- -export interface IssueVoucherParamsV5 { - accountId: string; - awardId: string; - specCode: string; - amount: string; - brokerId: string; +export interface SpreadOrderHistoryV5 { + symbol: string; + orderType: 'Market' | 'Limit'; + orderLinkId: string; + orderId: string; + contractType: 'FundingRateArb' | 'CarryTrade' | 'FutureSpread' | 'PerpBasis'; + orderStatus: 'Rejected' | 'Cancelled' | 'Filled'; + price: string; + orderQty: string; + timeInForce: 'GTC' | 'FOK' | 'IOC' | 'PostOnly'; + baseCoin: string; + createdAt: string; + updatedAt: string; + side: 'Buy' | 'Sell'; + leavesQty: string; + settleCoin: string; + cumExecQty: string; + qty: string; + leg1Symbol: string; + leg1ProdType: 'Futures' | 'Spot'; + leg1OrderId: string; + leg1Side: string; + leg2ProdType: 'Futures' | 'Spot'; + leg2OrderId: string; + leg2Symbol: string; + leg2Side: string; + cxlRejReason: string; + cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee } ⋮---- -export interface GetBrokerIssuedVoucherParamsV5 { - accountId: string; - awardId: string; - specCode: string; - withUsedAmount?: boolean; +cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee +⋮---- +export interface SpreadTradeLegV5 { + symbol: string; + side: 'Buy' | 'Sell'; + execPrice: string; + execTime: string; + execValue: string; + execType: string; + category: 'linear' | 'spot'; + execQty: string; + execFee: string; + feeCurrency: string; // Trading fee currency + execId: string; } ⋮---- -/** Set Rate Limit - exchange broker only. API rate limit: 1 req per second. */ -export interface SetBrokerRateLimitParamsV5 { - list: { - uids: string; - bizType: string; - rate: number; - }[]; +feeCurrency: string; // Trading fee currency +⋮---- +export interface SpreadTradeV5 { + symbol: string; + orderLinkId: string; + side: 'Buy' | 'Sell'; + orderId: string; + execPrice: string; + execTime: string; + execType: 'Trade'; + execQty: string; + execId: string; + legs: SpreadTradeLegV5[]; + extraFees: string; } ⋮---- -/** Get All Rate Limits - exchange broker only. API rate limit: 1 req per second. */ -export interface GetAllBrokerRateLimitsParamsV5 { - limit?: string; - cursor?: string; - uids?: string; +/** GET /v5/spread/max-qty */ +export interface SpreadMaxQtyResultV5 { + /** Maximum order quantity (available balance for the spread order). */ + ab: string; } +⋮---- +/** Maximum order quantity (available balance for the spread order). */ ================ -File: src/types/request/v5-card.ts +File: src/types/websockets/index.ts ================ -/** - * Bybit Card — /v5/card/* - * Authenticated; API key permission per Bybit (often card-related). - */ -⋮---- -export interface QueryCardAssetRecordsParamsV5 { - /** 0: Pending, 1: Cleared, 2: Declined */ - statusCode?: string; - /** Default 100, range [1, 500] */ - limit?: number; - /** Default 1, min 1 */ - page?: number; - /** Last 2/4 digits of card number */ - pan4?: string; - createBeginTime?: number; - createEndTime?: number; - /** Fuzzy search */ - merchName?: string; - /** Authorization / Clearing / Refund (see Bybit) */ - type?: string; - txnId?: string; - cardToken?: string; - orderNo?: string; -} -⋮---- -/** 0: Pending, 1: Cleared, 2: Declined */ -⋮---- -/** Default 100, range [1, 500] */ -⋮---- -/** Default 1, min 1 */ + + +================ +File: src/types/websockets/ws-api.ts +================ +import { APIID, WS_KEY_MAP } from '../../util'; +import { + AmendOrderParamsV5, + BatchAmendOrderParamsV5, + BatchCancelOrderParamsV5, + BatchOrderParamsV5, + CancelOrderParamsV5, + OrderParamsV5, +} from '../request'; +import { + BatchAmendOrderResultV5, + BatchCancelOrderResultV5, + BatchCreateOrderResultV5, + BatchOrdersRetExtInfoV5, + OrderResultV5, +} from '../response'; +import { WsKey } from './ws-general'; ⋮---- -/** Last 2/4 digits of card number */ +// When new WS API operations are added, make sure to also update WS_API_Operations[] below +export type WSAPIOperation = + | 'order.create' + | 'order.amend' + | 'order.cancel' + | 'order.create-batch' + | 'order.amend-batch' + | 'order.cancel-batch'; ⋮---- -/** Fuzzy search */ +export type WsOperation = + | 'subscribe' + | 'unsubscribe' + | 'auth' + | 'ping' + | 'pong'; ⋮---- -/** Authorization / Clearing / Refund (see Bybit) */ +export interface WsRequestOperationBybit { + req_id: string; + op: WsOperation; + args?: (TWSTopic | string | number)[]; +} ⋮---- -export interface QueryCardPointRecordsParamsV5 { - type?: string; - pageSize?: number; - pageNo?: number; - startTime?: number; - endTime?: number; - outOrderId?: string; - bizId?: string; - bizTxnId?: string; - /** 1: Earn, 2: Deduct */ - side?: string; +export interface WSAPIRequest< + TRequestParams = undefined, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + TWSOperation extends WSAPIOperation = any, +> { + reqId: string; + op: TWSOperation; + header: { + 'X-BAPI-TIMESTAMP': string; + 'X-BAPI-RECV-WINDOW': string; + Referer: typeof APIID; + }; + args: [TRequestParams]; } ⋮---- -/** 1: Earn, 2: Deduct */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any ⋮---- -export interface QueryCardMallItemListParamsV5 { - pageNo?: number; - pageSize?: number; - /** 1: Virtual, 2: Physical */ - itemType?: number; - /** 1: POINTS, 2: CURRENCY */ - itemBizType?: number; - /** 1: Priority, 2: Listing time, 3: Price */ - orderBy?: number; - asc?: boolean; - /** 0: Default, 1: VIP */ - source?: number; +export interface WSAPIResponse< + TResponseData extends object = object, + TOperation extends WSAPIOperation = WSAPIOperation, + TResponseExtInfo = {}, // added as optional for batch calls +> { + wsKey: WsKey; + /** Auto-generated */ + reqId: string; + retCode: 0 | number; + retMsg: 'OK' | string; + op: TOperation; + data: TResponseData; + retExtInfo: TResponseExtInfo; + header?: { + 'X-Bapi-Limit': string; + 'X-Bapi-Limit-Status': string; + 'X-Bapi-Limit-Reset-Timestamp': string; + Traceid: string; + Timenow: string; + }; + connId: string; } ⋮---- -/** 1: Virtual, 2: Physical */ +TResponseExtInfo = {}, // added as optional for batch calls ⋮---- -/** 1: POINTS, 2: CURRENCY */ +/** Auto-generated */ ⋮---- -/** 1: Priority, 2: Listing time, 3: Price */ +export type Exact = { + // This part says: if there's any key that's not in T, it's an error + [K: string]: never; +} & { + [K in keyof T]: T[K]; +}; ⋮---- -/** 0: Default, 1: VIP */ +// This part says: if there's any key that's not in T, it's an error ⋮---- -export interface QueryCardPointCashbackDetailParamsV5 { - bizTxnId: string; -} - -================ -File: src/types/request/v5-earn-advance-discount.ts -================ /** - * /v5/earn/advance/ — product-extra, place order, position, order (Discount Buy, Dual Assets, etc.) + * List of operations supported for this WsKey (connection) */ -export type GetAdvanceEarnProductExtraInfoParamsV5 = - | { - category: 'DiscountBuy'; - productId?: string; - } - | { - category: 'DualAssets'; - /** Required for Dual Assets quote. */ - productId: string; - }; -⋮---- -/** Required for Dual Assets quote. */ -⋮---- -export interface AdvanceEarnDiscountBuyExtraV5 { - initialPrice: string; - purchasePrice: string; - knockoutPrice: string; - knockoutCouponE8: string; - settleType: 'Base' | 'Quote'; - instUid: string; -} -⋮---- -export interface AdvanceEarnDualAssetsExtraV5 { - orderDirection: 'BuyLow' | 'SellHigh'; - selectPrice: string; - /** Expected APY in e8 precision; API may return int. */ - apyE8: string | number; -} -⋮---- -/** Expected APY in e8 precision; API may return int. */ -⋮---- -export interface AdvanceEarnInterestCardExtraV5 { - awardId: string | number; - specCode: string; +export interface WsAPIWsKeyTopicMap { + [WS_KEY_MAP.v5PrivateTrade]: WSAPIOperation; } ⋮---- /** - * POST /v5/earn/advance/place-order — Discount Buy + * Request parameters expected per operation */ -export interface SubmitAdvanceEarnPlaceOrderDiscountBuyV5 { - category: 'DiscountBuy'; - productId: string; - orderType: 'Stake'; - amount: string; - coin: string; - accountType: 'FUND' | 'UNIFIED'; - orderLinkId: string; - discountBuyExtra: AdvanceEarnDiscountBuyExtraV5; +export interface WsAPITopicRequestParamMap { + 'order.create': OrderParamsV5; + 'order.amend': AmendOrderParamsV5; + 'order.cancel': CancelOrderParamsV5; + + 'order.create-batch': { + category: 'option' | 'linear'; + request: BatchOrderParamsV5[]; + }; + 'order.amend-batch': { + category: 'option' | 'linear'; + request: BatchAmendOrderParamsV5[]; + }; + 'order.cancel-batch': { + category: 'option' | 'linear'; + request: BatchCancelOrderParamsV5[]; + }; } ⋮---- /** - * POST /v5/earn/advance/place-order — Dual Assets + * Response structure expected for each operation */ -export interface SubmitAdvanceEarnPlaceOrderDualAssetsV5 { - category: 'DualAssets'; - productId: string; - orderType: 'Stake'; - amount: string; - coin: string; - accountType: 'FUND' | 'UNIFIED'; - orderLinkId: string; - dualAssetsExtra: AdvanceEarnDualAssetsExtraV5; - interestCard?: AdvanceEarnInterestCardExtraV5; -} -⋮---- -export type SubmitAdvanceEarnPlaceOrderParamsV5 = - | SubmitAdvanceEarnPlaceOrderDiscountBuyV5 - | SubmitAdvanceEarnPlaceOrderDualAssetsV5; -⋮---- -export interface GetAdvanceEarnPositionListParamsV5 { - category: 'DiscountBuy' | 'DualAssets' | string; - productId?: string; - coin?: string; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetAdvanceEarnOrderListParamsV5 { - category: 'DiscountBuy' | 'DualAssets' | string; - orderId?: string; - orderLinkId?: string; - productId?: string; - /** Dual Assets docs use string ms; other categories may use number. */ - startTime?: string | number; - endTime?: string | number; - limit?: number; - cursor?: string; -} -⋮---- -/** Dual Assets docs use string ms; other categories may use number. */ - +export interface WsAPIOperationResponseMap { + 'order.create': WSAPIResponse; + 'order.amend': WSAPIResponse; + 'order.cancel': WSAPIResponse; + + 'order.create-batch': WSAPIResponse< + { list: BatchCreateOrderResultV5[] }, + 'order.create-batch' + > & { + retExtInfo: BatchOrdersRetExtInfoV5; + }; + 'order.amend-batch': WSAPIResponse< + { list: BatchAmendOrderResultV5[] }, + 'order.amend-batch' + > & { + retExtInfo: BatchOrdersRetExtInfoV5; + }; + 'order.cancel-batch': WSAPIResponse< + { list: BatchCancelOrderResultV5[] }, + 'order.cancel-batch' + > & { + retExtInfo: BatchOrdersRetExtInfoV5; + }; + + ping: { + retCode: 0 | number; + retMsg: 'OK' | string; + op: 'pong'; + data: [string]; + connId: string; + }; +} + ================ -File: src/types/request/v5-earn-fixed-term.ts +File: src/types/websockets/ws-confirmations.ts ================ -/** - * /v5/earn/fixed-term/* - */ -export interface GetFixedTermEarnProductParamsV5 { - coin?: string; +export interface WebsocketTopicSubscriptionConfirmationEvent { + op: 'subscribe'; + req_id: string; + conn_id: string; + ret_msg: string; + success: boolean; } ⋮---- -export interface SubmitFixedTermEarnOrderParamsV5 { - productId: string; - category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; - coin: string; - amount: string; - accountType: 'FUND' | 'UNIFIED'; - orderLinkId: string; - autoInvest?: boolean; +export interface WebsocketSucceededTopicSubscriptionConfirmationEvent + extends WebsocketTopicSubscriptionConfirmationEvent { + success: true; } ⋮---- -export interface RedeemFixedTermEarnParamsV5 { - productId: string; - /** Early redemption: FundPool only */ - category: 'FundPool'; - positionId: string; +export interface WebsocketFailedTopicSubscriptionConfirmationEvent + extends WebsocketTopicSubscriptionConfirmationEvent { + success: false; } + +================ +File: src/types/index.ts +================ + + +================ +File: src/index.ts +================ + + +================ +File: src/spot-client-v3.ts +================ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { APIResponseV3, numberInString } from './types'; +import { REST_CLIENT_TYPE_ENUM } from './util'; +import BaseRestClient from './util/BaseRestClient'; ⋮---- -/** Early redemption: FundPool only */ +/** + * REST API client for newer Spot V3 APIs. + * @deprecated WARNING + * These endpoints are being switched off gradually and are expected to be completely turned off by the end of 2024. + * They may stop working at any point before then. + * Please update your code as soon as possible to use the V5 APIs instead. + */ +export class SpotClientV3 extends BaseRestClient ⋮---- -export interface GetFixedTermEarnPositionParamsV5 { - productId?: string; - category?: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; - coin?: string; -} +getClientType() ⋮---- -export interface GetFixedTermEarnOrderListParamsV5 { - orderType?: 'Stake' | 'Redeem' | 'Reinvest'; - productId?: string; - category?: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; - orderId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} +// Doesn't really matter here, since the only remaining endpoint does not require auth. ⋮---- -export interface SetFixedTermEarnAutoInvestParamsV5 { - productId: string; - category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; - positionId: string; - status: 'Enable' | 'Disable'; -} +async fetchServerTime(): Promise +⋮---- +/** + * + * Market Data Endpoints + * + */ +⋮---- +/** + * Get merged orderbook for symbol + * + * This is the only known pre-V5 endpoint to still be online. + */ +getMergedOrderBook( + symbol: string, + scale?: number, + limit?: number, + ): Promise> +⋮---- +/** + * + * API Data Endpoints + * + */ +⋮---- +getServerTime(): Promise<{ time_now: numberInString }> ================ -File: src/types/request/v5-earn-pwm.ts +File: src/websocket-api-client.ts ================ -/** GET /v5/earn/pwm/investment-plan/detail */ -export interface GetPwmInvestmentPlanDetailParamsV5 { - planId: string; -} +import { + AmendOrderParamsV5, + BatchAmendOrderParamsV5, + BatchAmendOrderResultV5, + BatchCancelOrderParamsV5, + BatchCancelOrderResultV5, + BatchCreateOrderResultV5, + BatchOrderParamsV5, + BatchOrdersRetExtInfoV5, + CancelOrderParamsV5, + OrderParamsV5, + OrderResultV5, +} from './types'; +import { WSAPIResponse } from './types/websockets/ws-api'; +import { WSClientConfigurableOptions } from './types/websockets/ws-general'; +import { DefaultLogger } from './util'; +import { WS_KEY_MAP } from './util/websockets/websocket-util'; +import { WebsocketClient } from './websocket-client'; ⋮---- -/** GET /v5/earn/pwm/investment-plan/new-plan */ -export interface GetPwmPendingInvestmentPlanDetailParamsV5 { - planId: string; +/** + * Configurable options specific to only the REST-like WebsocketAPIClient + */ +export interface WSAPIClientConfigurableOptions { + /** + * Default: true + * + * Attach default event listeners, which will console log any high level + * events (opened/reconnecting/reconnected/etc). + * + * If you disable this, you should set your own event listeners + * on the embedded WS Client `wsApiClient.getWSClient().on(....)`. + */ + attachEventListeners: boolean; } ⋮---- -/** POST /v5/earn/pwm/investment-plan/claim */ -export interface ClaimPwmWithdrawableFundsParamsV5 { - planId: string; - /** Default: FUND */ - toAccountType?: string; - orderLinkId: string; -} +/** + * Default: true + * + * Attach default event listeners, which will console log any high level + * events (opened/reconnecting/reconnected/etc). + * + * If you disable this, you should set your own event listeners + * on the embedded WS Client `wsApiClient.getWSClient().on(....)`. + */ ⋮---- -/** Default: FUND */ +/** + * This is a minimal Websocket API wrapper around the WebsocketClient. + * + * Some methods support passing in a custom "wsKey". This is a reference to which WS connection should + * be used to transmit that message. This is only useful if you wish to use an alternative wss + * domain that is supported by the SDK. + * + * Note: To use testnet, don't set the wsKey - use `testnet: true` in + * the constructor instead. + * + * Note: You can also directly use the sendWSAPIRequest() method to make WS API calls, but some + * may find the below methods slightly more intuitive. + * + * Refer to the WS API promises example for a more detailed example on using sendWSAPIRequest() directly: + * https://github.com/tiagosiebler/bybit-api/blob/master/examples/ws-api-raw-promises.ts + */ +export class WebsocketAPIClient ⋮---- -/** GET /v5/earn/pwm/investment-plan/asset-trend */ -export interface GetPwmInvestmentPlanAssetTrendParamsV5 { - planId: string; - startTime?: number; - endTime?: number; -} +constructor( + options?: WSClientConfigurableOptions & + Partial, + logger?: DefaultLogger, + ) ⋮---- -/** GET /v5/earn/pwm/investment-plan/fund-nav */ -export interface GetPwmFundHistoricalNavParamsV5 { - fundId: string; - startTime?: number; - endTime?: number; -} +public getWSClient(): WebsocketClient ⋮---- -/** POST /v5/earn/pwm/investment-plan/subscribe */ -export interface SubscribePwmInvestmentPlanParamsV5 { - planId: string; - /** Default: FUND */ - accountType?: string; - orderLinkId: string; -} +public setTimeOffsetMs(newOffset: number): void ⋮---- -/** Default: FUND */ +/* + * Bybit WebSocket API Methods + * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline + */ ⋮---- -/** POST /v5/earn/pwm/investment-plan/invest-more */ -export interface InvestMorePwmInvestmentPlanParamsV5 { - planId: string; - /** Default: FUND */ - accountType?: string; - category: string; - productId: string; - amount: string; - orderLinkId: string; -} -⋮---- -/** Default: FUND */ -⋮---- -/** POST /v5/earn/pwm/investment-plan/redeem */ -export interface RedeemPwmInvestmentPlanParamsV5 { - planId: string; - category: string; - productId: string; - orderLinkId: string; - /** Required for fund products */ - shares?: string; - /** Required for non-fund products */ - amount?: string; - /** Required for FundPool and On-chain Earn */ - positionId?: string; -} -⋮---- -/** Required for fund products */ -⋮---- -/** Required for non-fund products */ -⋮---- -/** Required for FundPool and On-chain Earn */ -⋮---- -/** GET /v5/earn/pwm/investment-plan/order */ -export interface GetPwmInvestmentPlanOrdersParamsV5 { - planId?: string; - category?: string; - type?: 'Subscribe' | 'Redeem' | 'AutoReinvest' | string; - status?: 'Completed' | 'Pending' | 'Failed' | string; - startTime?: string; - endTime?: string; - limit?: number; - cursor?: string; - orderLinkId?: string; -} -⋮---- -/** POST /v5/earn/pwm/customize-plan/create */ -export interface CreatePwmCustomizeInvestmentPlanProductV5 { - category: string; - productId: string; - fundName: string; - amount: string; -} -⋮---- -export interface CreatePwmCustomizeInvestmentPlanParamsV5 { - accountType?: string; - products: CreatePwmCustomizeInvestmentPlanProductV5[]; -} -⋮---- -/** GET /v5/earn/pwm/asset-manager/all-funds */ -export interface GetPwmAllFundsParamsV5 { - coin?: string; - fundId?: string; - status?: string; - limit?: number; - cursor?: string; -} -⋮---- -/** POST /v5/earn/pwm/asset-manager/settle-profit */ -export interface SettlePwmFundProfitParamsV5 { - fundId: string; - reqLinkId: string; -} -⋮---- -/** POST /v5/earn/pwm/asset-manager/create-fund */ -export interface CreatePwmFundParamsV5 { - fundName: string; - coin: string; - profitShareRate: string; - managementFeeRate: string; - fundIntroduction?: string; - reqLinkId: string; -} +/** + * Submit a new order + * + * @param params + * @returns + */ +submitNewOrder( + params: OrderParamsV5, + ): Promise> ⋮---- -/** POST /v5/earn/pwm/asset-manager/create-investment-plan */ -export interface CreatePwmAssetManagerInvestmentPlanDistributionV5 { - productId: string; - amount: string; -} +/** + * Amend an order + * + * @param params + * @returns + */ +amendOrder( + params: AmendOrderParamsV5, + ): Promise> ⋮---- -export interface CreatePwmAssetManagerInvestmentPlanParamsV5 { - accountUid: string; - planName: string; - planType: 'stable' | 'advanced' | string; - investmentDistribution: CreatePwmAssetManagerInvestmentPlanDistributionV5[]; - reqLinkId: string; -} +/** + * Cancel an order + * + * @param params + * @returns + */ +cancelOrder( + params: CancelOrderParamsV5, + ): Promise> ⋮---- -/** GET /v5/earn/pwm/asset-manager/get-investment-plan */ -export interface GetPwmAssetManagerInvestmentPlansParamsV5 { - planId?: string; - status?: string; - subscriptionUid?: string; - limit?: number; - cursor?: string; -} +/** + * Batch submit orders + * + * @param params + * @returns + */ +batchSubmitOrders( + category: 'option' | 'linear', + orders: BatchOrderParamsV5[], + ): Promise< + WSAPIResponse< + { + list: BatchCreateOrderResultV5[]; + }, + 'order.create-batch', + BatchOrdersRetExtInfoV5 + > + > ⋮---- -/** POST /v5/earn/pwm/asset-manager/manage-investment-plan */ -export interface ManagePwmAssetManagerInvestmentPlanFundV5 { - fundId: string; - amount: string; -} +/** + * Batch amend orders + * + * @param params + * @returns + */ +batchAmendOrder( + category: 'option' | 'linear', + orders: BatchAmendOrderParamsV5[], + ): Promise< + WSAPIResponse< + { + list: BatchAmendOrderResultV5[]; + }, + 'order.amend-batch', + BatchOrdersRetExtInfoV5 + > + > ⋮---- -export interface ManagePwmAssetManagerInvestmentPlanParamsV5 { - planId: string; - updateStatus?: 'Closed' | 'Deleted' | string; - updateFunds?: ManagePwmAssetManagerInvestmentPlanFundV5[]; - reqLinkId: string; -} +/** + * Batch cancel orders + * + * @param params + * @returns + */ +batchCancelOrder( + category: 'option' | 'linear', + orders: BatchCancelOrderParamsV5[], + ): Promise< + WSAPIResponse< + { + list: BatchCancelOrderResultV5[]; + }, + 'order.cancel-batch', + BatchOrdersRetExtInfoV5 + > + > ⋮---- -/** GET /v5/earn/pwm/asset-manager/all-order */ -export interface GetPwmAllFundOrdersParamsV5 { - fundId?: string; - orderType?: 'Subscribe' | 'Redeem' | string; - status?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} +/** + * + * + * + * + * + * + * + * Private methods for handling some of the convenience/automation provided by the WS API Client + * + * + * + * + * + * + * + */ ⋮---- -/** POST /v5/earn/pwm/asset-manager/manage-order */ -export interface ManagePwmFundOrderParamsV5 { - orderId: string; - action: 'approve' | 'reject' | string; - reqLinkId: string; -} +private setupDefaultEventListeners() ⋮---- -/** POST /v5/earn/pwm/asset-manager/create-sub-account */ -export interface CreatePwmFundSubAccountParamsV5 { - fundId: string; - reqLinkId: string; -} +/** + * General event handlers for monitoring the WebsocketClient + */ ⋮---- -/** POST /v5/earn/pwm/fund-transfer */ -export interface PwmFundTransferParamsV5 { - transferId: string; - fromUserId: number; - toUserId: number; - amount: string; - coin: string; -} +// Blind JSON.stringify can fail on circular references ⋮---- -/** GET /v5/earn/pwm/query-fund-transfer-result */ -export interface GetPwmFundTransferRecordsParamsV5 { - transferId?: string; - fromUserId?: number; -} +// JSON.stringify({ ...data, target: 'WebSocket' }), ================ -File: src/types/request/v5-earn-token.ts +File: .eslintrc.cjs ================ -/** - * Earn token product (e.g. BYUSDT) — /v5/earn/token/* - */ -⋮---- -export interface GetEarnTokenProductParamsV5 { - /** Currently only BYUSDT */ - coin: string; -} +// 'require-extensions', // only once moved to ESM ⋮---- -/** Currently only BYUSDT */ +// 'plugin:require-extensions/recommended', // only once moved to ESM ⋮---- -export interface PlaceEarnTokenOrderParamsV5 { - coin: string; - orderLinkId: string; - orderType: 'Mint' | 'Redeem'; - amount: string; - /** Mint: FlexibleSaving; Redeem: UNIFIED */ - accountType: 'FlexibleSaving' | 'UNIFIED'; +// 'no-unused-vars': ['warn'], + +================ +File: .jshintrc +================ +{ + "esversion": 8, + "asi": true, + "laxbreak": true, + "predef": [ "-Promise" ] +} + +================ +File: .prettierrc +================ +{ + "tabWidth": 2, + "singleQuote": true, + "trailingComma": "all" +} + +================ +File: index.js +================ + + +================ +File: jsconfig.json +================ +{ + "compilerOptions": { + "target": "ES6", + "module": "commonjs" + }, + "exclude": [ + "node_modules", + "**/node_modules/*", + "coverage", + "doc", + "examples/ignored/*" + ] +} + +================ +File: LICENSE.md +================ +Copyright 2024 Tiago Siebler + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +================ +File: tsconfig.build.json +================ +{ + "extends": "./tsconfig.json", + "exclude": [ + "node_modules", + "test", + "dist", + "**/*spec.ts", + "**/*test.ts", + "jest.config.ts" + ] +} + +================ +File: tsconfig.examples.json +================ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "distExamples", + "allowJs": true + }, + "include": ["examples/**/*.ts", "examples/**/*.js"] +} + +================ +File: tsconfig.json +================ +{ + "compileOnSave": true, + "compilerOptions": { + "allowJs": true, + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + "removeComments": false, + "noEmitOnError": true, + "noImplicitAny": false, + "strictNullChecks": true, + "skipLibCheck": true, + "sourceMap": true, + "esModuleInterop": true, + "lib": ["es2017", "dom"], + "baseUrl": ".", + "outDir": "./lib" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "**/node_modules/*", "coverage", "doc"] +} + +================ +File: tsconfig.linting.json +================ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "target": "esnext", + "rootDir": "../", + "allowJs": true + }, + "include": [ + "src/**/*.*", + "test/**/*.*", + "examples/**/*.*", + ".eslintrc.cjs", + "jest.config.ts" + ] +} + +================ +File: tsconfig.test.json +================ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./distTest", + "allowJs": true + }, + "include": ["test/**/*.ts", "test/**/*.js"] } + +================ +File: src/constants/enum.ts +================ +/** Full take profit/stop loss mode (a single TP order and a single SL order can be placed, covering the entire position) */ ⋮---- -/** Mint: FlexibleSaving; Redeem: UNIFIED */ +/** Partial take profit/stop loss mode (multiple TP and SL orders can be placed, covering portions of the position) */ ⋮---- -export interface GetEarnTokenOrderListParamsV5 { - coin: string; - orderLinkId?: string; - orderId?: string; - orderType?: 'Mint' | 'Redeem'; - /** seconds */ - startTime?: number; - /** seconds */ - endTime?: number; - cursor?: string; - limit?: number; -} +/** This could mean bad request, incorrect value types or even incorrect/missing values */ ⋮---- -/** seconds */ +/** API key requires specific whitelisted IPs, and this IP was not in the list */ ⋮---- -/** seconds */ +/** Account not unified margin, update required */ ⋮---- -export interface GetEarnTokenPositionParamsV5 { - coin: string; -} +/** Seen when placing an order */ ⋮---- -export interface GetEarnTokenDailyYieldParamsV5 { - coin: string; - startTime?: number; - endTime?: number; - cursor?: string; - limit?: number; -} +/** Seen if a conditional order is too large */ ⋮---- -export interface GetEarnTokenHourlyYieldParamsV5 { - coin: string; - startTime?: number; - endTime?: number; - cursor?: string; - limit?: number; -} +/** E.g. trying to change position margin while on cross */ ⋮---- -export interface GetEarnTokenHistoryAprParamsV5 { - coin: string; - /** 1 = 7d, 2 = 30d, 3 = 180d */ - range: 1 | 2 | 3; -} +/** E.g. USDC Options trading, trying to access a symbol that is no longer active */ ⋮---- -/** 1 = 7d, 2 = 30d, 3 = 180d */ +/** E.g. USDC Options trading when the account hasn't been opened for USDC Options yet */ +⋮---- +/** + * Position idx, used to identify positions in different position modes. + * Required if you are under One-Way Mode: + */ +export enum LinearPositionIdx { + OneWayMode = 0, + BuySide = 1, + SellSide = 2, +} ================ -File: src/types/request/v5-position.ts +File: src/types/request/v5-alpha-lp.ts ================ -import { - CategoryV5, - ExecTypeV5, - OrderTriggerByV5, - OrderTypeV5, - PositionIdx, - TPSLModeV5, -} from '../shared-v5'; -⋮---- -export interface GetFuturesLeverageParamsV5 { - category: 'linear' | 'inverse'; - symbol?: string; -} +/** + * V5 private Alpha LP requests. + */ ⋮---- -export interface PositionInfoParamsV5 { - category: CategoryV5; - symbol?: string; - baseCoin?: string; - settleCoin?: string; - limit?: number; - cursor?: string; +export interface GetAlphaLPPoolListParamsV5 { + tokenSymbol?: string; } ⋮---- -export interface SetLeverageParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - buyLeverage: string; - sellLeverage: string; +export interface GetAlphaLPPoolInfoParamsV5 { + poolAddress: string; } ⋮---- -export interface SwitchIsolatedMarginParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - tradeMode: 0 | 1; - buyLeverage: string; - sellLeverage: string; +export interface ExecuteAlphaLPStakeParamsV5 { + positionId: number; + poolAddress: string; + payTokenAmount: string; + payTokenCode: string; + rangeUpper?: string; + rangeLower?: string; + priceUpper?: string; + priceLower?: string; } ⋮---- -export interface SetTPSLModeParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - tpSlMode: TPSLModeV5; +export interface ExecuteAlphaLPRedeemParamsV5 { + positionId: number; + poolAddress: string; + dercRatio: string; + receiveTokenCode?: string; } ⋮---- -export interface SwitchPositionModeParamsV5 { - category: 'linear' | 'inverse'; - symbol?: string; - coin?: string; - mode: 0 | 3; +export interface GetAlphaLPOrderListParamsV5 { + orderType?: 0 | 1 | 2; + tokenCode?: string; + orderStatus?: number[]; + days?: number; + limit?: number; + pageIndex?: number; + poolAddress?: string; } ⋮---- -export interface SetRiskLimitParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - riskId: number; - positionIdx?: PositionIdx; +export interface GetAlphaLPPayTokenListParamsV5 { + chainCode?: string; + tokenAddress?: string; } ⋮---- -export interface SetTradingStopParamsV5 { - category: CategoryV5; - symbol: string; - takeProfit?: string; - stopLoss?: string; - trailingStop?: string; - tpTriggerBy?: OrderTriggerByV5; - slTriggerBy?: OrderTriggerByV5; - activePrice?: string; - tpslMode?: TPSLModeV5; - tpSize?: string; - slSize?: string; - tpLimitPrice?: string; - slLimitPrice?: string; - tpOrderType?: OrderTypeV5; - slOrderType?: OrderTypeV5; - positionIdx: PositionIdx; +export interface GetAlphaLPPayTokenPriceParamsV5 { + tokenCode: string[]; + chainCode?: string; } + +================ +File: src/types/request/v5-alpha-prediction.ts +================ +/** + * V5 private Alpha prediction market requests. + */ ⋮---- -export interface SetAutoAddMarginParamsV5 { - category: 'linear'; - symbol: string; - autoAddMargin: 0 | 1; - positionIdx?: PositionIdx; +export interface GetAlphaPredictionEventDetailParamsV5 { + eventId?: string; + slug?: string; + hasMoreMarkets?: boolean; } ⋮---- -export interface AddOrReduceMarginParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - margin: string; - positionIDex?: PositionIdx; +export interface GetAlphaPredictionOrderEstimateParamsV5 { + tokenId: string; + side: 1 | 2; + eventId: string; + amount: string; + orderType: 1; + payTokenCode?: string; } ⋮---- -export interface GetExecutionListParamsV5 { - category: CategoryV5; - symbol?: string; - orderId?: string; - orderLinkId?: string; - baseCoin?: string; - settleCoin?: string; // Settle coin, uppercase only. For linear, inverse, option - startTime?: number; - endTime?: number; - execType?: ExecTypeV5; +export interface ExecuteAlphaPredictionBuyParamsV5 { + tokenId: string; + amount: string; + payTokenCode: string; + orderType: 1; + slippage: string; + eventId: string; +} +⋮---- +export interface ExecuteAlphaPredictionSellParamsV5 { + tokenId: string; + size: string; + orderType: 1; + slippage: string; + eventId: string; + toTokenCode?: string; +} +⋮---- +export interface GetAlphaPredictionOrderListParamsV5 { + status?: number; + tokenId?: string; + eventId?: string; + side?: 1 | 2; + days?: number; limit?: number; - cursor?: string; + pageIndex?: number; } ⋮---- -settleCoin?: string; // Settle coin, uppercase only. For linear, inverse, option +export interface GetAlphaPredictionOrderBookParamsV5 { + tokenIds: string[]; +} ⋮---- -export interface GetClosedPnLParamsV5 { - category: CategoryV5; - symbol?: string; - startTime?: number; - endTime?: number; +export interface GetAlphaPredictionTokenPriceParamsV5 { + tokenIds: string[]; +} +⋮---- +export interface GetAlphaPredictionPriceHistoryParamsV5 { + tokenId: string; + interval: string; +} +⋮---- +export interface GetAlphaPredictionPositionListParamsV5 { + tokenId?: string; + eventId?: string; limit?: number; - cursor?: string; + pageIndex?: number; } ⋮---- -export interface MovePositionParamsV5 { - fromUid: string; - toUid: string; - list: { - category: 'linear' | 'spot' | 'option' | 'inverse'; - symbol: string; - price: string; - side: 'Buy' | 'Sell'; - qty: string; - }[]; +export interface GetAlphaPredictionPositionHistoryParamsV5 { + tokenId?: string; + eventId?: string; + result?: number; + days?: number; + limit?: number; + pageIndex?: number; } ⋮---- -export interface GetMovePositionHistoryParamsV5 { - category?: 'linear' | 'spot' | 'option'; - symbol?: string; - startTime?: number; - endTime?: number; - status?: 'Processing' | 'Filled' | 'Rejected'; - blockTradeId?: string; - limit?: string; - cursor?: string; +export interface GetAlphaPredictionPortfolioSummaryParamsV5 { + eventType?: number; } ⋮---- -export interface ConfirmNewRiskLimitParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; +export interface GetAlphaPredictionSideMarketListParamsV5 { + eventId: string; + sortBy?: string; + marketType?: number; + limit?: number; + pageIndex?: number; } ⋮---- -export interface GetClosedOptionsPositionsParamsV5 { - category: 'option'; - symbol?: string; +export interface GetAlphaPredictionSportsMatchListParamsV5 { + eventType: number; + status?: number; startTime?: number; endTime?: number; + stageCode?: string; limit?: number; - cursor?: string; + pageIndex?: number; +} +⋮---- +export interface GetAlphaPredictionSportsTimelineStagesParamsV5 { + eventType: number; +} +⋮---- +export interface GetAlphaPredictionSportsGroupStageDetailParamsV5 { + eventType: number; + groupName?: string; } ================ -File: src/types/request/v5-rfq.ts +File: src/types/request/v5-broker.ts ================ -export interface RFQTransactionV5 { - category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type - symbol: string; // Name of the trading contract - side: 'buy' | 'sell'; // Inquiry transaction direction - qty: string; // Transaction quantity - isLeverage?: boolean; // For spot lending, default false +export interface GetExchangeBrokerEarningsParamsV5 { + bizType?: 'SPOT' | 'DERIVATIVES' | 'OPTIONS' | 'CONVERT' | 'FIAT_CONVERT'; + begin?: string; + end?: string; + uid?: string; + limit?: number; + cursor?: string; } ⋮---- -category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type -symbol: string; // Name of the trading contract -side: 'buy' | 'sell'; // Inquiry transaction direction -qty: string; // Transaction quantity -isLeverage?: boolean; // For spot lending, default false -⋮---- -export interface RFQHedgeLegV5 { - category: string; - symbol: string; - side: string; - qty: string; - price?: string; +export interface GetBrokerSubAccountDepositsV5 { + id?: string; + txID?: string; + subMemberId?: string; + coin?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface CreateRFQParamsV5 { - counterparties: string[]; // Array of deskCode - rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters - anonymous?: boolean; // Whether it is anonymous inquiry, default false - strategyType?: string; // Inquiry label, max 36 characters - list: RFQTransactionV5[]; // Transaction list, up to 10 sets - hedge?: RFQHedgeLegV5[]; +export interface IssueVoucherParamsV5 { + accountId: string; + awardId: string; + specCode: string; + amount: string; + brokerId: string; } ⋮---- -counterparties: string[]; // Array of deskCode -rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters -anonymous?: boolean; // Whether it is anonymous inquiry, default false -strategyType?: string; // Inquiry label, max 36 characters -list: RFQTransactionV5[]; // Transaction list, up to 10 sets -⋮---- -export interface CancelRFQParamsV5 { - rfqId?: string; // Inquiry ID - rfqLinkId?: string; // Inquiry Custom ID +export interface GetBrokerIssuedVoucherParamsV5 { + accountId: string; + awardId: string; + specCode: string; + withUsedAmount?: boolean; } ⋮---- -rfqId?: string; // Inquiry ID -rfqLinkId?: string; // Inquiry Custom ID -⋮---- -export interface RFQQuoteV5 { - category: 'spot' | 'linear' | 'option'; // Product type - symbol: string; // Name of the trading contract - price: string; // Quote price - isLeverage?: boolean; // For spot lending, default false +/** Set Rate Limit - exchange broker only. API rate limit: 1 req per second. */ +export interface SetBrokerRateLimitParamsV5 { + list: { + uids: string; + bizType: string; + rate: number; + }[]; } ⋮---- -category: 'spot' | 'linear' | 'option'; // Product type -symbol: string; // Name of the trading contract -price: string; // Quote price -isLeverage?: boolean; // For spot lending, default false +/** Get All Rate Limits - exchange broker only. API rate limit: 1 req per second. */ +export interface GetAllBrokerRateLimitsParamsV5 { + limit?: string; + cursor?: string; + uids?: string; +} + +================ +File: src/types/request/v5-earn-liquidity-mining.ts +================ +/** + * GET /v5/earn/liquidity-mining/product (public, 50 req/s per IP) + */ +export interface GetLiquidityMiningProductParamsV5 { + baseCoin?: string; + quoteCoin?: string; +} ⋮---- -export interface CreateRFQQuoteParamsV5 { - rfqId: string; // Inquiry ID - quoteLinkId?: string; // Quotation custom ID, 1-32 characters - anonymous?: boolean; // Whether it is anonymous quotation, default false - expiresIn?: number; // Validity period in seconds, default 60 - quoteBuyList?: RFQQuoteV5[]; // Quotation buy direction - quoteSellList?: RFQQuoteV5[]; // Quotation sell direction +export interface ReinvestLiquidityMiningParamsV5 { + productId: string; + orderLinkId: string; + positionId: string; + leverage?: string; +} + +================ +File: src/types/request/v5-earn-pwm.ts +================ +/** GET /v5/earn/pwm/investment-plan/detail */ +export interface GetPwmInvestmentPlanDetailParamsV5 { + planId: string; } ⋮---- -rfqId: string; // Inquiry ID -quoteLinkId?: string; // Quotation custom ID, 1-32 characters -anonymous?: boolean; // Whether it is anonymous quotation, default false -expiresIn?: number; // Validity period in seconds, default 60 -quoteBuyList?: RFQQuoteV5[]; // Quotation buy direction -quoteSellList?: RFQQuoteV5[]; // Quotation sell direction +/** GET /v5/earn/pwm/investment-plan/new-plan */ +export interface GetPwmPendingInvestmentPlanDetailParamsV5 { + planId: string; +} ⋮---- -export interface ExecuteRFQQuoteParamsV5 { - rfqId: string; // Inquiry ID - quoteId: string; // Quotation ID - quoteSide: 'buy' | 'sell'; // The direction of the quote - isHedge?: boolean; +/** POST /v5/earn/pwm/investment-plan/claim */ +export interface ClaimPwmWithdrawableFundsParamsV5 { + planId: string; + /** Default: FUND */ + toAccountType?: string; + orderLinkId: string; } ⋮---- -rfqId: string; // Inquiry ID -quoteId: string; // Quotation ID -quoteSide: 'buy' | 'sell'; // The direction of the quote +/** Default: FUND */ ⋮---- -export interface GetRFQDetailsParamsV5 { - rfqId?: string; - rfqLinkId?: string; - status?: - | 'Active' - | 'PendingFill' - | 'Canceled' - | 'Filled' - | 'Expired' - | 'Failed'; - traderType?: 'quote' | 'request'; +/** GET /v5/earn/pwm/investment-plan/asset-trend */ +export interface GetPwmInvestmentPlanAssetTrendParamsV5 { + planId: string; startTime?: number; endTime?: number; - limit?: number; - cursor?: string; } ⋮---- -export interface CancelRFQQuoteParamsV5 { - quoteId?: string; // Quotation ID - rfqId?: string; // Inquiry ID - quoteLinkId?: string; // Quotation Custom ID +/** GET /v5/earn/pwm/investment-plan/fund-nav */ +export interface GetPwmFundHistoricalNavParamsV5 { + fundId: string; + startTime?: number; + endTime?: number; } ⋮---- -quoteId?: string; // Quotation ID -rfqId?: string; // Inquiry ID -quoteLinkId?: string; // Quotation Custom ID -⋮---- -export interface GetRFQRealtimeParamsV5 { - rfqId?: string; // Inquiry ID - rfqLinkId?: string; // Inquiry Custom ID - traderType?: 'quote' | 'request'; // Trader type, default 'request' +/** POST /v5/earn/pwm/investment-plan/subscribe */ +export interface SubscribePwmInvestmentPlanParamsV5 { + planId: string; + /** Default: FUND */ + accountType?: string; + orderLinkId: string; } ⋮---- -rfqId?: string; // Inquiry ID -rfqLinkId?: string; // Inquiry Custom ID -traderType?: 'quote' | 'request'; // Trader type, default 'request' +/** Default: FUND */ ⋮---- -export interface GetRFQListParamsV5 { - rfqId?: string; // Inquiry ID - rfqLinkId?: string; // Custom ID for inquiry form - traderType?: 'quoter' | 'request'; // Trader type, default 'request' - status?: - | 'Active' - | 'Canceled' - | 'PendingFill' - | 'Filled' - | 'Expired' - | 'Failed'; // Status of the inquiry form - limit?: number; // Return number of items, max 100, default 50 - cursor?: string; // Page turning mark +/** POST /v5/earn/pwm/investment-plan/invest-more */ +export interface InvestMorePwmInvestmentPlanParamsV5 { + planId: string; + /** Default: FUND */ + accountType?: string; + category: string; + productId: string; + amount: string; + orderLinkId: string; } ⋮---- -rfqId?: string; // Inquiry ID -rfqLinkId?: string; // Custom ID for inquiry form -traderType?: 'quoter' | 'request'; // Trader type, default 'request' -⋮---- -| 'Failed'; // Status of the inquiry form -limit?: number; // Return number of items, max 100, default 50 -cursor?: string; // Page turning mark +/** Default: FUND */ ⋮---- -export interface GetRFQQuoteRealtimeParamsV5 { - rfqId?: string; // Inquiry ID - quoteId?: string; // Quotation ID - quoteLinkId?: string; // Quotation Custom ID - traderType?: 'quote' | 'request'; // Trader type, default 'quote' +/** POST /v5/earn/pwm/investment-plan/redeem */ +export interface RedeemPwmInvestmentPlanParamsV5 { + planId: string; + category: string; + productId: string; + orderLinkId: string; + /** Required for fund products */ + shares?: string; + /** Required for non-fund products */ + amount?: string; + /** Required for FundPool and On-chain Earn */ + positionId?: string; } ⋮---- -rfqId?: string; // Inquiry ID -quoteId?: string; // Quotation ID -quoteLinkId?: string; // Quotation Custom ID -traderType?: 'quote' | 'request'; // Trader type, default 'quote' -⋮---- -export interface GetRFQHistoryParamsV5 { - rfqId?: string; // Inquiry ID - quoteId?: string; // Quotation ID - quoteLinkId?: string; // Quotation custom ID, can only check last 3 months - traderType?: 'quote' | 'request'; // Trader type, default 'quote' - status?: - | 'Active' - | 'Canceled' - | 'PendingFill' - | 'Filled' - | 'Expired' - | 'Failed'; // Status of quotation - limit?: number; // Return number of items, max 100, default 50 - cursor?: string; // Page turning mark -} +/** Required for fund products */ ⋮---- -rfqId?: string; // Inquiry ID -quoteId?: string; // Quotation ID -quoteLinkId?: string; // Quotation custom ID, can only check last 3 months -traderType?: 'quote' | 'request'; // Trader type, default 'quote' +/** Required for non-fund products */ ⋮---- -| 'Failed'; // Status of quotation -limit?: number; // Return number of items, max 100, default 50 -cursor?: string; // Page turning mark +/** Required for FundPool and On-chain Earn */ ⋮---- -export interface GetRFQTradeListParamsV5 { - rfqId?: string; // Inquiry ID - rfqLinkId?: string; // Custom ID for inquiry form, can only check last 3 months - quoteId?: string; // Quotation ID - quoteLinkId?: string; // Quotation custom ID, can only check last 3 months - status?: 'Filled' | 'Rejected'; // Status - limit?: number; // Return number of items, max 100, default 50 - cursor?: string; // Page turning mark +/** GET /v5/earn/pwm/investment-plan/order */ +export interface GetPwmInvestmentPlanOrdersParamsV5 { + planId?: string; + category?: string; + type?: 'Subscribe' | 'Redeem' | 'AutoReinvest' | string; + status?: 'Completed' | 'Pending' | 'Failed' | string; + startTime?: string; + endTime?: string; + limit?: number; + cursor?: string; + orderLinkId?: string; } ⋮---- -rfqId?: string; // Inquiry ID -rfqLinkId?: string; // Custom ID for inquiry form, can only check last 3 months -quoteId?: string; // Quotation ID -quoteLinkId?: string; // Quotation custom ID, can only check last 3 months -status?: 'Filled' | 'Rejected'; // Status -limit?: number; // Return number of items, max 100, default 50 -cursor?: string; // Page turning mark -⋮---- -export interface GetRFQPublicTradesParamsV5 { - startTime?: number; // Timestamp in milliseconds, time range is 7 days - endTime?: number; // Timestamp in milliseconds, time range is 7 days - limit?: number; // Return number of items, max 100, default 50 - cursor?: string; // Page turning mark +/** POST /v5/earn/pwm/customize-plan/create */ +export interface CreatePwmCustomizeInvestmentPlanProductV5 { + category: string; + productId: string; + fundName: string; + amount: string; } ⋮---- -startTime?: number; // Timestamp in milliseconds, time range is 7 days -endTime?: number; // Timestamp in milliseconds, time range is 7 days -limit?: number; // Return number of items, max 100, default 50 -cursor?: string; // Page turning mark +export interface CreatePwmCustomizeInvestmentPlanParamsV5 { + accountType?: string; + products: CreatePwmCustomizeInvestmentPlanProductV5[]; +} ⋮---- -export interface AcceptNonLPQuoteParamsV5 { - rfqId: string; // Inquiry ID +/** GET /v5/earn/pwm/asset-manager/all-funds */ +export interface GetPwmAllFundsParamsV5 { + coin?: string; + fundId?: string; + status?: string; + limit?: number; + cursor?: string; } ⋮---- -rfqId: string; // Inquiry ID - -================ -File: src/types/request/v5-rwa.ts -================ -/** - * V5 RWA (Real World Assets) earn requests. - */ -⋮---- -export interface GetRWAProductListParamsV5 { - coin?: string; +/** POST /v5/earn/pwm/asset-manager/settle-profit */ +export interface SettlePwmFundProfitParamsV5 { + fundId: string; + reqLinkId: string; } ⋮---- -export interface PlaceRWAOrderParamsV5 { - productId: number; - orderType: 'Stake' | 'Redeem'; +/** POST /v5/earn/pwm/asset-manager/create-fund */ +export interface CreatePwmFundParamsV5 { + fundName: string; coin: string; - orderLinkId: string; - stakeAmount?: string; - redeemShares?: string; - accountType?: 'FUND' | 'UNIFIED'; + profitShareRate: string; + managementFeeRate: string; + fundIntroduction?: string; + reqLinkId: string; } ⋮---- -export interface GetRWAOrderListParamsV5 { - orderId?: string; - orderLinkId?: string; - orderType?: 'Stake' | 'Redeem'; - productId?: number; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +/** POST /v5/earn/pwm/asset-manager/create-investment-plan */ +export interface CreatePwmAssetManagerInvestmentPlanDistributionV5 { + productId: string; + amount: string; } ⋮---- -export interface GetRWANavChartParamsV5 { - productId: number; - startTime?: number; - endTime?: number; +export interface CreatePwmAssetManagerInvestmentPlanParamsV5 { + accountUid: string; + planName: string; + planType: 'stable' | 'advanced' | string; + investmentDistribution: CreatePwmAssetManagerInvestmentPlanDistributionV5[]; + reqLinkId: string; } - -================ -File: src/types/request/v5-spot-x.ts -================ -export interface GetLaunchpoolProjectListParamsV5 { - status: number; - activityCoin?: string; - projectId?: string; - cursor?: string; +⋮---- +/** GET /v5/earn/pwm/asset-manager/get-investment-plan */ +export interface GetPwmAssetManagerInvestmentPlansParamsV5 { + planId?: string; + status?: string; + subscriptionUid?: string; limit?: number; + cursor?: string; } ⋮---- -export interface GetLaunchpoolUserActivityLogParamsV5 { - stakeCoin?: string; - type?: number; - status?: number; - startTime?: string; - endTime?: string; - pageSize?: number; - current?: number; +/** POST /v5/earn/pwm/asset-manager/manage-investment-plan */ +export interface ManagePwmAssetManagerInvestmentPlanFundV5 { + fundId: string; + amount: string; } ⋮---- -export interface GetLaunchpoolUserHistoryParamsV5 { - stakeCoin?: string; - rewardCoin?: string; - startTime?: string; - endTime?: string; - pageSize?: number; - current?: number; +export interface ManagePwmAssetManagerInvestmentPlanParamsV5 { + planId: string; + updateStatus?: 'Closed' | 'Deleted' | string; + updateFunds?: ManagePwmAssetManagerInvestmentPlanFundV5[]; + reqLinkId: string; } ⋮---- -export interface GetPuzzleProjectListParamsV5 { - status: number; - projectId?: string; - activityCoin?: string; - cursor?: string; +/** GET /v5/earn/pwm/asset-manager/all-order */ +export interface GetPwmAllFundOrdersParamsV5 { + fundId?: string; + orderType?: 'Subscribe' | 'Redeem' | string; + status?: string; + startTime?: number; + endTime?: number; limit?: number; + cursor?: string; } ⋮---- -export interface GetTokenSplashProjectListParamsV5 { - status: number; - projectId?: string; - activityCoin?: string; - cursor?: string; - limit?: number; +/** POST /v5/earn/pwm/asset-manager/manage-order */ +export interface ManagePwmFundOrderParamsV5 { + orderId: string; + action: 'approve' | 'reject' | string; + reqLinkId: string; } ⋮---- -export interface GetTokenSplashUserActivityParamsV5 { - projectId?: string; - activityCoin?: string; +/** POST /v5/earn/pwm/asset-manager/create-sub-account */ +export interface CreatePwmFundSubAccountParamsV5 { + fundId: string; + reqLinkId: string; +} +⋮---- +/** POST /v5/earn/pwm/fund-transfer */ +export interface PwmFundTransferParamsV5 { + transferId: string; + fromUserId: number; + toUserId: number; + amount: string; + coin: string; +} +⋮---- +/** GET /v5/earn/pwm/query-fund-transfer-result */ +export interface GetPwmFundTransferRecordsParamsV5 { + transferId?: string; + fromUserId?: number; } ================ -File: src/types/request/v5-tax.ts +File: src/types/request/v5-position.ts ================ -export type TaxReportTypeV5 = - | 'ALL' - | 'TRADE' - | 'P&L' - | 'EARN' - | 'DEPOSIT&WITHDRAWAL' - | 'BONUS' - | 'AIRDROP' - | 'CARD'; +import { + CategoryV5, + ExecTypeV5, + OrderTriggerByV5, + OrderTypeV5, + PositionIdx, + TPSLModeV5, +} from '../shared-v5'; ⋮---- -export interface TaxBatchExportItemV5 { - type: TaxReportTypeV5; - /** Subcategory number. Required but ignored when type is ALL; pass "". */ - number: string; +export interface GetFuturesLeverageParamsV5 { + category: 'linear' | 'inverse'; + symbol?: string; } ⋮---- -/** Subcategory number. Required but ignored when type is ALL; pass "". */ +export interface PositionInfoParamsV5 { + category: CategoryV5; + symbol?: string; + baseCoin?: string; + settleCoin?: string; + limit?: number; + cursor?: string; +} ⋮---- -/** POST /v5/fht/compliance/tax/private/batch_create */ -export interface CreateTaxBatchExportParamsV5 { - /** UNIX seconds. Must be within the last 18 months. */ - startTime: number; - /** UNIX seconds. Later than startTime, span at most 12 months. */ - endTime: number; - items: TaxBatchExportItemV5[]; - sourceInstitution?: string; - /** orc is the default when omitted */ - exportFileType?: 'orc' | 'csv'; +export interface SetLeverageParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + buyLeverage: string; + sellLeverage: string; } ⋮---- -/** UNIX seconds. Must be within the last 18 months. */ +export interface SwitchIsolatedMarginParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + tradeMode: 0 | 1; + buyLeverage: string; + sellLeverage: string; +} ⋮---- -/** UNIX seconds. Later than startTime, span at most 12 months. */ +export interface SetTPSLModeParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + tpSlMode: TPSLModeV5; +} ⋮---- -/** orc is the default when omitted */ +export interface SwitchPositionModeParamsV5 { + category: 'linear' | 'inverse'; + symbol?: string; + coin?: string; + mode: 0 | 3; +} ⋮---- -/** GET /v5/fht/compliance/tax/private/batch_query */ -export interface GetTaxBatchExportParamsV5 { - batchId: string; +export interface SetRiskLimitParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + riskId: number; + positionIdx?: PositionIdx; } - -================ -File: src/types/response/contract.ts -================ -/* eslint-disable @typescript-eslint/no-explicit-any */ -export interface PaginatedResult { - nextPageCursor: string; - list: TList[]; +⋮---- +export interface SetTradingStopParamsV5 { + category: CategoryV5; + symbol: string; + takeProfit?: string; + stopLoss?: string; + trailingStop?: string; + tpTriggerBy?: OrderTriggerByV5; + slTriggerBy?: OrderTriggerByV5; + activePrice?: string; + tpslMode?: TPSLModeV5; + tpSize?: string; + slSize?: string; + tpLimitPrice?: string; + slLimitPrice?: string; + tpOrderType?: OrderTypeV5; + slOrderType?: OrderTypeV5; + positionIdx: PositionIdx; } -export interface ContractListResult { - category: string; - list: TList[]; +⋮---- +export interface SetAutoAddMarginParamsV5 { + category: 'linear'; + symbol: string; + autoAddMargin: 0 | 1; + positionIdx?: PositionIdx; } ⋮---- -export interface ContractHistoricOrder { +export interface AddOrReduceMarginParamsV5 { + category: 'linear' | 'inverse'; symbol: string; - orderId: string; - orderLinkId: string; - side: string; - orderType: string; - price: string; - iv: string; - qty: string; - timeInForce: string; - orderStatus: string; - positionIdx: number; - lastPriceOnCreated: string; - createdTime: string; - updatedTime: string; - cancelType: string; - rejectReason: string; - stopOrderType: string; - triggerDirection: number; - triggerBy: string; - triggerPrice: string; - cumExecValue: string; - cumExecFee: string; - cumExecQty: string; - leavesValue: string; - leavesQty: string; - takeProfit: string; - stopLoss: string; - tpslMode: string; - tpLimitPrice: string; - slLimitPrice: string; - tpTriggerBy: string; - slTriggerBy: string; - reduceOnly: boolean; - closeOnTrigger: boolean; - blockTradeId: string; - smpType: string; - smpGroup: string; - smpOrderId: string; + margin: string; + positionIDex?: PositionIdx; } ⋮---- -export interface ContractSymbolTicker { - symbol: string; - bidPrice: string; - askPrice: string; - lastPrice: string; - lastTickDirection: string; - prevPrice24h: string; - price24hPcnt: string; - highPrice24h: string; - lowPrice24h: string; - prevPrice1h: string; - markPrice: string; - indexPrice: string; - openInterest: string; - turnover24h: string; - volume24h: string; - fundingRate: string; - nextFundingTime: string; - predictedDeliveryPrice: string; - basisRate: string; - deliveryFeeRate: string; - deliveryTime: string; +export interface GetExecutionListParamsV5 { + category: CategoryV5; + symbol?: string; + orderId?: string; + orderLinkId?: string; + baseCoin?: string; + settleCoin?: string; // Settle coin, uppercase only. For linear, inverse, option + startTime?: number; + endTime?: number; + execType?: ExecTypeV5; + limit?: number; + cursor?: string; } - -================ -File: src/types/response/v5-alpha-lp.ts -================ -/** - * V5 private Alpha LP responses. - */ ⋮---- -export interface AlphaLPPoolV5 { - poolAddress: string; - poolName: string; - poolTag: string; - apy: string; - tvl: string; - token0Symbol: string; - token0IconUrlDay: string; - token0IconUrlNight: string; - token1Symbol: string; - token1IconUrlDay: string; - token1IconUrlNight: string; - chainCode: string; - chainIconUrl: string; -} +settleCoin?: string; // Settle coin, uppercase only. For linear, inverse, option ⋮---- -export interface AlphaLPPoolListResultV5 { - pools: AlphaLPPoolV5[]; +export interface GetClosedPnLParamsV5 { + category: CategoryV5; + symbol?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface AlphaLPPoolInfoV5 { - poolAddress: string; - poolName: string; - apy: string; - tvl: string; - feeRate: string; - token0Symbol: string; - token0Reserve: string; - token1Symbol: string; - token1Reserve: string; - priceRangeLower: string; - priceRangeUpper: string; - currentPrice: string; +export interface MovePositionParamsV5 { + fromUid: string; + toUid: string; + list: { + category: 'linear' | 'spot' | 'option' | 'inverse'; + symbol: string; + price: string; + side: 'Buy' | 'Sell'; + qty: string; + }[]; } ⋮---- -export interface ExecuteAlphaLPStakeResultV5 { - positionId: number; - orderNo: string; +export interface GetMovePositionHistoryParamsV5 { + category?: 'linear' | 'spot' | 'option'; + symbol?: string; + startTime?: number; + endTime?: number; + status?: 'Processing' | 'Filled' | 'Rejected'; + blockTradeId?: string; + limit?: string; + cursor?: string; } ⋮---- -export interface ExecuteAlphaLPRedeemResultV5 { - orderNo: string; +export interface ConfirmNewRiskLimitParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; } ⋮---- -export interface AlphaLPOrderV5 { - orderType: number; - orderNo: string; - orderStatus: number; - poolAddress: string; - poolName: string; - positionId: number; - tokenCode: string; - tokenSymbol: string; - tokenIconUrlDay: string; - tokenIconUrlNight: string; - amount: string; - chainCode: string; - chainIconUrl: string; - gasTokenSymbol: string; - gasOnchain: string; - gasUsd: string | null; - platformFee: string; - platformFeeUsd: string | null; - createTime: number; - executionTime: number; - failureReason?: string; - dercRatio?: string; +export interface GetClosedOptionsPositionsParamsV5 { + category: 'option'; + symbol?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} + +================ +File: src/types/request/v5-rfq.ts +================ +export interface RFQTransactionV5 { + category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type + symbol: string; // Name of the trading contract + side: 'buy' | 'sell'; // Inquiry transaction direction + qty: string; // Transaction quantity + isLeverage?: boolean; // For spot lending, default false } ⋮---- -export interface AlphaLPOrderListResultV5 { - total: number; - pageIndex: number; - orders: AlphaLPOrderV5[]; +category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type +symbol: string; // Name of the trading contract +side: 'buy' | 'sell'; // Inquiry transaction direction +qty: string; // Transaction quantity +isLeverage?: boolean; // For spot lending, default false +⋮---- +export interface RFQHedgeLegV5 { + category: string; + symbol: string; + side: string; + qty: string; + price?: string; } ⋮---- -export interface AlphaLPPayTokenV5 { - tokenCode: string; - tokenSymbol: string; - chainCode: string; - chainIconUrl: string; - decimals: number; - availableBalance: string; - tokenIconUrlDay: string; - tokenIconUrlNight: string; - minStakeAmount: string; - maxStakeAmount: string; +export interface CreateRFQParamsV5 { + counterparties: string[]; // Array of deskCode + rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters + anonymous?: boolean; // Whether it is anonymous inquiry, default false + strategyType?: string; // Inquiry label, max 36 characters + list: RFQTransactionV5[]; // Transaction list, up to 10 sets + hedge?: RFQHedgeLegV5[]; } ⋮---- -export interface AlphaLPPayTokenListResultV5 { - tokens: AlphaLPPayTokenV5[]; +counterparties: string[]; // Array of deskCode +rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters +anonymous?: boolean; // Whether it is anonymous inquiry, default false +strategyType?: string; // Inquiry label, max 36 characters +list: RFQTransactionV5[]; // Transaction list, up to 10 sets +⋮---- +export interface CancelRFQParamsV5 { + rfqId?: string; // Inquiry ID + rfqLinkId?: string; // Inquiry Custom ID } ⋮---- -export interface AlphaLPPayTokenPriceV5 { - tokenCode: string; - tokenSymbol: string; - priceUsd: string; - chainCode: string; - updateTime: number; +rfqId?: string; // Inquiry ID +rfqLinkId?: string; // Inquiry Custom ID +⋮---- +export interface RFQQuoteV5 { + category: 'spot' | 'linear' | 'option'; // Product type + symbol: string; // Name of the trading contract + price: string; // Quote price + isLeverage?: boolean; // For spot lending, default false } ⋮---- -export interface AlphaLPPayTokenPriceResultV5 { - prices: AlphaLPPayTokenPriceV5[]; +category: 'spot' | 'linear' | 'option'; // Product type +symbol: string; // Name of the trading contract +price: string; // Quote price +isLeverage?: boolean; // For spot lending, default false +⋮---- +export interface CreateRFQQuoteParamsV5 { + rfqId: string; // Inquiry ID + quoteLinkId?: string; // Quotation custom ID, 1-32 characters + anonymous?: boolean; // Whether it is anonymous quotation, default false + expiresIn?: number; // Validity period in seconds, default 60 + quoteBuyList?: RFQQuoteV5[]; // Quotation buy direction + quoteSellList?: RFQQuoteV5[]; // Quotation sell direction } ⋮---- -export interface AlphaLPPositionV5 { - positionId: number; - poolAddress: string; - poolName: string; - stakedAmount: string; - stakedTokenCode: string; - stakedTokenSymbol: string; - currentValueUsd: string; - earnedRewardsUsd: string; - unrealizedPnl: string; - realizedPnl: string; - apy: string; - token0Amount: string; - token0Symbol: string; - token1Amount: string; - token1Symbol: string; - rangeUpper: string; - rangeLower: string; - createTime: number; - updateTime: number; - status: number; -} +rfqId: string; // Inquiry ID +quoteLinkId?: string; // Quotation custom ID, 1-32 characters +anonymous?: boolean; // Whether it is anonymous quotation, default false +expiresIn?: number; // Validity period in seconds, default 60 +quoteBuyList?: RFQQuoteV5[]; // Quotation buy direction +quoteSellList?: RFQQuoteV5[]; // Quotation sell direction ⋮---- -export interface AlphaLPPositionListResultV5 { - positions: AlphaLPPositionV5[]; +export interface ExecuteRFQQuoteParamsV5 { + rfqId: string; // Inquiry ID + quoteId: string; // Quotation ID + quoteSide: 'buy' | 'sell'; // The direction of the quote + isHedge?: boolean; } - -================ -File: src/types/response/v5-alpha-prediction.ts -================ -/** - * V5 private Alpha prediction market responses. - */ ⋮---- -export interface AlphaPredictionEngineStatusV5 { - available: boolean; -} +rfqId: string; // Inquiry ID +quoteId: string; // Quotation ID +quoteSide: 'buy' | 'sell'; // The direction of the quote ⋮---- -export interface AlphaPredictionPayTokenV5 { - tokenCode: string; - symbol: string; - tokenDecimals: number; - tokenIconUrlDay: string; - tokenIconUrlNight: string; - supportChains: string[]; +export interface GetRFQDetailsParamsV5 { + rfqId?: string; + rfqLinkId?: string; + status?: + | 'Active' + | 'PendingFill' + | 'Canceled' + | 'Filled' + | 'Expired' + | 'Failed'; + traderType?: 'quote' | 'request'; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface AlphaPredictionMarketV5 { - tokenId: string; - outcome: string; - price: string; - side: number; - volume: string; - liquidity: string; +export interface CancelRFQQuoteParamsV5 { + quoteId?: string; // Quotation ID + rfqId?: string; // Inquiry ID + quoteLinkId?: string; // Quotation Custom ID } ⋮---- -export interface AlphaPredictionEventDetailV5 { - eventId: string; - slug: string; - title: string; - description: string; - category: string; - endDate: number; - resolved: boolean; - volume: string; - liquidity: string; - markets: AlphaPredictionMarketV5[]; -} +quoteId?: string; // Quotation ID +rfqId?: string; // Inquiry ID +quoteLinkId?: string; // Quotation Custom ID ⋮---- -export interface AlphaPredictionOrderEstimateFeeDetailV5 { - serverFee: string; - polymarketFee: string; +export interface GetRFQRealtimeParamsV5 { + rfqId?: string; // Inquiry ID + rfqLinkId?: string; // Inquiry Custom ID + traderType?: 'quote' | 'request'; // Trader type, default 'request' } ⋮---- -export interface AlphaPredictionOrderEstimateV5 { - avgPrice: string; - estimatedCost: string; - estimatedReceive: string; - toWin?: string; - feeAmount: string; - feeDetail: AlphaPredictionOrderEstimateFeeDetailV5; - slippage: string; -} +rfqId?: string; // Inquiry ID +rfqLinkId?: string; // Inquiry Custom ID +traderType?: 'quote' | 'request'; // Trader type, default 'request' ⋮---- -export interface ExecuteAlphaPredictionOrderResultV5 { - orderNo: string; +export interface GetRFQListParamsV5 { + rfqId?: string; // Inquiry ID + rfqLinkId?: string; // Custom ID for inquiry form + traderType?: 'quoter' | 'request'; // Trader type, default 'request' + status?: + | 'Active' + | 'Canceled' + | 'PendingFill' + | 'Filled' + | 'Expired' + | 'Failed'; // Status of the inquiry form + limit?: number; // Return number of items, max 100, default 50 + cursor?: string; // Page turning mark } ⋮---- -export interface AlphaPredictionOrderV5 { - orderNo: string; - tokenId: string; - eventId: string; - side: number; - orderType: number; - orderAmount: string; - filledSize: string; - filledPrice: string; - totalFee: string; - status: number; - createdAt: number; - updatedAt: number; -} +rfqId?: string; // Inquiry ID +rfqLinkId?: string; // Custom ID for inquiry form +traderType?: 'quoter' | 'request'; // Trader type, default 'request' ⋮---- -export interface AlphaPredictionOrderListResultV5 { - orders: AlphaPredictionOrderV5[]; - total: number; - pageIndex: number; -} +| 'Failed'; // Status of the inquiry form +limit?: number; // Return number of items, max 100, default 50 +cursor?: string; // Page turning mark ⋮---- -export interface AlphaPredictionOrderBookLevelV5 { - price: string; - size: string; +export interface GetRFQQuoteRealtimeParamsV5 { + rfqId?: string; // Inquiry ID + quoteId?: string; // Quotation ID + quoteLinkId?: string; // Quotation Custom ID + traderType?: 'quote' | 'request'; // Trader type, default 'quote' } ⋮---- -export interface AlphaPredictionOrderBookV5 { - tokenId: string; - bids: AlphaPredictionOrderBookLevelV5[]; - asks: AlphaPredictionOrderBookLevelV5[]; -} +rfqId?: string; // Inquiry ID +quoteId?: string; // Quotation ID +quoteLinkId?: string; // Quotation Custom ID +traderType?: 'quote' | 'request'; // Trader type, default 'quote' ⋮---- -export interface AlphaPredictionTokenPriceV5 { - tokenId: string; - bestBid: string; - bestAsk: string; - lastPrice: string; - volume24h: string; - updateTime: number; +export interface GetRFQHistoryParamsV5 { + rfqId?: string; // Inquiry ID + quoteId?: string; // Quotation ID + quoteLinkId?: string; // Quotation custom ID, can only check last 3 months + traderType?: 'quote' | 'request'; // Trader type, default 'quote' + status?: + | 'Active' + | 'Canceled' + | 'PendingFill' + | 'Filled' + | 'Expired' + | 'Failed'; // Status of quotation + limit?: number; // Return number of items, max 100, default 50 + cursor?: string; // Page turning mark } ⋮---- -export interface AlphaPredictionPriceHistoryCandleV5 { - openTime: number; - open: string; - high: string; - low: string; - close: string; - volume: string; -} +rfqId?: string; // Inquiry ID +quoteId?: string; // Quotation ID +quoteLinkId?: string; // Quotation custom ID, can only check last 3 months +traderType?: 'quote' | 'request'; // Trader type, default 'quote' ⋮---- -export interface AlphaPredictionPriceHistoryV5 { - tokenId: string; - interval: string; - list: AlphaPredictionPriceHistoryCandleV5[]; -} +| 'Failed'; // Status of quotation +limit?: number; // Return number of items, max 100, default 50 +cursor?: string; // Page turning mark ⋮---- -export interface AlphaPredictionPositionV5 { - positionId: string; - tokenId: string; - eventId: string; - outcomeName: string; - shares: string; - cost: string; - avgPrice: string; - currentPrice: string; - value: string; - unrealizedPnl: string; - unrealizedPnlRate: string; - createdAt: number; - finished: boolean; +export interface GetRFQTradeListParamsV5 { + rfqId?: string; // Inquiry ID + rfqLinkId?: string; // Custom ID for inquiry form, can only check last 3 months + quoteId?: string; // Quotation ID + quoteLinkId?: string; // Quotation custom ID, can only check last 3 months + status?: 'Filled' | 'Rejected'; // Status + limit?: number; // Return number of items, max 100, default 50 + cursor?: string; // Page turning mark } ⋮---- -export interface AlphaPredictionPositionListResultV5 { - positions: AlphaPredictionPositionV5[]; - total: number; - totalAssetUsd: string; +rfqId?: string; // Inquiry ID +rfqLinkId?: string; // Custom ID for inquiry form, can only check last 3 months +quoteId?: string; // Quotation ID +quoteLinkId?: string; // Quotation custom ID, can only check last 3 months +status?: 'Filled' | 'Rejected'; // Status +limit?: number; // Return number of items, max 100, default 50 +cursor?: string; // Page turning mark +⋮---- +export interface GetRFQPublicTradesParamsV5 { + startTime?: number; // Timestamp in milliseconds, time range is 7 days + endTime?: number; // Timestamp in milliseconds, time range is 7 days + limit?: number; // Return number of items, max 100, default 50 + cursor?: string; // Page turning mark } ⋮---- -export interface AlphaPredictionPositionHistoryV5 { - positionId: string; - tokenId: string; - eventId: string; - outcomeName: string; - shares: string; - cost: string; - avgPrice: string; - exitPrice: string; - realizedPnl: string; - realizedPnlRate: string; - result: number; - closedAt: number; -} -⋮---- -export interface AlphaPredictionPositionHistoryResultV5 { - positions: AlphaPredictionPositionHistoryV5[]; - total: number; -} +startTime?: number; // Timestamp in milliseconds, time range is 7 days +endTime?: number; // Timestamp in milliseconds, time range is 7 days +limit?: number; // Return number of items, max 100, default 50 +cursor?: string; // Page turning mark ⋮---- -export interface AlphaPredictionPortfolioSummaryV5 { - positionValue: string; - positionValueUsd: string; - biggestWin: string; - winRate: string; - winCount: number; - lossCount: number; +export interface AcceptNonLPQuoteParamsV5 { + rfqId: string; // Inquiry ID } ⋮---- -export interface AlphaPredictionSideMarketTokenV5 { - tokenId: string; - outcome: string; - price: string; - liquidity: string; -} +rfqId: string; // Inquiry ID + +================ +File: src/types/request/v5-rwa.ts +================ +/** + * V5 RWA (Real World Assets) earn requests. + */ ⋮---- -export interface AlphaPredictionSideMarketV5 { - marketId: string; - eventId: string; - marketType: number; - question: string; - tokens: AlphaPredictionSideMarketTokenV5[]; - volume24h: string; - endDate: number; - status: number; +export interface GetRWAProductListParamsV5 { + coin?: string; } ⋮---- -export interface AlphaPredictionSideMarketListResultV5 { - list: AlphaPredictionSideMarketV5[]; - total: number; - pageIndex: number; - pageSize: number; +export interface PlaceRWAOrderParamsV5 { + productId: number; + orderType: 'Stake' | 'Redeem'; + coin: string; + orderLinkId: string; + stakeAmount?: string; + redeemShares?: string; + accountType?: 'FUND' | 'UNIFIED'; } ⋮---- -export interface AlphaPredictionSportsMatchV5 { - matchId: string; - eventType: number; - stageCode: string; - homeTeam: string; - awayTeam: string; - matchTime: number; - status: number; - eventId: string; +export interface GetRWAOrderListParamsV5 { + orderId?: string; + orderLinkId?: string; + orderType?: 'Stake' | 'Redeem'; + productId?: number; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface AlphaPredictionSportsMatchListResultV5 { - list: AlphaPredictionSportsMatchV5[]; - total: number; - pageIndex: number; - pageSize: number; +export interface GetRWANavChartParamsV5 { + productId: number; + startTime?: number; + endTime?: number; } -⋮---- -export interface AlphaPredictionSportsTimelineStageV5 { - stageCode: string; - stageName: string; + +================ +File: src/types/request/v5-spot-x.ts +================ +export interface GetLaunchpoolProjectListParamsV5 { status: number; - matchCount: number; - startTime: number; - endTime: number; + activityCoin?: string; + projectId?: string; + cursor?: string; + limit?: number; } ⋮---- -export interface AlphaPredictionSportsTimelineStagesV5 { - eventType: number; - stages: AlphaPredictionSportsTimelineStageV5[]; +export interface GetLaunchpoolUserActivityLogParamsV5 { + stakeCoin?: string; + type?: number; + status?: number; + startTime?: string; + endTime?: string; + pageSize?: number; + current?: number; } ⋮---- -export interface AlphaPredictionSportsGroupStandingV5 { - rank: number; - teamName: string; - played: number; - won: number; - drawn: number; - lost: number; - goalsFor: number; - goalsAgainst: number; - goalDifference: number; - points: number; +export interface GetLaunchpoolUserHistoryParamsV5 { + stakeCoin?: string; + rewardCoin?: string; + startTime?: string; + endTime?: string; + pageSize?: number; + current?: number; } ⋮---- -export interface AlphaPredictionSportsGroupMatchV5 { - matchId: string; - homeTeam: string; - awayTeam: string; - matchTime: number; +export interface GetPuzzleProjectListParamsV5 { status: number; - homeScore: number; - awayScore: number; - eventId: string; + projectId?: string; + activityCoin?: string; + cursor?: string; + limit?: number; } ⋮---- -export interface AlphaPredictionSportsGroupV5 { - groupName: string; - standings: AlphaPredictionSportsGroupStandingV5[]; - matches: AlphaPredictionSportsGroupMatchV5[]; +export interface GetTokenSplashProjectListParamsV5 { + status: number; + projectId?: string; + activityCoin?: string; + cursor?: string; + limit?: number; } ⋮---- -export interface AlphaPredictionSportsGroupStageDetailV5 { - groups: AlphaPredictionSportsGroupV5[]; +export interface GetTokenSplashUserActivityParamsV5 { + projectId?: string; + activityCoin?: string; } ================ -File: src/types/response/v5-alpha-trade.ts +File: src/types/request/v5-spreadtrading.ts ================ -/** - * V5 private Alpha / on-chain (Web3) trade responses. - */ -⋮---- -export interface AlphaTradeQuoteModeEstimationV5 { - quoteMode: number; - estimatedGas: string; - estimatedGasUsd: string; - estimatedSlippage: string; +export interface GetSpreadInstrumentsInfoParamsV5 { + symbol?: string; + baseCoin?: string; + limit?: number; + cursor?: string; } ⋮---- -export interface AlphaTradeQuoteResultV5 { - tradeType: number; - fromTokenCode: string; - fromTokenAmount: string; - fromTokenAmountUsd: string; - toTokenCode: string; - toTokenAmount: string; - toTokenAmountUsd: string; - minToTokenAmount: string; - slippage: string; - gas: string; - gasUsd: string; - platformFee: string; - platformFeeUsd: string; - swapRate: string; - lossRate: string; - quoteData: string; - correctingCode: string; - quoteMode: number; - quoteDataId: string; - expireTime: number; - modeEstimations: AlphaTradeQuoteModeEstimationV5[]; - chargeAmount?: string; - timestamp?: number; +/** GET /v5/spread/max-qty */ +export interface GetSpreadMaxQtyParamsV5 { + symbol: string; + /** 1: Buy, 2: Sell */ + side: '1' | '2'; + orderPrice: string; } ⋮---- -export interface ExecuteAlphaTradeResultV5 { - orderNo: string; +/** 1: Buy, 2: Sell */ +⋮---- +export interface SubmitSpreadOrderParamsV5 { + symbol: string; + side: 'Buy' | 'Sell'; + orderType: 'Limit' | 'Market'; + qty: string; + price: string; + orderLinkId: string; + timeInForce: 'IOC' | 'FOK' | 'GTC' | 'PostOnly'; } ⋮---- -export interface AlphaPayTokenV5 { - tokenCode: string; +export interface AmendSpreadOrderParamsV5 { symbol: string; - tokenDecimals: number; - tokenIconUrlDay: string; - tokenIconUrlNight: string; - limit: string; - supportChains: string[]; + orderId?: string; + orderLinkId?: string; + qty?: string; + price?: string; } ⋮---- -export interface AlphaTradeOrderV5 { - orderType: number; - tradeType: number; - orderNo: string; - orderStatus: number; - fromTokenCode: string; - fromTokenAmount: string; - fromTokenSymbol: string; - fromTokenDecimals: number; - fromTokenIconUrlDay?: string; - fromTokenIconUrlNight?: string; - fromChainCode: string; - fromChainIconUrl?: string; - toTokenCode: string; - toTokenAmount: string; - toTokenSymbol: string; - toTokenDecimals: number; - toTokenIconUrlDay?: string; - toTokenIconUrlNight?: string; - toChainCode: string; - toChainIconUrl?: string; - gasTokenSymbol: string; - gasOnchain: string; - gasUsd: string | null; - platformFee: string; - platformFeeUsd: string | null; - quoteMode: number; - createTime: number; - executionTime?: number; - failureReasonCode?: string; - source?: string; - swapRate: string; - actualFromTokenAmount: string; +export interface GetSpreadOpenOrdersParamsV5 { + symbol?: string; + baseCoin?: string; + orderId?: string; + orderLinkId?: string; + limit?: number; + cursor?: string; } -⋮---- -export interface AlphaTradeOrderListResultV5 { - total: number; - pageIndex: number; - orders: AlphaTradeOrderV5[]; +export interface GetSpreadOrderHistoryParamsV5 { + symbol?: string; + baseCoin?: string; + orderId?: string; + orderLinkId?: string; + /** + * Filter by order status. Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 + */ + orderStatus?: 'Rejected' | 'Cancelled' | 'Filled'; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface AlphaBizTokenV5 { - tokenCode: string; - chainCode: string; - chainIconUrl: string; - tokenAddress: string; - symbol: string; - tokenDecimals: number; - tokenIconUrlDay: string; - tokenIconUrlNight: string; - createTime: number; - createTimeOnchain: number; - riskFlag: number; - minOrderQuantity: number; - maxOrderQuantity: number; - tokenTags: number[]; - payTokenCodes: string[]; -} +/** + * Filter by order status. Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 + */ ⋮---- -export interface AlphaBizTokenPriceV5 { - chainCode: string; - tokenAddress: string; - price: string; - change24h: string; - vol24h: string; - marketCap: string; - liquidity: string; - holders: string; +export interface GetSpreadTradeHistoryParamsV5 { + symbol?: string; + orderId?: string; + orderLinkId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } + +================ +File: src/types/request/v5-tax.ts +================ +export type TaxReportTypeV5 = + | 'ALL' + | 'TRADE' + | 'P&L' + | 'EARN' + | 'DEPOSIT&WITHDRAWAL' + | 'BONUS' + | 'AIRDROP' + | 'CARD'; ⋮---- -export interface AlphaBizTokenPriceListResultV5 { - tokenPriceInfoList: AlphaBizTokenPriceV5[]; +export interface TaxBatchExportItemV5 { + type: TaxReportTypeV5; + /** Subcategory number. Required but ignored when type is ALL; pass "". */ + number: string; } ⋮---- -export interface AlphaBizTokenDetailsV5 { - tokenCode: string; - chainCode: string; - chainIconUrl: string; - tokenAddress: string; - symbol: string; - tokenDecimals: number; - tokenIconUrlDay: string; - tokenIconUrlNight: string; - minOrderQuantity: string; - maxOrderQuantity: string; - maxPositionQuantity: string; - tokenDesc: string; - xUrl: string; - officialUrl: string; - whitePaperUrl: string; - tokenTag: number; - riskFlag: number; - createTimeOnchain: number; - status: number; - tokenTags: number[]; - showMessage: number; - content?: string; - linkName?: string; - linkAddress?: string; -} +/** Subcategory number. Required but ignored when type is ALL; pass "". */ ⋮---- -export interface AlphaAssetV5 { - chainCode: string; - chainIconUrl: string; - tokenAddress: string; - tokenCode: string; - tokenSymbol: string; - tokenDecimals: number; - tokenIconUrlDay: string; - tokenIconUrlNight: string; - tokenAmount: string; - tokenAmountUsd: string; - tradeFlag: number; - pnl: string | null; - pnlRatio: string | null; - costPrice: string | null; - lastPrice: string; - costTotalValue: string | null; - assetStatus: number; - announcementUrl?: string; - estimatedOfflineTime?: number; - delistingTime?: number; +/** POST /v5/fht/compliance/tax/private/batch_create */ +export interface CreateTaxBatchExportParamsV5 { + /** UNIX seconds. Must be within the last 18 months. */ + startTime: number; + /** UNIX seconds. Later than startTime, span at most 12 months. */ + endTime: number; + items: TaxBatchExportItemV5[]; + sourceInstitution?: string; + /** orc is the default when omitted */ + exportFileType?: 'orc' | 'csv'; } ⋮---- -export interface AlphaAssetListResultV5 { - totalAssetUsd: string; - assetList: AlphaAssetV5[]; -} +/** UNIX seconds. Must be within the last 18 months. */ ⋮---- -export interface AlphaAssetDetailResultV5 { - assetList: AlphaAssetV5[]; +/** UNIX seconds. Later than startTime, span at most 12 months. */ +⋮---- +/** orc is the default when omitted */ +⋮---- +/** GET /v5/fht/compliance/tax/private/batch_query */ +export interface GetTaxBatchExportParamsV5 { + batchId: string; } ================ -File: src/types/response/v5-broker.ts +File: src/types/response/contract.ts ================ -interface EarningDetailV5 { - userId: string; - bizType: 'SPOT' | 'DERIVATIVES' | 'OPTIONS' | 'CONVERT' | 'FIAT_CONVERT'; - symbol: string; - coin: string; - earning: string; - markupEarning: string; - baseFeeEarning: string; - orderId: string; - execTime: string; -} -⋮---- -interface TotalEarningCategoryV5 { - coin: string; - earning: string; -} -⋮---- -export interface ExchangeBrokerEarningResultV5 { - totalEarningCat: { - spot: TotalEarningCategoryV5[]; - derivatives: TotalEarningCategoryV5[]; - options: TotalEarningCategoryV5[]; - convert: TotalEarningCategoryV5[]; - fiatConvert?: TotalEarningCategoryV5[]; - total: TotalEarningCategoryV5[]; - }; - details: EarningDetailV5[]; +/* eslint-disable @typescript-eslint/no-explicit-any */ +export interface PaginatedResult { nextPageCursor: string; + list: TList[]; +} +export interface ContractListResult { + category: string; + list: TList[]; } ⋮---- -export interface ExchangeBrokerAccountInfoV5 { - subAcctQty: string; - maxSubAcctQty: string; - baseFeeRebateRate: { - spot: string; - derivatives: string; - }; - markupFeeRebateRate: { - spot: string; - derivatives: string; - convert: string; - }; - ts: string; +export interface ContractHistoricOrder { + symbol: string; + orderId: string; + orderLinkId: string; + side: string; + orderType: string; + price: string; + iv: string; + qty: string; + timeInForce: string; + orderStatus: string; + positionIdx: number; + lastPriceOnCreated: string; + createdTime: string; + updatedTime: string; + cancelType: string; + rejectReason: string; + stopOrderType: string; + triggerDirection: number; + triggerBy: string; + triggerPrice: string; + cumExecValue: string; + cumExecFee: string; + cumExecQty: string; + leavesValue: string; + leavesQty: string; + takeProfit: string; + stopLoss: string; + tpslMode: string; + tpLimitPrice: string; + slLimitPrice: string; + tpTriggerBy: string; + slTriggerBy: string; + reduceOnly: boolean; + closeOnTrigger: boolean; + blockTradeId: string; + smpType: string; + smpGroup: string; + smpOrderId: string; } ⋮---- -export interface ExchangeBrokerSubAccountDepositRecordV5 { - id: string; - subMemberId: string; - coin: string; - chain: string; - amount: string; - txID: string; - status: number; - toAddress: string; - tag: string; - depositFee: string; - successAt: string; - confirmations: string; - txIndex: string; - blockHash: string; - batchReleaseLimit: string; - depositType: string; +export interface ContractSymbolTicker { + symbol: string; + bidPrice: string; + askPrice: string; + lastPrice: string; + lastTickDirection: string; + prevPrice24h: string; + price24hPcnt: string; + highPrice24h: string; + lowPrice24h: string; + prevPrice1h: string; + markPrice: string; + indexPrice: string; + openInterest: string; + turnover24h: string; + volume24h: string; + fundingRate: string; + nextFundingTime: string; + predictedDeliveryPrice: string; + basisRate: string; + deliveryFeeRate: string; + deliveryTime: string; } + +================ +File: src/types/response/v5-alpha-lp.ts +================ +/** + * V5 private Alpha LP responses. + */ ⋮---- -export interface BrokerVoucherSpecV5 { - id: string; - coin: string; - amountUnit: 'AWARD_AMOUNT_UNIT_USD' | 'AWARD_AMOUNT_UNIT_COIN'; - productLine: string; - subProductLine: string; - totalAmount: { - [key: string]: string; - }; - usedAmount: string; +export interface AlphaLPPoolV5 { + poolAddress: string; + poolName: string; + poolTag: string; + apy: string; + tvl: string; + token0Symbol: string; + token0IconUrlDay: string; + token0IconUrlNight: string; + token1Symbol: string; + token1IconUrlDay: string; + token1IconUrlNight: string; + chainCode: string; + chainIconUrl: string; } ⋮---- -export interface BrokerIssuedVoucherV5 { - accountId: string; - awardId: string; - specCode: string; - amount: string; - isClaimed: boolean; - startAt: string; - endAt: string; - effectiveAt: string; - ineffectiveAt: string; - usedAmount: string; +export interface AlphaLPPoolListResultV5 { + pools: AlphaLPPoolV5[]; } ⋮---- -export interface BrokerRateLimitSetResultItemV5 { - uids: string; - bizType: string; - rate: number; - success: boolean; - msg: string; +export interface AlphaLPPoolInfoV5 { + poolAddress: string; + poolName: string; + apy: string; + tvl: string; + feeRate: string; + token0Symbol: string; + token0Reserve: string; + token1Symbol: string; + token1Reserve: string; + priceRangeLower: string; + priceRangeUpper: string; + currentPrice: string; } ⋮---- -export interface BrokerRateLimitCapItemV5 { - bizType: string; - totalRate: string; - ebCap: string; - uidCap: string; +export interface ExecuteAlphaLPStakeResultV5 { + positionId: number; + orderNo: string; } ⋮---- -export interface BrokerRateLimitAllItemV5 { - uids: string; - bizType: string; - rate: number; +export interface ExecuteAlphaLPRedeemResultV5 { + orderNo: string; } - -================ -File: src/types/response/v5-card.ts -================ -export interface CardAssetRecordV5 { - pan4: string; - pan6: string; - tradeStatus: string; - side: string; - basicAmount: string; - basicCurrency: string; - transactionAmount: string; - transactionCurrency: string; - txnCreate: number; - merchCountry: string; - merchCity: string; - merchName: string; - txnId: string; - declinedReason: string; - totalFees: string; - uid: number; - transactionCurrencyAmount: string; - fxPad: string; - interchangeFee: string; - billAmount: string; - paidAmount: string; - paidCurrency: string; - bonusAmount: string; - foreignTransactionFee: string; - totalTax: string; - paidFiat: string; - withdrawalFee: string; - status: string; +⋮---- +export interface AlphaLPOrderV5 { + orderType: number; orderNo: string; - mccCode: string; - merchCategoryDesc: string; + orderStatus: number; + poolAddress: string; + poolName: string; + positionId: number; + tokenCode: string; + tokenSymbol: string; + tokenIconUrlDay: string; + tokenIconUrlNight: string; + amount: string; + chainCode: string; + chainIconUrl: string; + gasTokenSymbol: string; + gasOnchain: string; + gasUsd: string | null; + platformFee: string; + platformFeeUsd: string | null; + createTime: number; + executionTime: number; + failureReason?: string; + dercRatio?: string; } ⋮---- -export interface CardAssetRecordsResultV5 { - pageSize: number; - pageNo: number; - totalCount: number; - data: CardAssetRecordV5[]; +export interface AlphaLPOrderListResultV5 { + total: number; + pageIndex: number; + orders: AlphaLPOrderV5[]; } ⋮---- -export interface CardPointBalanceV5 { - accountId: string; - availablePoint: string | number; - pendingPoint: string | number; - status: string; - updateTime: string | number; - settlementPeriod: number; +export interface AlphaLPPayTokenV5 { + tokenCode: string; + tokenSymbol: string; + chainCode: string; + chainIconUrl: string; + decimals: number; + availableBalance: string; + tokenIconUrlDay: string; + tokenIconUrlNight: string; + minStakeAmount: string; + maxStakeAmount: string; } ⋮---- -export interface CardPointRecordV5 { - outOrderId: string; - point: number; - side: string; - type: string; - subType: string; - createTime: number; - updateTime: number; - bizId: string; - bizTxnId: string; - transactionDate: string; - transactionId: string; - transactionAmount: string; - basicCurrency: string; - merchCategoryDesc: string; - merchName: string; - merchCountry: string; - merchCity: string; - pan4: string; - payFiatAmount: string; - transactionCurrencyAmount: string; +export interface AlphaLPPayTokenListResultV5 { + tokens: AlphaLPPayTokenV5[]; } ⋮---- -export interface CardPointRecordsResultV5 { - pageSize: number; - pageNo: number; - totalCount: number; - data: CardPointRecordV5[]; +export interface AlphaLPPayTokenPriceV5 { + tokenCode: string; + tokenSymbol: string; + priceUsd: string; + chainCode: string; + updateTime: number; } ⋮---- -export interface CardPointTierInfoV5 { - usedLimit: string; - limit: string; - unit: string; - tier: string; - autoCashback: boolean; +export interface AlphaLPPayTokenPriceResultV5 { + prices: AlphaLPPayTokenPriceV5[]; } ⋮---- -export interface CardMallItemV5 { - itemId: string; - itemName: string; - priority: number; - onTime: string; - offTime: string; - price: string; - discountPrice: string; - totalNum: number; - redeemNum: number; - picPath: string; - currency: string; - currencyType: number; - itemType: number; - itemBizType: number; -} -⋮---- -export interface CardMallItemListResultV5 { - pageNo: number; - pageSize: number; - totalCount: number; - data: CardMallItemV5[]; +export interface AlphaLPPositionV5 { + positionId: number; + poolAddress: string; + poolName: string; + stakedAmount: string; + stakedTokenCode: string; + stakedTokenSymbol: string; + currentValueUsd: string; + earnedRewardsUsd: string; + unrealizedPnl: string; + realizedPnl: string; + apy: string; + token0Amount: string; + token0Symbol: string; + token1Amount: string; + token1Symbol: string; + rangeUpper: string; + rangeLower: string; + createTime: number; + updateTime: number; + status: number; } ⋮---- -export interface CardPointCashbackDetailV5 { - points: string; - amt: string; - ccy: string; - ccyType: string; - createTime: string; - bizTxnId: string; - sourceId: number; - sourceCode: string; - orderStatus: number; - orderSubStatus: number; - orderShowStatus: string; - failedBizCode: string; +export interface AlphaLPPositionListResultV5 { + positions: AlphaLPPositionV5[]; } ================ -File: src/types/response/v5-earn-advance-discount.ts +File: src/types/response/v5-alpha-prediction.ts ================ -export interface AdvanceEarnDiscountBuyOfferV5 { - productId: string; - currentPrice: string; - purchasePrice: string; - knockoutPrice: string; - knockoutCouponE8: string; - maxInvestmentAmount: string; - instUid: string; - expiredAt: string; - category: string; -} +/** + * V5 private Alpha prediction market responses. + */ ⋮---- -/** GET /v5/earn/advance/product-extra-info?category=DiscountBuy */ -export interface AdvanceEarnProductExtraInfoDiscountBuyV5 { - offers: AdvanceEarnDiscountBuyOfferV5[]; +export interface AlphaPredictionEngineStatusV5 { + available: boolean; } ⋮---- -export interface AdvanceEarnDualAssetQuoteLevelV5 { - selectPrice: string; - apyE8: string; - maxInvestmentAmount: string; - expiredAt: string; +export interface AlphaPredictionPayTokenV5 { + tokenCode: string; + symbol: string; + tokenDecimals: number; + tokenIconUrlDay: string; + tokenIconUrlNight: string; + supportChains: string[]; } ⋮---- -export interface AdvanceEarnDualAssetQuoteProductV5 { - productId: string; - currentPrice: string; - buyLowPrice: AdvanceEarnDualAssetQuoteLevelV5[]; - sellHighPrice: AdvanceEarnDualAssetQuoteLevelV5[]; +export interface AlphaPredictionMarketV5 { + tokenId: string; + outcome: string; + price: string; + side: number; + volume: string; + liquidity: string; } ⋮---- -/** GET /v5/earn/advance/product-extra-info?category=DualAssets&productId= */ -export interface AdvanceEarnProductExtraInfoDualAssetsV5 { - category: 'DualAssets'; - list: AdvanceEarnDualAssetQuoteProductV5[]; +export interface AlphaPredictionEventDetailV5 { + eventId: string; + slug: string; + title: string; + description: string; + category: string; + endDate: number; + resolved: boolean; + volume: string; + liquidity: string; + markets: AlphaPredictionMarketV5[]; } ⋮---- -export type AdvanceEarnProductExtraInfoV5 = - | AdvanceEarnProductExtraInfoDiscountBuyV5 - | AdvanceEarnProductExtraInfoDualAssetsV5; +export interface AlphaPredictionOrderEstimateFeeDetailV5 { + serverFee: string; + polymarketFee: string; +} ⋮---- -export interface AdvanceEarnPlaceOrderResultV5 { - orderId: string; - orderLinkId: string; +export interface AlphaPredictionOrderEstimateV5 { + avgPrice: string; + estimatedCost: string; + estimatedReceive: string; + toWin?: string; + feeAmount: string; + feeDetail: AlphaPredictionOrderEstimateFeeDetailV5; + slippage: string; } ⋮---- -export interface AdvanceEarnDiscountBuyPositionV5 { - positionId: string; - productId: string; - category: string; - coin: string; - underlyingAsset: string; - amount: string; - purchasePrice: string; - knockoutPrice: string; - knockoutCouponE8: string; - status: string; - orderId: string; - duration: string; - settlementTime: string; - accountType: string; - toAccountType: string; - settleType: string; - expectReceiveAt: string; +export interface ExecuteAlphaPredictionOrderResultV5 { + orderNo: string; } ⋮---- -export interface AdvanceEarnDualAssetsPositionV5 { - positionId: string; - productId: string; - category: string; - baseCoin: string; - quoteCoin: string; - investCoin: string; - amount: string; - apyE8: string; - direction: 'BuyLow' | 'SellHigh' | string; - targetPrice: string; - settlementTime: string; - status: string; - orderId: string; - duration: string; - expectReturnCoin: string; - expectReturnAmount: string; - accountType: string; - toAccountType: string; - yieldStartAt: string | number; - yieldEndAt: string | number; +export interface AlphaPredictionOrderV5 { + orderNo: string; + tokenId: string; + eventId: string; + side: number; + orderType: number; + orderAmount: string; + filledSize: string; + filledPrice: string; + totalFee: string; + status: number; + createdAt: number; + updatedAt: number; } ⋮---- -export interface AdvanceEarnPositionListV5 { - category: string; - list: (AdvanceEarnDiscountBuyPositionV5 | AdvanceEarnDualAssetsPositionV5)[]; - nextPageCursor: string; +export interface AlphaPredictionOrderListResultV5 { + orders: AlphaPredictionOrderV5[]; + total: number; + pageIndex: number; } ⋮---- -export interface AdvanceEarnDiscountBuyOrderV5 { - orderId: string; - orderLinkId: string; - productId: string; - category: string; - orderType: string; - amount: string; - coin: string; - underlyingAsset: string; - status: string; - createdTime: string; - purchasePrice: string; - knockoutPrice: string; - knockoutCouponE8: string; - duration: string; - settlementTime: string; - accountType: string; - toAccountType: string; - settleType: string; - settlementPrice: string; - settlementCoin: string; - settlementAmount: string; - isVip: boolean; - refundStatus: string; +export interface AlphaPredictionOrderBookLevelV5 { + price: string; + size: string; } ⋮---- -export interface AdvanceEarnDualAssetsOrderV5 { - orderId: string; - orderLinkId: string; - productId: string; - category: string; - orderType: string; - amount: string; - coin: string; - baseCoin: string; - quoteCoin: string; - status: string; - createdTime: string; - updatedTime: string; - direction: 'BuyLow' | 'SellHigh' | string; - targetPrice: string; - settlementTime: string | number; - estimateApyE8: string | number; - duration: string; - accountType: string; - toAccountType: string; - selectApyE8: string | number; - isVip: boolean; - settlementCoin: string; - settlementAmount: string; - orderMode: string; - settlementPrice: string; - refundStatus: string; - trialBonusAmount: string; - trialBonusPnl: string; +export interface AlphaPredictionOrderBookV5 { + tokenId: string; + bids: AlphaPredictionOrderBookLevelV5[]; + asks: AlphaPredictionOrderBookLevelV5[]; } ⋮---- -export interface AdvanceEarnOrderListV5 { - category: string; - list: (AdvanceEarnDiscountBuyOrderV5 | AdvanceEarnDualAssetsOrderV5)[]; - nextPageCursor: string; +export interface AlphaPredictionTokenPriceV5 { + tokenId: string; + bestBid: string; + bestAsk: string; + lastPrice: string; + volume24h: string; + updateTime: number; } - -================ -File: src/types/response/v5-earn-fixed-term.ts -================ -export interface FixedTermEarnTieredApyV5 { - min: string; - max: string; - apy: string; +⋮---- +export interface AlphaPredictionPriceHistoryCandleV5 { + openTime: number; + open: string; + high: string; + low: string; + close: string; + volume: string; } ⋮---- -export interface FixedTermEarnInterestCoinApyV5 { - coin: string; - apy: string; - expectUnitEarning: string; - currentPrice: string; +export interface AlphaPredictionPriceHistoryV5 { + tokenId: string; + interval: string; + list: AlphaPredictionPriceHistoryCandleV5[]; } ⋮---- -export interface FixedTermEarnProductV5 { - productId: string; - category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium' | string; - coin: string; - duration: string; - status: 'Available' | 'SoldOut' | 'NotStarted' | string; - tieredApyList: FixedTermEarnTieredApyV5[]; - minStakeAmount: string; - maxStakeAmount: string; - precision: number; - subscribeStartAt: string; - subscribeEndAt: string; - allowEarlyRedemption: boolean; - earlyRedemptionApy: string; - redemptionLimitDuration: string; - allowAutoReinvest: boolean; - interestCoinApyList: FixedTermEarnInterestCoinApyV5[]; - isVip: boolean; - creditTime: string; - specialUserGroupRequired: boolean; - specialUserGroupInfo: string; +export interface AlphaPredictionPositionV5 { + positionId: string; + tokenId: string; + eventId: string; + outcomeName: string; + shares: string; + cost: string; + avgPrice: string; + currentPrice: string; + value: string; + unrealizedPnl: string; + unrealizedPnlRate: string; + createdAt: number; + finished: boolean; } ⋮---- -export interface FixedTermEarnProductListV5 { - list: FixedTermEarnProductV5[]; +export interface AlphaPredictionPositionListResultV5 { + positions: AlphaPredictionPositionV5[]; + total: number; + totalAssetUsd: string; } ⋮---- -export interface FixedTermEarnPlaceOrderResultV5 { - orderId: string; - orderLinkId: string; +export interface AlphaPredictionPositionHistoryV5 { + positionId: string; + tokenId: string; + eventId: string; + outcomeName: string; + shares: string; + cost: string; + avgPrice: string; + exitPrice: string; + realizedPnl: string; + realizedPnlRate: string; + result: number; + closedAt: number; } ⋮---- -export interface RedeemFixedTermEarnResultV5 { - redeemAmount: string; - estEarnings: string; +export interface AlphaPredictionPositionHistoryResultV5 { + positions: AlphaPredictionPositionHistoryV5[]; + total: number; } ⋮---- -export interface FixedTermEarnEarlyRedeemInfoV5 { - allowEarlyRedeem: boolean; - earlyRedeemEarning: string; - returnCoin: string; - redemptionLimitDuration: string; +export interface AlphaPredictionPortfolioSummaryV5 { + positionValue: string; + positionValueUsd: string; + biggestWin: string; + winRate: string; + winCount: number; + lossCount: number; } ⋮---- -export interface FixedTermEarnPositionInterestV5 { - coin: string; - apy: string; - expectReturnEarning: string; +export interface AlphaPredictionSideMarketTokenV5 { + tokenId: string; + outcome: string; price: string; + liquidity: string; } ⋮---- -export interface FixedTermEarnPositionV5 { - positionId: string; - productId: string; - category: string; - coin: string; - amount: string; - effectiveAmount: string; - duration: string; - status: string; - settlementTime: string; - createdAt: string; - orderId: string; - earlyRedeemInfo: FixedTermEarnEarlyRedeemInfoV5 | null; - allowAutoReinvest: boolean; - autoReinvest: string; - interestCoinApyList: FixedTermEarnPositionInterestV5[]; +export interface AlphaPredictionSideMarketV5 { + marketId: string; + eventId: string; + marketType: number; + question: string; + tokens: AlphaPredictionSideMarketTokenV5[]; + volume24h: string; + endDate: number; + status: number; } ⋮---- -export interface FixedTermEarnPositionListV5 { - list: FixedTermEarnPositionV5[]; +export interface AlphaPredictionSideMarketListResultV5 { + list: AlphaPredictionSideMarketV5[]; + total: number; + pageIndex: number; + pageSize: number; } ⋮---- -export interface FixedTermEarnOrderYieldInfoV5 { - coin: string; - amount: string; - status: string; - createdAt: string; - apy: string; +export interface AlphaPredictionSportsMatchV5 { + matchId: string; + eventType: number; + stageCode: string; + homeTeam: string; + awayTeam: string; + matchTime: number; + status: number; + eventId: string; } ⋮---- -export interface FixedTermEarnOrderV5 { - orderId: string; - orderLinkId: string; - orderType: string; - status: string; - productId: string; - category: string; - coin: string; - amount: string; - duration: string; - accountType: string; - settlementTime: string; - createdAt: string; - yieldInfoList: FixedTermEarnOrderYieldInfoV5[]; +export interface AlphaPredictionSportsMatchListResultV5 { + list: AlphaPredictionSportsMatchV5[]; + total: number; + pageIndex: number; + pageSize: number; } ⋮---- -export interface FixedTermEarnOrderListV5 { - list: FixedTermEarnOrderV5[]; - nextPageCursor: string; -} - -================ -File: src/types/response/v5-earn-pwm.ts -================ -export interface PwmCoinAmountV5 { - coin: string; - amount: string; +export interface AlphaPredictionSportsTimelineStageV5 { + stageCode: string; + stageName: string; + status: number; + matchCount: number; + startTime: number; + endTime: number; } ⋮---- -export interface PwmMultiCoinsEarningPositionItemV5 { - category: string; - productId: string; - coin: string; - currentAmount: string; - accumulateYield: string; - apr: string; - positionId: string; - status?: string; +export interface AlphaPredictionSportsTimelineStagesV5 { + eventType: number; + stages: AlphaPredictionSportsTimelineStageV5[]; } ⋮---- -export interface PwmMultiCoinsEarningPositionsV5 { - totalInvestmentUsd: string; - accumulateYieldUsd: string; - weightedAvgApr: string; - items: PwmMultiCoinsEarningPositionItemV5[]; +export interface AlphaPredictionSportsGroupStandingV5 { + rank: number; + teamName: string; + played: number; + won: number; + drawn: number; + lost: number; + goalsFor: number; + goalsAgainst: number; + goalDifference: number; + points: number; } ⋮---- -export interface PwmFixedYieldPositionItemV5 { - category: string; - productId: string; - coin: string; - currentAmount: string; - accumulateYield: string; - apr: string; - duration: number; - maturityTime: string; - autoReinvest: boolean; - positionId: string; - status?: string; +export interface AlphaPredictionSportsGroupMatchV5 { + matchId: string; + homeTeam: string; + awayTeam: string; + matchTime: number; + status: number; + homeScore: number; + awayScore: number; + eventId: string; } ⋮---- -export interface PwmFixedYieldPositionsV5 { - totalInvestmentUsd: string; - accumulateYieldUsd: string; - weightedAvgApr: string; - items: PwmFixedYieldPositionItemV5[]; +export interface AlphaPredictionSportsGroupV5 { + groupName: string; + standings: AlphaPredictionSportsGroupStandingV5[]; + matches: AlphaPredictionSportsGroupMatchV5[]; } ⋮---- -export interface PwmEquityFundPositionItemV5 { - category: string; - productId: string; - fundName: string; - coin: string; - tags: string[]; +export interface AlphaPredictionSportsGroupStageDetailV5 { + groups: AlphaPredictionSportsGroupV5[]; +} + +================ +File: src/types/response/v5-broker.ts +================ +interface EarningDetailV5 { + userId: string; + bizType: 'SPOT' | 'DERIVATIVES' | 'OPTIONS' | 'CONVERT' | 'FIAT_CONVERT'; + symbol: string; + coin: string; + earning: string; + markupEarning: string; + baseFeeEarning: string; + orderId: string; + execTime: string; +} +⋮---- +interface TotalEarningCategoryV5 { + coin: string; + earning: string; +} +⋮---- +export interface ExchangeBrokerEarningResultV5 { + totalEarningCat: { + spot: TotalEarningCategoryV5[]; + derivatives: TotalEarningCategoryV5[]; + options: TotalEarningCategoryV5[]; + convert: TotalEarningCategoryV5[]; + fiatConvert?: TotalEarningCategoryV5[]; + total: TotalEarningCategoryV5[]; + }; + details: EarningDetailV5[]; + nextPageCursor: string; +} +⋮---- +export interface ExchangeBrokerAccountInfoV5 { + subAcctQty: string; + maxSubAcctQty: string; + baseFeeRebateRate: { + spot: string; + derivatives: string; + }; + markupFeeRebateRate: { + spot: string; + derivatives: string; + convert: string; + }; + ts: string; +} +⋮---- +export interface ExchangeBrokerSubAccountDepositRecordV5 { + id: string; + subMemberId: string; + coin: string; + chain: string; + amount: string; + txID: string; + status: number; + toAddress: string; + tag: string; + depositFee: string; + successAt: string; + confirmations: string; + txIndex: string; + blockHash: string; + batchReleaseLimit: string; + depositType: string; +} +⋮---- +export interface BrokerVoucherSpecV5 { + id: string; + coin: string; + amountUnit: 'AWARD_AMOUNT_UNIT_USD' | 'AWARD_AMOUNT_UNIT_COIN'; + productLine: string; + subProductLine: string; + totalAmount: { + [key: string]: string; + }; + usedAmount: string; +} +⋮---- +export interface BrokerIssuedVoucherV5 { + accountId: string; + awardId: string; + specCode: string; + amount: string; + isClaimed: boolean; + startAt: string; + endAt: string; + effectiveAt: string; + ineffectiveAt: string; + usedAmount: string; +} +⋮---- +export interface BrokerRateLimitSetResultItemV5 { + uids: string; + bizType: string; + rate: number; + success: boolean; + msg: string; +} +⋮---- +export interface BrokerRateLimitCapItemV5 { + bizType: string; + totalRate: string; + ebCap: string; + uidCap: string; +} +⋮---- +export interface BrokerRateLimitAllItemV5 { + uids: string; + bizType: string; + rate: number; +} + +================ +File: src/types/response/v5-earn-liquidity-mining.ts +================ +export interface LiquidityMiningApyBreakdownV5 { + coin: string; + apy: string; +} +⋮---- +export interface LiquidityMiningProductV5 { + productId: string; + baseCoin: string; + quoteCoin: string; + status: 'Available' | 'NotAvailable' | string; + maxLeverage: number; + minInvestmentQuote: string; + minInvestmentBase: string; + maxInvestmentQuote: string; + maxInvestmentBase: string; + minWithdrawalAmount: string; + minReinvestAmount: string; + baseCoinPrecision: number; + quoteCoinPrecision: number; + yieldCoins: string[]; + apyE8: string; + apy7dE8: string; + poolLiquidityValue: string; + dailyYield: string; + slippageRateE8List: string[]; + apyBreakdown: LiquidityMiningApyBreakdownV5[]; + apy7dBreakdown: LiquidityMiningApyBreakdownV5[]; + slippage_levels?: string[]; +} +⋮---- +export interface LiquidityMiningProductResultV5 { + products: LiquidityMiningProductV5[]; +} +⋮---- +export interface ReinvestLiquidityMiningResultV5 { + orderId: string; + orderLinkId: string; +} + +================ +File: src/types/response/v5-earn-pwm.ts +================ +export interface PwmCoinAmountV5 { + coin: string; + amount: string; +} +⋮---- +export interface PwmMultiCoinsEarningPositionItemV5 { + category: string; + productId: string; + coin: string; + currentAmount: string; + accumulateYield: string; + apr: string; + positionId: string; + status?: string; +} +⋮---- +export interface PwmMultiCoinsEarningPositionsV5 { + totalInvestmentUsd: string; + accumulateYieldUsd: string; + weightedAvgApr: string; + items: PwmMultiCoinsEarningPositionItemV5[]; +} +⋮---- +export interface PwmFixedYieldPositionItemV5 { + category: string; + productId: string; + coin: string; + currentAmount: string; + accumulateYield: string; + apr: string; + duration: number; + maturityTime: string; + autoReinvest: boolean; + positionId: string; + status?: string; +} +⋮---- +export interface PwmFixedYieldPositionsV5 { + totalInvestmentUsd: string; + accumulateYieldUsd: string; + weightedAvgApr: string; + items: PwmFixedYieldPositionItemV5[]; +} +⋮---- +export interface PwmEquityFundPositionItemV5 { + category: string; + productId: string; + fundName: string; + coin: string; + tags: string[]; nav: string; userShares: string; shareValue: string; @@ -6383,95 +6763,22 @@ export interface PwmFundTransferRecordV5 { } ================ -File: src/types/response/v5-earn-token.ts +File: src/types/response/v5-rfq.ts ================ -/** - * Earn token product (e.g. BYUSDT) — /v5/earn/token/* - */ -⋮---- -export interface EarnTokenProductV5 { - productId: string; - coin: string; - mintFeeRateE8: string; - redeemFeeRateE8: string; - minInvestment: string; - userHolding: string; - leftQuota: string; - canMint: boolean; - savingsBalance: string; - aprE8: string; - bonusAprE8: string; - bonusMaxAmount: string; - baseCoinPrecision: number; - tokenPrecision: number; -} -⋮---- -export interface PlaceEarnTokenOrderResultV5 { - orderId: string; - orderLinkId: string; -} -⋮---- -export interface EarnTokenOrderV5 { - orderId: string; - orderLinkId: string; - orderType: 'Mint' | 'Redeem'; - fromCoin: string; - toCoin: string; - fromAmount: string; - toAmount: string; - serviceFee: string; - status: 'Success' | 'Processing' | 'Fail'; - createdTime: string; -} -⋮---- -export interface EarnTokenPositionV5 { - totalAmount: string; - totalYield: string; - yesterdayYield: string; - aprE8: number; - bonusAprE8: number; - bonusMaxAmount: string; - hasQuota: boolean; -} -⋮---- -export interface EarnTokenDailyYieldRecordV5 { - yield: string; - bonusYield: string; - status: 'Success' | 'Processing'; - createdTime: string; -} -⋮---- -export interface EarnTokenHourlyYieldRecordV5 { - effectiveAmount: string; - yield: string; - rewardType: 0 | 1; - aprE8: string; - hourlyDate: string; - createdTime: string; -} -⋮---- -export interface EarnTokenHistoryAprPointV5 { - timestamp: string; - aprE8: string; -} - -================ -File: src/types/response/v5-rfq.ts -================ -export interface RFQConfigV5 { - deskCode: string; // Own deskCode, unique identification code - maxLegs: number; // Maximum number of legs - maxLP: number; // Maximum number of LPs selected in inquiry form - maxActiveRfq: number; // Maximum number of unfinished inquiry orders allowed - minLimitQtySpotOrder: number; // Spot minimum order quantity multiplier - minLimitQtyContractOrder: number; // Contract minimum order quantity multiplier - minLimitQtyOptionOrder: number; // Option minimum order multiplier - strategyTypes: { - strategyName: string; // Policy name - }[]; - counterparties: { - strategyName: string; // Policy name - }[]; +export interface RFQConfigV5 { + deskCode: string; // Own deskCode, unique identification code + maxLegs: number; // Maximum number of legs + maxLP: number; // Maximum number of LPs selected in inquiry form + maxActiveRfq: number; // Maximum number of unfinished inquiry orders allowed + minLimitQtySpotOrder: number; // Spot minimum order quantity multiplier + minLimitQtyContractOrder: number; // Contract minimum order quantity multiplier + minLimitQtyOptionOrder: number; // Option minimum order multiplier + strategyTypes: { + strategyName: string; // Policy name + }[]; + counterparties: { + strategyName: string; // Policy name + }[]; } ⋮---- deskCode: string; // Own deskCode, unique identification code @@ -6945,176 +7252,6 @@ export interface RWANavChartResultV5 { list: RWANavChartPointV5[]; } -================ -File: src/types/response/v5-spreadtrading.ts -================ -export interface SpreadInstrumentInfoV5 { - symbol: string; - contractType: 'FundingRateArb' | 'CarryTrade' | 'FutureSpread' | 'PerpBasis'; - status: 'Trading' | 'Settling'; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - tickSize: string; - minPrice: string; - maxPrice: string; - lotSize: string; - minSize: string; - maxSize: string; - launchTime: string; - deliveryTime: string; - legs: { - symbol: string; - contractType: 'LinearPerpetual' | 'LinearFutures' | 'Spot'; - }[]; -} -⋮---- -export interface SpreadOrderbookResponseV5 { - s: string; // Symbol - b: [string, string][]; // Bids array [price, size] - a: [string, string][]; // Asks array [price, size] - u: number; // Update ID - ts: number; // Timestamp - seq: number; // Sequence - cts: number; // Cross timestamp -} -⋮---- -s: string; // Symbol -b: [string, string][]; // Bids array [price, size] -a: [string, string][]; // Asks array [price, size] -u: number; // Update ID -ts: number; // Timestamp -seq: number; // Sequence -cts: number; // Cross timestamp -⋮---- -export interface SpreadTickerV5 { - symbol: string; // Spread combination symbol name - bidPrice: string; // Bid 1 price - bidSize: string; // Bid 1 size - askPrice: string; // Ask 1 price - askSize: string; // Ask 1 size - lastPrice: string; // Last trade price - highPrice24h: string; // The highest price in the last 24 hours - lowPrice24h: string; // The lowest price in the last 24 hours - prevPrice24h: string; // Price 24 hours ago - volume24h: string; // Volume for 24h -} -⋮---- -symbol: string; // Spread combination symbol name -bidPrice: string; // Bid 1 price -bidSize: string; // Bid 1 size -askPrice: string; // Ask 1 price -askSize: string; // Ask 1 size -lastPrice: string; // Last trade price -highPrice24h: string; // The highest price in the last 24 hours -lowPrice24h: string; // The lowest price in the last 24 hours -prevPrice24h: string; // Price 24 hours ago -volume24h: string; // Volume for 24h -⋮---- -export interface SpreadRecentTradeV5 { - execId: string; // Execution ID - symbol: string; // Spread combination symbol name - price: string; // Trade price - size: string; // Trade size - side: 'Buy' | 'Sell'; // Side of taker - time: string; // Trade time (ms) - seq?: string; -} -⋮---- -execId: string; // Execution ID -symbol: string; // Spread combination symbol name -price: string; // Trade price -size: string; // Trade size -side: 'Buy' | 'Sell'; // Side of taker -time: string; // Trade time (ms) -⋮---- -export interface SpreadOpenOrderV5 { - symbol: string; - baseCoin: string; - orderType: 'Market' | 'Limit'; - orderLinkId: string; - side: 'Buy' | 'Sell'; - timeInForce: 'GTC' | 'FOK' | 'IOC' | 'PostOnly'; - orderId: string; - leavesQty: string; - orderStatus: 'New' | 'PartiallyFilled'; - cumExecQty: string; - price: string; - qty: string; - createdTime: string; - updatedTime: string; -} -⋮---- -export interface SpreadOrderHistoryV5 { - symbol: string; - orderType: 'Market' | 'Limit'; - orderLinkId: string; - orderId: string; - contractType: 'FundingRateArb' | 'CarryTrade' | 'FutureSpread' | 'PerpBasis'; - orderStatus: 'Rejected' | 'Cancelled' | 'Filled'; - price: string; - orderQty: string; - timeInForce: 'GTC' | 'FOK' | 'IOC' | 'PostOnly'; - baseCoin: string; - createdAt: string; - updatedAt: string; - side: 'Buy' | 'Sell'; - leavesQty: string; - settleCoin: string; - cumExecQty: string; - qty: string; - leg1Symbol: string; - leg1ProdType: 'Futures' | 'Spot'; - leg1OrderId: string; - leg1Side: string; - leg2ProdType: 'Futures' | 'Spot'; - leg2OrderId: string; - leg2Symbol: string; - leg2Side: string; - cxlRejReason: string; - cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee -} -⋮---- -cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee -⋮---- -export interface SpreadTradeLegV5 { - symbol: string; - side: 'Buy' | 'Sell'; - execPrice: string; - execTime: string; - execValue: string; - execType: string; - category: 'linear' | 'spot'; - execQty: string; - execFee: string; - feeCurrency: string; // Trading fee currency - execId: string; -} -⋮---- -feeCurrency: string; // Trading fee currency -⋮---- -export interface SpreadTradeV5 { - symbol: string; - orderLinkId: string; - side: 'Buy' | 'Sell'; - orderId: string; - execPrice: string; - execTime: string; - execType: 'Trade'; - execQty: string; - execId: string; - legs: SpreadTradeLegV5[]; - extraFees: string; -} -⋮---- -/** GET /v5/spread/max-qty */ -export interface SpreadMaxQtyResultV5 { - /** Maximum order quantity (available balance for the spread order). */ - ab: string; -} -⋮---- -/** Maximum order quantity (available balance for the spread order). */ - ================ File: src/types/response/v5-strategy.ts ================ @@ -7690,481 +7827,802 @@ verbose: true, // report individual test // watchman: true, ================ -File: src/types/request/v5-earn-liquidity-mining.ts +File: src/types/request/v5-account.ts ================ -/** - * GET /v5/earn/liquidity-mining/product (public, 50 req/s per IP) - */ -export interface GetLiquidityMiningProductParamsV5 { - baseCoin?: string; - quoteCoin?: string; -} +import { + AccountTypeV5, + CategoryV5, + InstrumentSymbolTypeV5, + TransactionTypeV5, +} from '../shared-v5'; ⋮---- -export interface ReinvestLiquidityMiningParamsV5 { - productId: string; - orderLinkId: string; - positionId: string; - leverage?: string; +export interface GetWalletBalanceParamsV5 { + accountType: AccountTypeV5; + coin?: string; } - -================ -File: src/types/request/v5-event.ts -================ -export interface GetEventInstrumentsInfoParamsV5 { - symbol?: string; - status?: 'PreLaunch' | 'Trading' | 'Delivering' | 'Closed'; +⋮---- +export interface GetBorrowHistoryParamsV5 { + currency?: string; + startTime?: number; + endTime?: number; limit?: number; cursor?: string; } ⋮---- -export interface GetEventOrderbookParamsV5 { - symbol: string; +export interface GetFeeRateParamsV5 { + category: CategoryV5; + symbol?: string; + baseCoin?: string; } ⋮---- -export interface GetEventOrderHistoryParamsV5 { - symbol?: string; - orderId?: string; - orderLinkId?: string; +export interface GetTransactionLogParamsV5 { + accountType?: AccountTypeV5; + category?: CategoryV5; + currency?: string; + baseCoin?: string; + type?: TransactionTypeV5; + /** + * Transaction sub type, "movePosition", used to filter trans logs of Move Position only + */ + transSubType?: string; startTime?: number; endTime?: number; limit?: number; cursor?: string; } ⋮---- -export interface GetEventActiveOrdersParamsV5 { - symbol?: string; - orderId?: string; - orderLinkId?: string; +/** + * Transaction sub type, "movePosition", used to filter trans logs of Move Position only + */ +⋮---- +export interface MMPModifyParamsV5 { + baseCoin: string; + window: string; + frozenPeriod: string; + qtyLimit: string; + deltaLimit: string; + vegaLimit?: string; +} +⋮---- +export interface RepayLiabilityParamsV5 { + coin?: string; +} +⋮---- +export interface SetCollateralCoinParamsV5 { + coin: string; + collateralSwitch: 'ON' | 'OFF'; +} +⋮---- +export interface GetClassicTransactionLogsParamsV5 { + currency?: string; + baseCoin?: string; + type?: string; + startTime?: number; + endTime?: number; limit?: number; cursor?: string; } ⋮---- -export interface GetEventPositionInfoParamsV5 { +export interface SetLimitPriceActionParamsV5 { + category: CategoryV5; + modifyEnable: boolean; +} +⋮---- +/** + * Set Delta Neutral Mode. POST /v5/account/set-delta-mode + * 1: enable, 0: disable. + */ +export interface SetDeltaNeutralModeParamsV5 { + deltaEnable: '1' | '0'; +} +⋮---- +export interface GetAccountInstrumentsInfoParamsV5 { + category: 'spot' | 'linear' | 'inverse'; symbol?: string; - baseCoin?: string; - settleCoin?: string; + /** Filter by `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ + symbolType?: InstrumentSymbolTypeV5; limit?: number; cursor?: string; } ⋮---- -export interface GetEventTradeHistoryParamsV5 { +/** Filter by `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ +⋮---- +/** GET /v5/account/pay-info */ +export interface GetPayInfoParamsV5 { + coin?: string; +} +⋮---- +/** GET /v5/account/trade-info-for-analysis */ +export interface GetTradeInfoForAnalysisParamsV5 { symbol: string; - orderId?: string; - orderLinkId?: string; startTime?: number; endTime?: number; +} +⋮---- +export interface ManualRepayParamsV5 { + coin?: string; + amount?: string; + /** + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. + * If neither `coin` nor `amount` is set, this must be ALL (repay all liabilities) or the request is rejected. + */ + repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; +} +⋮---- +/** + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. + * If neither `coin` nor `amount` is set, this must be ALL (repay all liabilities) or the request is rejected. + */ + +================ +File: src/types/request/v5-asset.ts +================ +import { AccountTypeV5, CategoryV5 } from '../shared-v5'; +⋮---- +export interface GetCoinExchangeRecordParamsV5 { + fromCoin?: string; + toCoin?: string; limit?: number; cursor?: string; } ⋮---- -export interface GetEventSettlementRecordsParamsV5 { - symbol: string; - orderId?: string; +export interface GetDeliveryRecordParamsV5 { + category: CategoryV5; + symbol?: string; startTime?: number; endTime?: number; + expDate?: string; limit?: number; cursor?: string; } ⋮---- -export interface SubmitEventQuoteParamsV5 { - symbol: string; - orderLinkId: string; - grossPayoutRatio: string; - amount: string; - /** Automatically cancel after this many milliseconds. 0 uses quoteMaxValidMs; non-zero values must not exceed quoteMaxValidMs */ - cancelAfterMs?: number; +export interface GetSettlementRecordParamsV5 { + category: CategoryV5; + symbol?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -/** Automatically cancel after this many milliseconds. 0 uses quoteMaxValidMs; non-zero values must not exceed quoteMaxValidMs */ -⋮---- -export interface CancelEventQuoteParamsV5 { - orderLinkId?: string; - orderId?: string; +export interface GetAssetInfoParamsV5 { + accountType: AccountTypeV5; + coin?: string; } ⋮---- -export interface CancelAllEventQuotesParamsV5 { - symbol: string; -} - -================ -File: src/types/request/v5-p2p-trading.ts -================ -export interface GetP2PAccountCoinsBalanceParamsV5 { +export interface GetAllCoinsBalanceParamsV5 { memberId?: string; - accountType: string; + accountType: AccountTypeV5; coin?: string; - withBonus?: 0 | 1; + withBonus?: number; } ⋮---- -export interface GetP2POnlineAdsParamsV5 { - tokenId: string; - currencyId: string; - side: '0' | '1'; // 0: buy; 1: sell - page?: string; - size?: string; +export interface GetAccountCoinBalanceParamsV5 { + memberId?: string; + toMemberId?: string; + accountType: AccountTypeV5; + coin: string; + toAccountType?: AccountTypeV5; + withBonus?: number; + withTransferSafeAmount?: 0 | 1; + withLtvTransferSafeAmount?: 0 | 1; } ⋮---- -side: '0' | '1'; // 0: buy; 1: sell -⋮---- -export interface P2PTradingPreferenceSetV5 { - hasUnPostAd?: 0 | 1; - isKyc?: 0 | 1; - isEmail?: 0 | 1; - isMobile?: 0 | 1; - hasRegisterTime?: 0 | 1; - registerTimeThreshold?: number; - orderFinishNumberDay30?: number; - completeRateDay30?: string; - nationalLimit?: string; - hasOrderFinishNumberDay30?: 0 | 1; - hasCompleteRateDay30?: 0 | 1; - hasNationalLimit?: 0 | 1; +export interface GetInternalTransferParamsV5 { + transferId?: string; + coin?: string; + status?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface CreateP2PAdParamsV5 { - tokenId: string; - currencyId: string; - side: '0' | '1'; // 0: buy; 1: sell - priceType: '0' | '1'; // 0: fixed rate; 1: floating rate - premium: string; - price: string; - minAmount: string; - maxAmount: string; - remark: string; - tradingPreferenceSet: P2PTradingPreferenceSetV5; - paymentIds: string[]; - quantity: string; - paymentPeriod: string; - itemType: 'ORIGIN' | 'BULK'; +export interface UniversalTransferParamsV5 { + transferId: string; + coin: string; + amount: string; + fromMemberId: number; + toMemberId: number; + fromAccountType: AccountTypeV5; + toAccountType: AccountTypeV5; } ⋮---- -side: '0' | '1'; // 0: buy; 1: sell -priceType: '0' | '1'; // 0: fixed rate; 1: floating rate -⋮---- -export interface UpdateP2PAdParamsV5 { - id: string; - priceType: '0' | '1'; // 0: fixed rate; 1: floating rate - premium: string; - price: string; - minAmount: string; - maxAmount: string; - remark: string; - tradingPreferenceSet: P2PTradingPreferenceSetV5; - paymentIds: string[]; - actionType: 'MODIFY' | 'ACTIVE'; // MODIFY: modify adv; ACTIVE: reonline adv - quantity: string; - paymentPeriod: string; - itemType?: 'ORIGIN' | 'BULK'; - subsidyAd?: boolean; - securityRiskToken?: string; +export interface GetUniversalTransferRecordsParamsV5 { + transferId?: string; + coin?: string; + status?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; + fromMemberId?: string; + toMemberId?: string; } ⋮---- -priceType: '0' | '1'; // 0: fixed rate; 1: floating rate +export interface GetAllowedDepositCoinInfoParamsV5 { + coin?: string; + chain?: string; + limit?: number; + cursor?: string; +} ⋮---- -actionType: 'MODIFY' | 'ACTIVE'; // MODIFY: modify adv; ACTIVE: reonline adv -⋮---- -export interface GetP2PPersonalAdsParamsV5 { - itemId?: string; - status?: '1' | '2'; // 1: Sold Out; 2: Available - side?: '0' | '1'; // 0: buy; 1: sell - tokenId?: string; - page?: string; - size?: string; - currencyId?: string; +export interface GetDepositRecordParamsV5 { + id?: string; + txID?: string; + coin?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -status?: '1' | '2'; // 1: Sold Out; 2: Available -side?: '0' | '1'; // 0: buy; 1: sell +export interface GetSubAccountDepositRecordParamsV5 { + id?: string; + txID?: string; + subMemberId: string; + coin?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -export interface GetP2POrdersParamsV5 { - status?: number; - beginTime?: string; - endTime?: string; - tokenId?: string; - side?: number[]; - page: number; - size: number; +export interface GetInternalDepositRecordParamsV5 { + txID?: string; + startTime?: number; + endTime?: number; + coin?: string; + cursor?: string; + limit?: number; } ⋮---- -export interface GetP2PPendingOrdersParamsV5 { - status?: number; - beginTime?: string; - endTime?: string; - tokenId?: string; - side?: number[]; - page: number; - size: number; +export interface GetWithdrawalRecordsParamsV5 { + withdrawID?: string; + txID?: string; + coin?: string; + withdrawType?: number; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface MarkP2POrderAsPaidParamsV5 { - orderId: string; - paymentType: string; - paymentId: string; +export interface GetWithdrawalAddressListParamsV5 { + coin?: string; + chain?: string; + addressType?: 0 | 1 | 2; + limit?: number; + cursor?: string; } ⋮---- -export type P2PSellerCancelExamineResultV5 = 'PASS' | 'REJECT'; +export interface SubmitDepositOriginatorInfoParamsV5 { + depositId: number; + subAccountId?: number; + /** Travel Rule questionnaire JSON string. See Questionnaire docs. */ + questionnaire: string; +} ⋮---- -export type P2PSellerCancelRejectReasonV5 = - | 'buyerRefuseOrderCancelReason_haveMadePayment' - | 'buyerRefuseOrderCancelReason_haveNotReceivedFullRefund' - | 'buyerRefuseOrderCancelReason_others'; +/** Travel Rule questionnaire JSON string. See Questionnaire docs. */ ⋮---- -export interface ReviewP2PSellerCancelOrderApplyParamsV5 { - orderId: string; - examineResult: P2PSellerCancelExamineResultV5; - /** Required when examineResult is REJECT. */ - rejectReason?: P2PSellerCancelRejectReasonV5; - /** Comma-separated proof URLs. Required when examineResult is REJECT. */ - rejectProofs?: string; - rejectRemark?: string; +export interface WithdrawParamsV5 { + coin: string; + /** + * When forceChain is 0 or 1, required. When forceChain is 2 (Bybit UID withdraw), may be null/omitted. + */ + chain?: string; + address: string; + tag?: string; + amount: string; + timestamp: number; + forceChain?: number; + /** + * FUND, UTA, or EARN; or comma combo e.g. FUND,UTA,EARN (funding first, then UTA and Earn for remainder). + * SPOT is legacy if still supported for older integrations. + */ + accountType: string; + feeType?: 0 | 1; + requestId?: string; + /** + * Required for Bybit Turkey (TR) site users when creating a withdrawal. Omitted for other regions unless the API requires it. + */ + transactionPurpose?: string; + /** + * Travel Rule questionnaire JSON string (max 16384 bytes). Takes precedence over `beneficiary` / `transactionPurpose` when both are set. + */ + questionnaire?: string; + beneficiary?: { + vaspEntityId?: string; + beneficiaryName?: string; + beneficiaryLegalType?: string; + beneficiaryWalletType?: string; + beneficiaryUnhostedWalletType?: string; + beneficiaryPoiNumber?: string; + beneficiaryPoiType?: string; + beneficiaryPoiIssuingCountry?: string; + beneficiaryPoiExpiredDate?: string; + }; } ⋮---- -/** Required when examineResult is REJECT. */ +/** + * When forceChain is 0 or 1, required. When forceChain is 2 (Bybit UID withdraw), may be null/omitted. + */ ⋮---- -/** Comma-separated proof URLs. Required when examineResult is REJECT. */ +/** + * FUND, UTA, or EARN; or comma combo e.g. FUND,UTA,EARN (funding first, then UTA and Earn for remainder). + * SPOT is legacy if still supported for older integrations. + */ ⋮---- -export interface SendP2POrderMessageParamsV5 { - message: string; - contentType: string; - orderId: string; - msgUuid?: string; - fileName?: string; -} +/** + * Required for Bybit Turkey (TR) site users when creating a withdrawal. Omitted for other regions unless the API requires it. + */ ⋮---- -export interface GetP2POrderMessagesParamsV5 { - orderId: string; - currentPage?: string; - size: string; +/** + * Travel Rule questionnaire JSON string (max 16384 bytes). Takes precedence over `beneficiary` / `transactionPurpose` when both are set. + */ +⋮---- +export interface ConvertCoinsParamsV5 { + coin?: string; + side?: number; + accountType: + | 'eb_convert_funding' + | 'eb_convert_uta' + | 'eb_convert_spot' + | 'eb_convert_contract' + | 'eb_convert_inverse'; } ⋮---- -export interface GetP2PCounterpartyUserInfoParamsV5 { - originalUid: string; - orderId: string; +export interface RequestConvertQuoteParamsV5 { + fromCoin: string; + toCoin: string; + fromCoinType?: string; + toCoinType?: string; + requestCoin: string; + requestAmount: string; + accountType: + | 'eb_convert_funding' + | 'eb_convert_uta' + | 'eb_convert_spot' + | 'eb_convert_contract' + | 'eb_convert_inverse'; + requestId?: string; } ⋮---- -export interface GetP2PChatSessionsParamsV5 { - /** Pagination cursor. Pass 0 for the first page. */ - lastId: number; - size: number; - /** 0: unread; 1: read; 2: all. */ - readStatus: 0 | 1 | 2; - type?: 'GROUP' | 'SINGLE'; +export interface GetConvertHistoryParamsV5 { + accountType?: string; + index?: number; + limit?: number; } ⋮---- -/** Pagination cursor. Pass 0 for the first page. */ +export interface GetSmallBalanceListParamsV5 { + accountType: 'eb_convert_uta'; // Wallet type, only supports Unified wallet + fromCoin?: string; // Source currency +} ⋮---- -/** 0: unread; 1: read; 2: all. */ +accountType: 'eb_convert_uta'; // Wallet type, only supports Unified wallet +fromCoin?: string; // Source currency ⋮---- -export interface GetP2PChatSessionIdParamsV5 { - /** Counterparty mask ID from the order detail's targetUserMaskId. */ - userMaskId: string; +export interface GetFiatTradingPairListParamsV5 { + side?: 0 | 1; // 0: buy (buy crypto, sell fiat), 1: sell (sell crypto, buy fiat) } ⋮---- -/** Counterparty mask ID from the order detail's targetUserMaskId. */ +side?: 0 | 1; // 0: buy (buy crypto, sell fiat), 1: sell (sell crypto, buy fiat) ⋮---- -export interface SendP2PChatMessageParamsV5 { - /** Message content, up to 1000 characters. Use the uploaded URL for files. */ - message: string; - contentType: 'str' | 'pic' | 'pdf' | 'video'; - /** AES encrypted session ID. */ - sessionId: string; - orderId: string; +/** Funding Account Transaction History. Interval createTimeFrom-createTimeTo max 7 days. */ +export interface GetFundingAccountTransactionHistoryParamsV5 { + createTimeFrom?: string; + createTimeTo?: string; + limit?: string; + cursor?: string; } ⋮---- -/** Message content, up to 1000 characters. Use the uploaded URL for files. */ +/** Asset Overview. memberId required when querying sub account via master API key. */ +export interface GetAssetOverviewParamsV5 { + memberId?: string; + /** Fiat currency for valuation; defaults to USD if omitted. */ + valuationCurrency?: string; + /** Account type filter; returns all if omitted. */ + accountType?: string; +} ⋮---- -/** AES encrypted session ID. */ +/** Fiat currency for valuation; defaults to USD if omitted. */ ⋮---- -export interface GetP2PChatMessagesParamsV5 { - /** Pagination cursor. Pass 0 to start from the latest message. */ - lastId: number; - /** Page size, up to 30. */ - limit: number; - /** AES encrypted session ID. */ - sessionId: string; -} +/** Account type filter; returns all if omitted. */ ⋮---- -/** Pagination cursor. Pass 0 to start from the latest message. */ +/** GET /v5/asset/portfolio-margin */ +export interface GetPortfolioMarginInfoParamsV5 { + baseCoin?: string; +} ⋮---- -/** Page size, up to 30. */ +/** GET /v5/asset/total-members-assets */ +export interface GetTotalMembersAssetsParamsV5 { + /** If omitted, defaults to BTC. Total is quoted in this coin. */ + coin?: string; +} ⋮---- -/** AES encrypted session ID. */ +/** If omitted, defaults to BTC. Total is quoted in this coin. */ ================ -File: src/types/request/v5-spreadtrading.ts +File: src/types/request/v5-event.ts ================ -export interface GetSpreadInstrumentsInfoParamsV5 { +export interface GetEventInstrumentsInfoParamsV5 { symbol?: string; - baseCoin?: string; + status?: 'PreLaunch' | 'Trading' | 'Delivering' | 'Closed'; limit?: number; cursor?: string; } ⋮---- -/** GET /v5/spread/max-qty */ -export interface GetSpreadMaxQtyParamsV5 { - symbol: string; - /** 1: Buy, 2: Sell */ - side: '1' | '2'; - orderPrice: string; -} -⋮---- -/** 1: Buy, 2: Sell */ -⋮---- -export interface SubmitSpreadOrderParamsV5 { +export interface GetEventOrderbookParamsV5 { symbol: string; - side: 'Buy' | 'Sell'; - orderType: 'Limit' | 'Market'; - qty: string; - price: string; - orderLinkId: string; - timeInForce: 'IOC' | 'FOK' | 'GTC' | 'PostOnly'; } ⋮---- -export interface AmendSpreadOrderParamsV5 { - symbol: string; +export interface GetEventOrderHistoryParamsV5 { + symbol?: string; orderId?: string; orderLinkId?: string; - qty?: string; - price?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface GetSpreadOpenOrdersParamsV5 { +export interface GetEventActiveOrdersParamsV5 { symbol?: string; - baseCoin?: string; orderId?: string; orderLinkId?: string; limit?: number; cursor?: string; } -export interface GetSpreadOrderHistoryParamsV5 { +⋮---- +export interface GetEventPositionInfoParamsV5 { symbol?: string; baseCoin?: string; + settleCoin?: string; + limit?: number; + cursor?: string; +} +⋮---- +export interface GetEventTradeHistoryParamsV5 { + symbol: string; orderId?: string; orderLinkId?: string; - /** - * Filter by order status. Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. - * @see https://t.me/Bybit_API_Announcements/464 - */ - orderStatus?: 'Rejected' | 'Cancelled' | 'Filled'; startTime?: number; endTime?: number; limit?: number; cursor?: string; } ⋮---- -/** - * Filter by order status. Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. - * @see https://t.me/Bybit_API_Announcements/464 - */ -⋮---- -export interface GetSpreadTradeHistoryParamsV5 { - symbol?: string; +export interface GetEventSettlementRecordsParamsV5 { + symbol: string; orderId?: string; - orderLinkId?: string; startTime?: number; endTime?: number; limit?: number; cursor?: string; } - -================ -File: src/types/request/v5-strategy.ts -================ -import { - OrderSideV5, - PositionIdx, - PovModeV5, - StrategyCategoryV5, - StrategyPreferV5, - StrategyTypeV5, -} from '../shared-v5'; ⋮---- -/** POST /v5/strategy/create */ -export interface CreateStrategyOrderParamsV5 { - category: StrategyCategoryV5; +export interface SubmitEventQuoteParamsV5 { symbol: string; - side: OrderSideV5; - strategyType: StrategyTypeV5; - /** Total order quantity (coin). Either size or positionValue is required */ - size?: string; - /** Total order quantity (value). Either size or positionValue is required */ - positionValue?: string; - reduceOnly?: boolean; - positionIdx?: PositionIdx; - /** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ - leverageType?: 0 | 1; - /** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ - duration?: number; - /** TWAP / POV: sub-order placement interval (seconds) */ - interval?: 5 | 10 | 15 | 30 | 60 | 120; - /** TWAP: randomize each sub-order quantity by ±20% */ - isRandom?: boolean; - /** Advanced: activate when market price reaches this value */ - triggerPrice?: string; - /** Advanced: terminate when last traded price reaches this value */ - maxChasePrice?: string; - /** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ - chaseDistance?: string; - /** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ - chasePercentE4?: number; - /** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ - chasePrice?: string; - strategyPrefer?: StrategyPreferV5; - limitPrice?: string; - strategySl?: string; - strategyTp?: string; - /** Iceberg: 0 = taker allowed, 1 = post-only */ - postOnly?: 0 | 1; - isRebalance?: boolean; - /** 1: market, 2: limit */ - orderType?: 1 | 2; - orderPriceOffset?: string; - strategyName?: string; - /** POV execution mode */ - mode?: PovModeV5; - /** POV participation rate */ - participationRate?: string; - /** POV: historical traded volume window (seconds), range [60, 14400] */ - referenceWindow?: string; - /** POV: book depth reference levels [1, 10] */ - depthReference?: string; + orderLinkId: string; + grossPayoutRatio: string; + amount: string; + /** Automatically cancel after this many milliseconds. 0 uses quoteMaxValidMs; non-zero values must not exceed quoteMaxValidMs */ + cancelAfterMs?: number; } ⋮---- -/** Total order quantity (coin). Either size or positionValue is required */ +/** Automatically cancel after this many milliseconds. 0 uses quoteMaxValidMs; non-zero values must not exceed quoteMaxValidMs */ ⋮---- -/** Total order quantity (value). Either size or positionValue is required */ +export interface CancelEventQuoteParamsV5 { + orderLinkId?: string; + orderId?: string; +} ⋮---- -/** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ +export interface CancelAllEventQuotesParamsV5 { + symbol: string; +} + +================ +File: src/types/request/v5-p2p-trading.ts +================ +export interface GetP2PAccountCoinsBalanceParamsV5 { + memberId?: string; + accountType: string; + coin?: string; + withBonus?: 0 | 1; +} ⋮---- -/** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ +export interface GetP2POnlineAdsParamsV5 { + tokenId: string; + currencyId: string; + side: '0' | '1'; // 0: buy; 1: sell + page?: string; + size?: string; +} ⋮---- -/** TWAP / POV: sub-order placement interval (seconds) */ +side: '0' | '1'; // 0: buy; 1: sell ⋮---- -/** TWAP: randomize each sub-order quantity by ±20% */ +export interface P2PTradingPreferenceSetV5 { + hasUnPostAd?: 0 | 1; + isKyc?: 0 | 1; + isEmail?: 0 | 1; + isMobile?: 0 | 1; + hasRegisterTime?: 0 | 1; + registerTimeThreshold?: number; + orderFinishNumberDay30?: number; + completeRateDay30?: string; + nationalLimit?: string; + hasOrderFinishNumberDay30?: 0 | 1; + hasCompleteRateDay30?: 0 | 1; + hasNationalLimit?: 0 | 1; +} ⋮---- -/** Advanced: activate when market price reaches this value */ +export interface CreateP2PAdParamsV5 { + tokenId: string; + currencyId: string; + side: '0' | '1'; // 0: buy; 1: sell + priceType: '0' | '1'; // 0: fixed rate; 1: floating rate + premium: string; + price: string; + minAmount: string; + maxAmount: string; + remark: string; + tradingPreferenceSet: P2PTradingPreferenceSetV5; + paymentIds: string[]; + quantity: string; + paymentPeriod: string; + itemType: 'ORIGIN' | 'BULK'; +} ⋮---- -/** Advanced: terminate when last traded price reaches this value */ +side: '0' | '1'; // 0: buy; 1: sell +priceType: '0' | '1'; // 0: fixed rate; 1: floating rate ⋮---- -/** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ +export interface UpdateP2PAdParamsV5 { + id: string; + priceType: '0' | '1'; // 0: fixed rate; 1: floating rate + premium: string; + price: string; + minAmount: string; + maxAmount: string; + remark: string; + tradingPreferenceSet: P2PTradingPreferenceSetV5; + paymentIds: string[]; + actionType: 'MODIFY' | 'ACTIVE'; // MODIFY: modify adv; ACTIVE: reonline adv + quantity: string; + paymentPeriod: string; + itemType?: 'ORIGIN' | 'BULK'; + subsidyAd?: boolean; + securityRiskToken?: string; +} ⋮---- -/** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ +priceType: '0' | '1'; // 0: fixed rate; 1: floating rate ⋮---- -/** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ +actionType: 'MODIFY' | 'ACTIVE'; // MODIFY: modify adv; ACTIVE: reonline adv ⋮---- -/** Iceberg: 0 = taker allowed, 1 = post-only */ +export interface GetP2PPersonalAdsParamsV5 { + itemId?: string; + status?: '1' | '2'; // 1: Sold Out; 2: Available + side?: '0' | '1'; // 0: buy; 1: sell + tokenId?: string; + page?: string; + size?: string; + currencyId?: string; +} ⋮---- -/** 1: market, 2: limit */ +status?: '1' | '2'; // 1: Sold Out; 2: Available +side?: '0' | '1'; // 0: buy; 1: sell ⋮---- -/** POV execution mode */ +export interface GetP2POrdersParamsV5 { + status?: number; + beginTime?: string; + endTime?: string; + tokenId?: string; + side?: number[]; + page: number; + size: number; +} ⋮---- -/** POV participation rate */ +export interface GetP2PPendingOrdersParamsV5 { + status?: number; + beginTime?: string; + endTime?: string; + tokenId?: string; + side?: number[]; + page: number; + size: number; +} ⋮---- -/** POV: historical traded volume window (seconds), range [60, 14400] */ +export interface MarkP2POrderAsPaidParamsV5 { + orderId: string; + paymentType: string; + paymentId: string; +} ⋮---- -/** POV: book depth reference levels [1, 10] */ +export type P2PSellerCancelExamineResultV5 = 'PASS' | 'REJECT'; ⋮---- -/** +export type P2PSellerCancelRejectReasonV5 = + | 'buyerRefuseOrderCancelReason_haveMadePayment' + | 'buyerRefuseOrderCancelReason_haveNotReceivedFullRefund' + | 'buyerRefuseOrderCancelReason_others'; +⋮---- +export interface ReviewP2PSellerCancelOrderApplyParamsV5 { + orderId: string; + examineResult: P2PSellerCancelExamineResultV5; + /** Required when examineResult is REJECT. */ + rejectReason?: P2PSellerCancelRejectReasonV5; + /** Comma-separated proof URLs. Required when examineResult is REJECT. */ + rejectProofs?: string; + rejectRemark?: string; +} +⋮---- +/** Required when examineResult is REJECT. */ +⋮---- +/** Comma-separated proof URLs. Required when examineResult is REJECT. */ +⋮---- +export interface SendP2POrderMessageParamsV5 { + message: string; + contentType: string; + orderId: string; + msgUuid?: string; + fileName?: string; +} +⋮---- +export interface GetP2POrderMessagesParamsV5 { + orderId: string; + currentPage?: string; + size: string; +} +⋮---- +export interface GetP2PCounterpartyUserInfoParamsV5 { + originalUid: string; + orderId: string; +} +⋮---- +export interface GetP2PChatSessionsParamsV5 { + /** Pagination cursor. Pass 0 for the first page. */ + lastId: number; + size: number; + /** 0: unread; 1: read; 2: all. */ + readStatus: 0 | 1 | 2; + type?: 'GROUP' | 'SINGLE'; +} +⋮---- +/** Pagination cursor. Pass 0 for the first page. */ +⋮---- +/** 0: unread; 1: read; 2: all. */ +⋮---- +export interface GetP2PChatSessionIdParamsV5 { + /** Counterparty mask ID from the order detail's targetUserMaskId. */ + userMaskId: string; +} +⋮---- +/** Counterparty mask ID from the order detail's targetUserMaskId. */ +⋮---- +export interface SendP2PChatMessageParamsV5 { + /** Message content, up to 1000 characters. Use the uploaded URL for files. */ + message: string; + contentType: 'str' | 'pic' | 'pdf' | 'video'; + /** AES encrypted session ID. */ + sessionId: string; + orderId: string; +} +⋮---- +/** Message content, up to 1000 characters. Use the uploaded URL for files. */ +⋮---- +/** AES encrypted session ID. */ +⋮---- +export interface GetP2PChatMessagesParamsV5 { + /** Pagination cursor. Pass 0 to start from the latest message. */ + lastId: number; + /** Page size, up to 30. */ + limit: number; + /** AES encrypted session ID. */ + sessionId: string; +} +⋮---- +/** Pagination cursor. Pass 0 to start from the latest message. */ +⋮---- +/** Page size, up to 30. */ +⋮---- +/** AES encrypted session ID. */ + +================ +File: src/types/request/v5-strategy.ts +================ +import { + OrderSideV5, + PositionIdx, + PovModeV5, + StrategyCategoryV5, + StrategyPreferV5, + StrategyTypeV5, +} from '../shared-v5'; +⋮---- +/** POST /v5/strategy/create */ +export interface CreateStrategyOrderParamsV5 { + category: StrategyCategoryV5; + symbol: string; + side: OrderSideV5; + strategyType: StrategyTypeV5; + /** Total order quantity (coin). Either size or positionValue is required */ + size?: string; + /** Total order quantity (value). Either size or positionValue is required */ + positionValue?: string; + reduceOnly?: boolean; + positionIdx?: PositionIdx; + /** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ + leverageType?: 0 | 1; + /** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ + duration?: number; + /** TWAP / POV: sub-order placement interval (seconds) */ + interval?: 5 | 10 | 15 | 30 | 60 | 120; + /** TWAP: randomize each sub-order quantity by ±20% */ + isRandom?: boolean; + /** Advanced: activate when market price reaches this value */ + triggerPrice?: string; + /** Advanced: terminate when last traded price reaches this value */ + maxChasePrice?: string; + /** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ + chaseDistance?: string; + /** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ + chasePercentE4?: number; + /** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ + chasePrice?: string; + strategyPrefer?: StrategyPreferV5; + limitPrice?: string; + strategySl?: string; + strategyTp?: string; + /** Iceberg: 0 = taker allowed, 1 = post-only */ + postOnly?: 0 | 1; + isRebalance?: boolean; + /** 1: market, 2: limit */ + orderType?: 1 | 2; + orderPriceOffset?: string; + strategyName?: string; + /** POV execution mode */ + mode?: PovModeV5; + /** POV participation rate */ + participationRate?: string; + /** POV: historical traded volume window (seconds), range [60, 14400] */ + referenceWindow?: string; + /** POV: book depth reference levels [1, 10] */ + depthReference?: string; +} +⋮---- +/** Total order quantity (coin). Either size or positionValue is required */ +⋮---- +/** Total order quantity (value). Either size or positionValue is required */ +⋮---- +/** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ +⋮---- +/** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ +⋮---- +/** TWAP / POV: sub-order placement interval (seconds) */ +⋮---- +/** TWAP: randomize each sub-order quantity by ±20% */ +⋮---- +/** Advanced: activate when market price reaches this value */ +⋮---- +/** Advanced: terminate when last traded price reaches this value */ +⋮---- +/** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ +⋮---- +/** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ +⋮---- +/** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ +⋮---- +/** Iceberg: 0 = taker allowed, 1 = post-only */ +⋮---- +/** 1: market, 2: limit */ +⋮---- +/** POV execution mode */ +⋮---- +/** POV participation rate */ +⋮---- +/** POV: historical traded volume window (seconds), range [60, 14400] */ +⋮---- +/** POV: book depth reference levels [1, 10] */ +⋮---- +/** * GET /v5/strategy/list * The range between beginTimeE0 and endTimeE0 (Unix timestamps in seconds) cannot exceed one year. */ @@ -8380,48 +8838,211 @@ export interface BatchCancelOrderParamsV5 { } ================ -File: src/types/response/v5-earn-liquidity-mining.ts +File: src/types/request/v5-user.ts ================ -export interface LiquidityMiningApyBreakdownV5 { - coin: string; - apy: string; +import { PermissionsV5 } from '../shared-v5'; +⋮---- +export interface CreateSubMemberParamsV5 { + username: string; + password?: string; + /** + * 1: normal, 6: custodial + */ + memberType: 1 | 6; + /** + * 0: quick login disabled (default), 1: quick login enabled + */ + switch?: 0 | 1; + isUta?: boolean; + note?: string; } ⋮---- -export interface LiquidityMiningProductV5 { - productId: string; - baseCoin: string; - quoteCoin: string; - status: 'Available' | 'NotAvailable' | string; - maxLeverage: number; - minInvestmentQuote: string; - minInvestmentBase: string; - maxInvestmentQuote: string; - maxInvestmentBase: string; - minWithdrawalAmount: string; - minReinvestAmount: string; - baseCoinPrecision: number; - quoteCoinPrecision: number; - yieldCoins: string[]; - apyE8: string; - apy7dE8: string; - poolLiquidityValue: string; - dailyYield: string; - slippageRateE8List: string[]; - apyBreakdown: LiquidityMiningApyBreakdownV5[]; - apy7dBreakdown: LiquidityMiningApyBreakdownV5[]; - slippage_levels?: string[]; +/** + * 1: normal, 6: custodial + */ +⋮---- +/** + * 0: quick login disabled (default), 1: quick login enabled + */ +⋮---- +export interface CreateSubApiKeyParamsV5 { + subuid: number; + note?: string; + readOnly: 0 | 1; + ips?: string; + permissions: PermissionsV5; } ⋮---- -export interface LiquidityMiningProductResultV5 { - products: LiquidityMiningProductV5[]; +export interface UpdateApiKeyParamsV5 { + apikey?: string; + readOnly?: 0 | 1; + permissions: PermissionsV5; } ⋮---- -export interface ReinvestLiquidityMiningResultV5 { - orderId: string; - orderLinkId: string; +export interface UpdateSubApiKeyUpdateParamsV5 { + readOnly?: number; + ips?: string[]; + permissions: PermissionsV5; } - -================ +⋮---- +export interface DeleteSubMemberParamsV5 { + subMemberId: string; +} +⋮---- +export interface GetSubAccountAllApiKeysParamsV5 { + subMemberId: string; + limit?: number; + cursor?: string; +} +⋮---- +export interface GetAffiliateUserListParamsV5 { + size?: number; + cursor?: string; + needDeposit?: boolean; + need30?: boolean; + need365?: boolean; + startDate?: string; + endDate?: string; +} +⋮---- +/** GET /v5/affiliate/affiliate-sub-list */ +export interface GetAffiliateSubAffiliateListParamsV5 { + cursor?: string; + /** [0, 100]. Default: 0 */ + size?: number; + /** YYYY-MM-DD. Range with endDate max 3 months */ + startDate?: string; + /** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ + endDate?: string; + /** Exact sub-affiliate ID. 0 or omit for all */ + subAffId?: number; +} +⋮---- +/** [0, 100]. Default: 0 */ +⋮---- +/** YYYY-MM-DD. Range with endDate max 3 months */ +⋮---- +/** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ +⋮---- +/** Exact sub-affiliate ID. 0 or omit for all */ +⋮---- +export interface GetAffiliateUserInfoParamsV5 { + /** The master account UID of affiliate's client */ + uid: string; + /** Coin type for filtering, e.g. USDT */ + coin?: string; + /** + * Business line filter. 1: Derivatives, 2: Spot, 3: ByFi, 4: USDC, 5: Options + */ + business?: '1' | '2' | '3' | '4' | '5'; +} +⋮---- +/** The master account UID of affiliate's client */ +⋮---- +/** Coin type for filtering, e.g. USDT */ +⋮---- +/** + * Business line filter. 1: Derivatives, 2: Spot, 3: ByFi, 4: USDC, 5: Options + */ +⋮---- +/** Get Friend Referrals - invitation relationship status. 0: alive; 1: invalid */ +export interface GetFriendReferralsParamsV5 { + status?: string; + size?: string; + cursor?: string; +} +⋮---- +/** + * Referral product line. + * + * 0 unknown, 1 spot, 2 contracts, 3 options, 4 USDC perpetual, 6 TradeFi, 9 Alpha. + * Unrecognized response values are returned as 0. + */ +export type ReferralProductLineV5 = 0 | 1 | 2 | 3 | 4 | 6 | 9; +⋮---- +/** + * Invitee status (`friendStatus`). + * + * 0 unknown, 1 signed up, 2 first deposit, 3 first trade, 4 qualified, + * 5 not qualified, 6 historical invitation, 7 boost in progress, + * 8 boost qualified, 9 boost failed, 10 boost user signed up. + */ +export type ReferralFriendStatusV5 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; +⋮---- +/** + * POST /v5/referral/commission/records + * + * All fields are optional. Send `{}` when no filter is needed. An empty + * `userIdList` does not filter by invitee. `page` 0 is treated as 1. + * `pageSize` 0 or greater than 200 is treated as 10. + * Times are `YYYY-MM-DD HH:mm:ss`. Property names are the proto camelCase + * names; gateway serialization is not independently verified. + */ +export interface GetReferralCommissionRecordsParamsV5 { + /** Invitee IDs. An empty list does not filter by invitee. */ + userIdList?: number[]; + /** Start time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ + startTime?: string; + /** End time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ + endTime?: string; + /** One-based page. `0` is treated as `1`. */ + page?: number; + /** Page size. `0` or a value greater than 200 is treated as 10. */ + pageSize?: number; + productLine?: ReferralProductLineV5; +} +⋮---- +/** Invitee IDs. An empty list does not filter by invitee. */ +⋮---- +/** Start time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ +⋮---- +/** End time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ +⋮---- +/** One-based page. `0` is treated as `1`. */ +⋮---- +/** Page size. `0` or a value greater than 200 is treated as 10. */ +⋮---- +/** + * POST /v5/referral/user/invitations + * + * All fields are optional. An empty `userIdList` does not filter by invitee. + * Invalid or empty times are passed downstream as `0`. + */ +export interface GetReferralUserInvitationsParamsV5 { + /** Invitee IDs. An empty list does not filter by invitee. */ + userIdList?: number[]; + /** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ + startTime?: string; + /** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ + endTime?: string; + /** Page number. `0` is treated as `1`. */ + page?: number; + /** Page size. `0` or a value greater than 200 is treated as 10. */ + pageSize?: number; + friendStatus?: ReferralFriendStatusV5; +} +⋮---- +/** Invitee IDs. An empty list does not filter by invitee. */ +⋮---- +/** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ +⋮---- +/** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ +⋮---- +/** Page number. `0` is treated as `1`. */ +⋮---- +/** Page size. `0` or a value greater than 200 is treated as 10. */ +⋮---- +/** Sign Agreement. Only master account. + * - `category` (legacy): 2 = metals (XAU/XAG perps; stock perps share this); 3 = crude oil. New enum values are not added here; prefer `categoryV2`. + * - `categoryV2` (recommended): 1 = metals; 2 = crude oil. Additional values may be added by the API; use a numeric literal or variable. + * - Either `category` or `categoryV2` must be sent. */ +export interface SignAgreementParamsV5 { + agree: boolean; + category?: 2 | 3; + categoryV2?: number; +} + +================ File: src/types/response/v5-event.ts ================ export type EventContractTypeV5 = 'Up_Down' | 'UpDown' | 'Target' | 'Range'; @@ -8909,3024 +9530,2012 @@ export interface P2PAdDetailV5 { itemType: string; } ⋮---- -/** Personal ads list only. Empty string means the ad is not hidden. */ -⋮---- -export interface P2PPersonalAdsResponseV5 { - count: number; - items: P2PAdDetailV5[]; - hiddenFlag: boolean; -} -⋮---- -export interface P2POrderExtensionV5 { - isDelayWithdraw: boolean; - delayTime: string; - startTime: string; -} -⋮---- -export interface P2POrderV5 { - id: string; - side: number; - tokenId: string; - orderType: string; - amount: string; - currencyId: string; - price: string; - notifyTokenQuantity?: string; - notifyTokenId?: string; - fee: string; - targetNickName: string; - targetUserId: string; - /** Pending orders. Pass this to getP2PChatSessionId as userMaskId. */ - targetUserMaskId?: string; - status: number; - selfUnreadMsgCount: string; - createDate: string; - transferLastSeconds: string; - appealLastSeconds: string; - userId: string; - sellerRealName: string; - buyerRealName: string; - judgeInfo: { - autoJudgeUnlockTime: string; - dissentResult: string; - preDissent: string; - postDissent: string; - }; - unreadMsgCount: string; - extension: P2POrderExtensionV5; - bulkOrderFlag: boolean; -} -⋮---- -/** Pending orders. Pass this to getP2PChatSessionId as userMaskId. */ -⋮---- -export interface P2POrdersResponseV5 { - count: number; - items: P2POrderV5[]; -} -⋮---- -export interface P2PPaymentConfigItemV5 { - view: boolean; - name: string; - label: string; - placeholder: string; - type: string; - maxLength: string; - required: boolean; -} -⋮---- -export interface P2PPaymentConfigV5 { - paymentType: string; - checkType: number; - sort: number; - paymentName: string; - addTips: string; - itemTips: string; - online: number; - items: P2PPaymentConfigItemV5[]; -} -⋮---- -export interface P2PPaymentTermDetailV5 { - id: string; - realName: string; - paymentType: number; - bankName: string; - branchName: string; - accountNo: string; - qrcode: string; - visible: number; - payMessage: string; - firstName: string; - lastName: string; - secondLastName: string; - clabe: string; - debitCardNumber: string; - mobile: string; - businessName: string; - concept: string; - online: string; - paymentExt1: string; - paymentExt2: string; - paymentExt3: string; - paymentExt4: string; - paymentExt5: string; - paymentExt6: string; - paymentTemplateVersion: number; - paymentConfigVo: P2PPaymentConfigV5; - ruPaymentPrompt: boolean; -} -⋮---- -export interface P2PAppraiseInfoV5 { - anonymous: string; - appraiseContent: string; - appraiseId: string; - appraiseType: string; - modifyFlag: string; - updateDate: string; -} -⋮---- -export interface P2PJudgeInfoV5 { - autoJudgeUnlockTime: string; - dissentResult: string; - preDissent: string; - postDissent: string; -} -⋮---- -export interface P2POrderDetailV5 { - id: string; - side: number; - itemId: string; - accountId: string; - userId: string; - nickName: string; - makerUserId: string; - targetAccountId: string; - targetUserId: string; - targetNickName: string; - /** Counterparty mask ID. Pass this to getP2PChatSessionId as userMaskId. */ - targetUserMaskId: string; - targetFirstName: string; - targetSecondName: string; - targetUserAuthStatus: number; - targetConnectInformation: string; - payerRealName: string; - sellerRealName: string; - buyerRealName: string; - tokenId: string; - tokenName: string; - currencyId: string; - price: string; - quantity: string; - amount: string; - payCode: string; - paymentType: number; - transferDate: string; - status: number; - createDate: string; - paymentTermList: P2PPaymentTermDetailV5[]; - remark: string; - transferLastSeconds: string; - recentOrderNum: number; - recentExecuteRate: number; - appealLastSeconds: string; - appealContent: string; - appealType: number; - appealNickName: string; - canAppeal: string; - totalAppealTimes: string; - appealedTimes: string; - paymentTermResult: P2PPaymentTermDetailV5; - orderFinishMinute: number; - confirmedPayTerm: P2PPaymentTermDetailV5; - makerFee: string; - takerFee: string; - fee: string; - showContact: boolean; - tokenBalance: string; - fiatBalance: string; - unreadMsgCount: string; - updateDate: string; - extension: P2POrderExtensionV5; - selfUnreadMsgCount: string; - judgeType: string; - canReport: boolean; - canReportDisagree: boolean; - canReportType: string[]; - canReportDisagreeType: string[]; - appraiseStatus: string; - appraiseInfo: P2PAppraiseInfoV5; - canReportDisagreeTypes: string[]; - canReportTypes: string[]; - orderType: string; - middleToken: string; - beforePrice: string; - beforeQuantity: string; - beforeToken: string; - alternative: string; - appealUserId: string; - notifyTokenId: string; - notifyTokenQuantity: string; - cancelResponsible: string; - chainType: string; - chainAddress: string; - tradeHashCode: string; - estimatedGasFee: string; - gasFeeTokenId: string; - tradingFeeTokenId: string; - onChainInfo: string; - transactionId: string; - displayRefund: string; - chainWithdrawLastSeconds: string; - chainTransferLastSeconds: string; - orderSource: string; - cancelReason: string; - sellerCancelExamineRemainTime: string; - needSellerExamineCancel: boolean; - /** True when the buyer must review a pending seller cancel request. */ - needBuyerExamineCancel: boolean; - couponCurrencyAmount: string; - totalCurrencyAmount: string; - usedCoupon: boolean; - couponTokenId: string; - couponQuantity: string; - completedOrderAppealCount: number; - totalCompletedOrderAppealCount: number; - realOrderStatus: number; - appealVersion: number; - judgeInfo: P2PJudgeInfoV5; - helpType: string; - appealFlowStatus: string; - appealSubStatus: string; - bulkOrderFlag: boolean; - targetUserType: string; - targetUserDisplays: string[]; - appealProcessChangeFlag: boolean; - appealNegotiationNode: number; -} -⋮---- -/** Counterparty mask ID. Pass this to getP2PChatSessionId as userMaskId. */ -⋮---- -/** True when the buyer must review a pending seller cancel request. */ -⋮---- -export interface P2POrderMessageV5 { - id: string; - message: string; - userId: string; - msgType: number; - msgCode: number; - createDate: string; - contentType: string; - orderId: string; - msgUuid: string; - nickName: string; - fileName: string; - accountId: string; - isRead: number; - read: number; - roleType: string; - onlyForCustomer: number; -} -⋮---- -export interface P2PChatSessionV5 { - sessionName: string; - sessionId: string; - type: 'GROUP' | 'SINGLE'; - /** The docs specify integers, but response examples use strings. */ - id: string | number; - unreadCount: string | number; -} -⋮---- -/** The docs specify integers, but response examples use strings. */ -⋮---- -export interface P2PChatSessionsResponseV5 { - chatSession: P2PChatSessionV5[]; -} -⋮---- -export interface P2PChatMessageV5 { - /** The docs specify integers, but response examples use strings. */ - id: string | number; - sendUserNickName: string; - contentType: 'str' | 'pic' | 'pdf' | 'video'; - /** JSON string containing content, msgCode, msgType, fileName and size. */ - message: string; - /** Creation timestamp in milliseconds. Examples use strings. */ - createDate: string | number; -} -⋮---- -/** The docs specify integers, but response examples use strings. */ -⋮---- -/** JSON string containing content, msgCode, msgType, fileName and size. */ -⋮---- -/** Creation timestamp in milliseconds. Examples use strings. */ -⋮---- -export interface P2PChatMessagesResponseV5 { - messages: P2PChatMessageV5[]; -} -⋮---- -export interface P2PUserInfoV5 { - nickName: string; - defaultNickName: boolean; - isOnline: boolean; - kycLevel: string; - email: string; - mobile: string; - lastLogoutTime: string; - recentRate: string; - totalFinishCount: number; - totalFinishSellCount: number; - totalFinishBuyCount: number; - recentFinishCount: number; - averageReleaseTime: string; - averageTransferTime: string; - accountCreateDays: number; - firstTradeDays: number; - realName: string; - recentTradeAmount: string; - totalTradeAmount: string; - registerTime: string; - authStatus: number; - kycCountryCode: string; - blocked: string; - goodAppraiseRate: string; - goodAppraiseCount: number; - badAppraiseCount: number; - accountId: number; - paymentCount: number; - contactCount: number; - vipLevel: number; - userCancelCountLimit: number; - paymentRealNameUneditable: boolean; - userId: string; - realNameEn: string; -} -⋮---- -export interface P2PCounterpartyUserInfoV5 { - nickName: string; - defaultNickName: boolean; - whiteFlag: number; - contactConfig: boolean; - isOnline: boolean; - email: string; - mobile: string; - kycLevel: number; - lastLogoutTime: string; - recentRate: number; - totalFinishCount: number; - totalFinishSellCount: number; - totalFinishBuyCount: number; - recentFinishCount: number; - averageReleaseTime: string; - averageTransferTime: string; - accountCreateDays: number; - firstTradeDays: number; - realName: string; - recentTradeAmount: string; - totalTradeAmount: string; - executeNum: number; - orderNum: number; - hasUnPostAd: number; - registerTime: string; - authStatus: number; - kycCountryCode: string; - blocked: string; - goodAppraiseRate: string; - goodAppraiseCount: number; - badAppraiseCount: number; - accountId: string; - paymentCount: number; - contactCount: number; - realNameMask: string; - vipLevel: number; - vipProfit: []; - userTag: []; - userCancelCountLimit: number; - paymentRealNameUneditable: boolean; - lostRoleAffected: boolean; - userCurPrivilege: string[]; - userType: string; - userId: string; - realNameEn: string; - canSubOnline: boolean; - curPrivilegeInfo: []; - openApiSwitch: number; -} -⋮---- -export interface P2PUserPaymentV5 { - id: string; - realName: string; - paymentType: string; - bankName: string; - branchName: string; - accountNo: string; - qrcode: string; - visible: number; - payMessage: string; - firstName: string; - lastName: string; - secondLastName: string; - clabe: string; - debitCardNumber: string; - mobile: string; - businessName: string; - concept: string; - online: string; - countNo: string; - paymentExt1: string; - paymentExt2: string; - paymentExt3: string; - paymentExt4: string; - paymentExt5: string; - paymentExt6: string; - paymentTemplateVersion: number; - hasPaymentTemplateChanged: boolean; - paymentConfigVo: P2PPaymentConfigV5; - realNameVerified: boolean; - channel: string; - currencyBalance: string[]; -} - -================ -File: src/types/response/v5-spot-x.ts -================ -export interface LaunchpoolPoolV5 { - poolId: string; - stakeCoin: string; - apr: string; - totalStakedAmount: string; - participantCount: string; -} -⋮---- -export interface LaunchpoolProjectV5 { - projectId: string; - activityCoin: string; - rewardCoin: string; - status: number; - totalReward: string; - stakeStartTime: string; - stakeEndTime: string; - totalParticipantCount: string; - pools: LaunchpoolPoolV5[]; -} -⋮---- -export interface LaunchpoolProjectListResultV5 { - list: LaunchpoolProjectV5[]; - nextPageCursor: string; -} -⋮---- -export interface LaunchpoolActivityLogItemV5 { - stakeCoin: string; - rewardCoin: string; - amount: string; - type: number; - status: number; - createdTime: string; - orderId: string; -} -⋮---- -export interface LaunchpoolActivityLogResultV5 { - list: LaunchpoolActivityLogItemV5[]; - total: number; - pageSize: number; - current: number; -} -⋮---- -export interface LaunchpoolStakingPositionV5 { - stakeCoin: string; - rewardCoin: string; - stakeAmount: string; - totalReward: string; - autoRedeemDate: string; -} -⋮---- -export interface LaunchpoolCurrentStakingResultV5 { - totalInvestmentUsd: string; - totalEarningsUsd: string; - todayEarningsUsd: string; - list: LaunchpoolStakingPositionV5[]; -} -⋮---- -export interface LaunchpoolUserHistoryItemV5 { - stakeCoin: string; - rewardCoin: string; - totalReward: string; - stakeStartTime: string; - stakeEndTime: string; -} -⋮---- -export interface LaunchpoolUserHistoryResultV5 { - list: LaunchpoolUserHistoryItemV5[]; - total: number; - pageSize: number; - current: number; -} -⋮---- -export interface PuzzleProjectV5 { - projectId: string; - activityCoin: string; - rewardCoin: string; - status: number; - startTime: string; - endTime: string; - totalReward: string; - participantCount: string; -} -⋮---- -export interface PuzzleProjectListResultV5 { - list: PuzzleProjectV5[]; - nextPageCursor: string; -} -⋮---- -export interface TokenSplashProjectV5 { - status: number; - projectId: string; - activityCoin: string; - rewardCoin: string; - totalReward: string; - participantCount: string; - registrationStartTime: string; - activityEndTime: string; -} -⋮---- -export interface TokenSplashProjectListResultV5 { - list: TokenSplashProjectV5[]; - nextPageCursor: string; -} -⋮---- -export interface TokenSplashTradeTaskV5 { - tradeRequiredAmount: string; - tradeUnit: string; - /** Token counted by the trade task. On-chain tasks use the activity token ID. */ - tradeToken?: string; - tradedAmount: string; - maxRewardAmount: string; - estimatedRewardAmount: string; - rewardCoin: string; -} -⋮---- -/** Token counted by the trade task. On-chain tasks use the activity token ID. */ -⋮---- -export interface TokenSplashUserActivityItemV5 { - projectId: string; - activityCoin: string; - tradeTask: TokenSplashTradeTaskV5; -} -⋮---- -export interface TokenSplashUserActivityResultV5 { - list: TokenSplashUserActivityItemV5[]; -} - -================ -File: src/types/response/v5-trade.ts -================ -import { - CategoryV5, - OrderCancelTypeV5, - OrderCreateTypeV5, - OrderRejectReasonV5, - OrderSideV5, - OrderStatusV5, - OrderTimeInForceV5, - OrderTriggerByV5, - OrderTypeV5, - PositionIdx, - StopOrderTypeV5, -} from '../shared-v5'; -⋮---- -export interface OrderResultV5 { - orderId: string; - orderLinkId: string; -} -⋮---- -export interface AccountOrderV5 { - orderId: string; - orderLinkId: string; - parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) - blockTradeId: string; - symbol: string; - price: string; - qty: string; - side: OrderSideV5; - isLeverage: '0' | '1'; - positionIdx: PositionIdx; - orderStatus: OrderStatusV5; - createType: OrderCreateTypeV5; - cancelType: OrderCancelTypeV5; - rejectReason: OrderRejectReasonV5; - avgPrice: string; - leavesQty: string; - leavesValue: string; - cumExecQty: string; - cumExecValue: string; - cumExecFee: string; - timeInForce: OrderTimeInForceV5; - orderType: OrderTypeV5; - stopOrderType: StopOrderTypeV5; - orderIv: string; - marketUnit: 'baseCoin' | 'quoteCoin'; - slippageToleranceType: string; - slippageTolerance: string; - triggerPrice: string; - takeProfit: string; - stopLoss: string; - tpslMode: 'Full' | 'Partial' | ''; - ocoTriggerType: - | 'OcoTriggerByUnknown' - | 'OcoTriggerTp' - | 'OcoTriggerBySl' - | ''; - tpLimitPrice: string; - slLimitPrice: string; - tpTriggerBy: OrderTriggerByV5; - slTriggerBy: OrderTriggerByV5; - triggerDirection: 1 | 2; - triggerBy: OrderTriggerByV5; - lastPriceOnCreated: string; - basePrice: string; - reduceOnly: boolean; - closeOnTrigger: boolean; - placeType: 'iv' | 'price' | ''; - smpType: string; - smpGroup: string; - smpOrderId: string; - createdTime: string; - updatedTime: string; - extraFees: string; - cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee - rpiTakerAccess?: boolean; - rpiMatchedQty?: string; - fromAccount?: string; - toAccount?: string; - externalEventType?: string; -} -⋮---- -parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) -⋮---- -cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee -⋮---- -export interface BatchCreateOrderResultV5 { - category: CategoryV5; - symbol: string; - orderId: string; - orderLinkId: string; - createAt?: string; -} -⋮---- -export interface BatchOrdersRetExtInfoV5 { - list: { - code: number; - msg: string; - }[]; -} -⋮---- -export interface BatchAmendOrderResultV5 { - category: CategoryV5; - symbol: string; - orderId: string; - orderLinkId: string; -} -⋮---- -export interface BatchCancelOrderResultV5 { - category: CategoryV5; - symbol: string; - orderId: string; - orderLinkId: string; -} -⋮---- -export interface SpotBorrowCheckResultV5 { - symbol: string; - side: OrderSideV5; - maxTradeQty: string; - maxTradeAmount: string; - spotMaxTradeQty: string; - spotMaxTradeAmount: string; - borrowCoin: string; -} -⋮---- -export interface PreCheckOrderResultV5 { - orderId: string; - orderLinkId: string; - preImrE4: number; // Initial margin rate before checking (in basis points) - preMmrE4: number; // Maintenance margin rate before checking (in basis points) - postImrE4: number; // Initial margin rate after checking (in basis points) - postMmrE4: number; // Maintenance margin rate after checking (in basis points) -} -⋮---- -preImrE4: number; // Initial margin rate before checking (in basis points) -preMmrE4: number; // Maintenance margin rate before checking (in basis points) -postImrE4: number; // Initial margin rate after checking (in basis points) -postMmrE4: number; // Maintenance margin rate after checking (in basis points) - -================ -File: src/types/request/v5-account.ts -================ -import { - AccountTypeV5, - CategoryV5, - InstrumentSymbolTypeV5, - TransactionTypeV5, -} from '../shared-v5'; -⋮---- -export interface GetWalletBalanceParamsV5 { - accountType: AccountTypeV5; - coin?: string; -} -⋮---- -export interface GetBorrowHistoryParamsV5 { - currency?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetFeeRateParamsV5 { - category: CategoryV5; - symbol?: string; - baseCoin?: string; -} -⋮---- -export interface GetTransactionLogParamsV5 { - accountType?: AccountTypeV5; - category?: CategoryV5; - currency?: string; - baseCoin?: string; - type?: TransactionTypeV5; - /** - * Transaction sub type, "movePosition", used to filter trans logs of Move Position only - */ - transSubType?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -/** - * Transaction sub type, "movePosition", used to filter trans logs of Move Position only - */ -⋮---- -export interface MMPModifyParamsV5 { - baseCoin: string; - window: string; - frozenPeriod: string; - qtyLimit: string; - deltaLimit: string; - vegaLimit?: string; -} -⋮---- -export interface RepayLiabilityParamsV5 { - coin?: string; -} -⋮---- -export interface SetCollateralCoinParamsV5 { - coin: string; - collateralSwitch: 'ON' | 'OFF'; -} -⋮---- -export interface GetClassicTransactionLogsParamsV5 { - currency?: string; - baseCoin?: string; - type?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface SetLimitPriceActionParamsV5 { - category: CategoryV5; - modifyEnable: boolean; -} -⋮---- -/** - * Set Delta Neutral Mode. POST /v5/account/set-delta-mode - * 1: enable, 0: disable. - */ -export interface SetDeltaNeutralModeParamsV5 { - deltaEnable: '1' | '0'; -} -⋮---- -export interface GetAccountInstrumentsInfoParamsV5 { - category: 'spot' | 'linear' | 'inverse'; - symbol?: string; - /** Filter by `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ - symbolType?: InstrumentSymbolTypeV5; - limit?: number; - cursor?: string; -} -⋮---- -/** Filter by `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ -⋮---- -/** GET /v5/account/pay-info */ -export interface GetPayInfoParamsV5 { - coin?: string; -} -⋮---- -/** GET /v5/account/trade-info-for-analysis */ -export interface GetTradeInfoForAnalysisParamsV5 { - symbol: string; - startTime?: number; - endTime?: number; -} -⋮---- -export interface ManualRepayParamsV5 { - coin?: string; - amount?: string; - /** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - * If neither `coin` nor `amount` is set, this must be ALL (repay all liabilities) or the request is rejected. - */ - repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; -} -⋮---- -/** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - * If neither `coin` nor `amount` is set, this must be ALL (repay all liabilities) or the request is rejected. - */ - -================ -File: src/types/request/v5-asset.ts -================ -import { AccountTypeV5, CategoryV5 } from '../shared-v5'; -⋮---- -export interface GetCoinExchangeRecordParamsV5 { - fromCoin?: string; - toCoin?: string; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetDeliveryRecordParamsV5 { - category: CategoryV5; - symbol?: string; - startTime?: number; - endTime?: number; - expDate?: string; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetSettlementRecordParamsV5 { - category: CategoryV5; - symbol?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetAssetInfoParamsV5 { - accountType: AccountTypeV5; - coin?: string; -} -⋮---- -export interface GetAllCoinsBalanceParamsV5 { - memberId?: string; - accountType: AccountTypeV5; - coin?: string; - withBonus?: number; -} -⋮---- -export interface GetAccountCoinBalanceParamsV5 { - memberId?: string; - toMemberId?: string; - accountType: AccountTypeV5; - coin: string; - toAccountType?: AccountTypeV5; - withBonus?: number; - withTransferSafeAmount?: 0 | 1; - withLtvTransferSafeAmount?: 0 | 1; -} -⋮---- -export interface GetInternalTransferParamsV5 { - transferId?: string; - coin?: string; - status?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface UniversalTransferParamsV5 { - transferId: string; - coin: string; - amount: string; - fromMemberId: number; - toMemberId: number; - fromAccountType: AccountTypeV5; - toAccountType: AccountTypeV5; -} -⋮---- -export interface GetUniversalTransferRecordsParamsV5 { - transferId?: string; - coin?: string; - status?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; - fromMemberId?: string; - toMemberId?: string; -} -⋮---- -export interface GetAllowedDepositCoinInfoParamsV5 { - coin?: string; - chain?: string; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetDepositRecordParamsV5 { - id?: string; - txID?: string; - coin?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetSubAccountDepositRecordParamsV5 { - id?: string; - txID?: string; - subMemberId: string; - coin?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetInternalDepositRecordParamsV5 { - txID?: string; - startTime?: number; - endTime?: number; - coin?: string; - cursor?: string; - limit?: number; -} -⋮---- -export interface GetWithdrawalRecordsParamsV5 { - withdrawID?: string; - txID?: string; - coin?: string; - withdrawType?: number; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetWithdrawalAddressListParamsV5 { - coin?: string; - chain?: string; - addressType?: 0 | 1 | 2; - limit?: number; - cursor?: string; -} -⋮---- -export interface SubmitDepositOriginatorInfoParamsV5 { - depositId: number; - subAccountId?: number; - /** Travel Rule questionnaire JSON string. See Questionnaire docs. */ - questionnaire: string; -} -⋮---- -/** Travel Rule questionnaire JSON string. See Questionnaire docs. */ -⋮---- -export interface WithdrawParamsV5 { - coin: string; - /** - * When forceChain is 0 or 1, required. When forceChain is 2 (Bybit UID withdraw), may be null/omitted. - */ - chain?: string; - address: string; - tag?: string; - amount: string; - timestamp: number; - forceChain?: number; - /** - * FUND, UTA, or EARN; or comma combo e.g. FUND,UTA,EARN (funding first, then UTA and Earn for remainder). - * SPOT is legacy if still supported for older integrations. - */ - accountType: string; - feeType?: 0 | 1; - requestId?: string; - /** - * Required for Bybit Turkey (TR) site users when creating a withdrawal. Omitted for other regions unless the API requires it. - */ - transactionPurpose?: string; - /** - * Travel Rule questionnaire JSON string (max 16384 bytes). Takes precedence over `beneficiary` / `transactionPurpose` when both are set. - */ - questionnaire?: string; - beneficiary?: { - vaspEntityId?: string; - beneficiaryName?: string; - beneficiaryLegalType?: string; - beneficiaryWalletType?: string; - beneficiaryUnhostedWalletType?: string; - beneficiaryPoiNumber?: string; - beneficiaryPoiType?: string; - beneficiaryPoiIssuingCountry?: string; - beneficiaryPoiExpiredDate?: string; - }; -} -⋮---- -/** - * When forceChain is 0 or 1, required. When forceChain is 2 (Bybit UID withdraw), may be null/omitted. - */ -⋮---- -/** - * FUND, UTA, or EARN; or comma combo e.g. FUND,UTA,EARN (funding first, then UTA and Earn for remainder). - * SPOT is legacy if still supported for older integrations. - */ -⋮---- -/** - * Required for Bybit Turkey (TR) site users when creating a withdrawal. Omitted for other regions unless the API requires it. - */ -⋮---- -/** - * Travel Rule questionnaire JSON string (max 16384 bytes). Takes precedence over `beneficiary` / `transactionPurpose` when both are set. - */ -⋮---- -export interface ConvertCoinsParamsV5 { - coin?: string; - side?: number; - accountType: - | 'eb_convert_funding' - | 'eb_convert_uta' - | 'eb_convert_spot' - | 'eb_convert_contract' - | 'eb_convert_inverse'; -} -⋮---- -export interface RequestConvertQuoteParamsV5 { - fromCoin: string; - toCoin: string; - fromCoinType?: string; - toCoinType?: string; - requestCoin: string; - requestAmount: string; - accountType: - | 'eb_convert_funding' - | 'eb_convert_uta' - | 'eb_convert_spot' - | 'eb_convert_contract' - | 'eb_convert_inverse'; - requestId?: string; -} -⋮---- -export interface GetConvertHistoryParamsV5 { - accountType?: string; - index?: number; - limit?: number; -} -⋮---- -export interface GetSmallBalanceListParamsV5 { - accountType: 'eb_convert_uta'; // Wallet type, only supports Unified wallet - fromCoin?: string; // Source currency -} -⋮---- -accountType: 'eb_convert_uta'; // Wallet type, only supports Unified wallet -fromCoin?: string; // Source currency -⋮---- -export interface GetFiatTradingPairListParamsV5 { - side?: 0 | 1; // 0: buy (buy crypto, sell fiat), 1: sell (sell crypto, buy fiat) -} -⋮---- -side?: 0 | 1; // 0: buy (buy crypto, sell fiat), 1: sell (sell crypto, buy fiat) -⋮---- -/** Funding Account Transaction History. Interval createTimeFrom-createTimeTo max 7 days. */ -export interface GetFundingAccountTransactionHistoryParamsV5 { - createTimeFrom?: string; - createTimeTo?: string; - limit?: string; - cursor?: string; -} -⋮---- -/** Asset Overview. memberId required when querying sub account via master API key. */ -export interface GetAssetOverviewParamsV5 { - memberId?: string; - /** Fiat currency for valuation; defaults to USD if omitted. */ - valuationCurrency?: string; - /** Account type filter; returns all if omitted. */ - accountType?: string; -} -⋮---- -/** Fiat currency for valuation; defaults to USD if omitted. */ -⋮---- -/** Account type filter; returns all if omitted. */ -⋮---- -/** GET /v5/asset/portfolio-margin */ -export interface GetPortfolioMarginInfoParamsV5 { - baseCoin?: string; -} -⋮---- -/** GET /v5/asset/total-members-assets */ -export interface GetTotalMembersAssetsParamsV5 { - /** If omitted, defaults to BTC. Total is quoted in this coin. */ - coin?: string; -} -⋮---- -/** If omitted, defaults to BTC. Total is quoted in this coin. */ - -================ -File: src/types/request/v5-crypto-loan.ts -================ -export interface BorrowCryptoLoanParamsV5 { - loanCurrency: string; - loanAmount?: string; - loanTerm?: string; - collateralCurrency: string; - collateralAmount?: string; -} -⋮---- -export interface GetUnpaidLoanOrdersParamsV5 { - orderId?: string; - loanCurrency?: string; - collateralCurrency?: string; - loanTermType?: string; - loanTerm?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface GetRepaymentHistoryParamsV5 { - orderId?: string; - repayId?: string; - loanCurrency?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface GetCompletedLoanOrderHistoryParamsV5 { - orderId?: string; - loanCurrency?: string; - collateralCurrency?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface GetLoanLTVAdjustmentHistoryParamsV5 { - orderId?: string; - adjustId?: string; - collateralCurrency?: string; - limit?: string; - cursor?: string; -} -⋮---- -// New Crypto Loan Request Types -⋮---- -export interface GetBorrowableCoinsParamsV5 { - vipLevel?: string; - currency?: string; -} -⋮---- -export interface GetCollateralCoinsParamsV5 { - currency?: string; -} -⋮---- -export interface GetMaxCollateralAmountParamsV5 { - currency: string; -} -⋮---- -export interface AdjustCollateralAmountParamsV5 { - currency: string; - amount: string; - direction: '0' | '1'; -} -⋮---- -export interface GetCollateralAdjustmentHistoryParamsV5 { - adjustId?: string; - collateralCurrency?: string; - limit?: string; - cursor?: string; -} -⋮---- -// Flexible Loan Request Types -⋮---- -export interface BorrowFlexibleParamsV5 { - loanCurrency: string; - loanAmount: string; - collateralList?: { - currency: string; - amount: string; - }[]; -} -⋮---- -export interface RepayFlexibleParamsV5 { - loanCurrency: string; - amount: string; -} -⋮---- -export interface RepayCollateralFlexibleParamsV5 { - loanCurrency: string; - collateralCoin: string; - amount: string; -} -⋮---- -export interface GetOngoingFlexibleLoansParamsV5 { - loanCurrency?: string; -} -⋮---- -export interface GetBorrowHistoryFlexibleParamsV5 { - orderId?: string; - loanCurrency?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface GetRepaymentHistoryFlexibleParamsV5 { - repayId?: string; - loanCurrency?: string; - limit?: string; - cursor?: string; -} -⋮---- -// Fixed Loan Request Types -⋮---- -export interface GetSupplyOrderQuoteFixedParamsV5 { - orderCurrency: string; - term?: string; - orderBy: 'apy' | 'term' | 'quantity'; - sort?: number; - limit?: number; -} -⋮---- -export interface GetBorrowOrderQuoteFixedParamsV5 { - orderCurrency: string; - term?: string; - orderBy: 'apy' | 'term' | 'quantity'; - sort?: number; - limit?: number; -} -⋮---- -export interface CreateBorrowOrderFixedParamsV5 { - orderCurrency: string; - orderAmount: string; - annualRate: string; - term: string; - autoRepay?: string; // Deprecated - repayType?: string; // 1: Auto Repayment (default); 2: Transfer to flexible loan - strategyType?: 'PARTIAL' | 'FULL'; - collateralList?: { - currency: string; - amount: string; - }[]; -} -⋮---- -autoRepay?: string; // Deprecated -repayType?: string; // 1: Auto Repayment (default); 2: Transfer to flexible loan -⋮---- -export interface GetFixedLoanAvailableInventoryParamsV5 { - currency: string; - term: string; - annualRate: string; -} -⋮---- -export interface GetFlexibleLoanAvailableInventoryParamsV5 { - currency: string; -} -⋮---- -export interface CreateSupplyOrderFixedParamsV5 { - orderCurrency: string; - orderAmount: string; - annualRate: string; - term: string; - /** - * Source account for supply. 0: Funding Account; 1: Earn Flexible Account; 2: ALL. Default: 0 - */ - availableSource?: '0' | '1' | '2'; -} -⋮---- -/** - * Source account for supply. 0: Funding Account; 1: Earn Flexible Account; 2: ALL. Default: 0 - */ -⋮---- -export interface CancelBorrowOrderFixedParamsV5 { - orderId: string; -} -⋮---- -export interface CancelSupplyOrderFixedParamsV5 { - orderId: string; - /** - * Account to receive the refund. 0: Funding Account; 1: EasyEarn. Default: 0 - */ - refundedAccount?: '0' | '1'; -} -⋮---- -/** - * Account to receive the refund. 0: Funding Account; 1: EasyEarn. Default: 0 - */ -⋮---- -export interface GetBorrowContractInfoFixedParamsV5 { - orderId?: string; - loanId?: string; - orderCurrency?: string; - term?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface GetSupplyContractInfoFixedParamsV5 { - orderId?: string; - supplyId?: string; - supplyCurrency?: string; - term?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface GetBorrowOrderInfoFixedParamsV5 { - orderId?: string; - orderCurrency?: string; - state?: string; - term?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface GetSupplyOrderInfoFixedParamsV5 { - orderId?: string; - orderCurrency?: string; - state?: string; - term?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface RepayFixedParamsV5 { - loanId?: string; - loanCurrency?: string; -} -⋮---- -export interface RepayCollateralFixedParamsV5 { - loanCurrency: string; - collateralCoin: string; - amount: string; -} -⋮---- -export interface GetRepaymentHistoryFixedParamsV5 { - repayId?: string; - loanCurrency?: string; - limit?: string; - cursor?: string; -} -⋮---- -export interface RenewBorrowOrderFixedParamsV5 { - loanId: string; - collateralList?: { - currency?: string; - amount?: string; - }[]; -} -⋮---- -export interface GetRenewOrderInfoFixedParamsV5 { - orderId?: string; - orderCurrency?: string; - limit?: string; - cursor?: string; -} -⋮---- -// Max Loan Amount Request Types -⋮---- -export interface GetMaxLoanAmountParamsV5 { - currency: string; // Coin to borrow - collateralList?: { - ccy: string; // Collateral coin - amount: string; // Collateral amount - }[]; -} -⋮---- -currency: string; // Coin to borrow -⋮---- -ccy: string; // Collateral coin -amount: string; // Collateral amount -⋮---- -// Institutional Loan Request Types -⋮---- -export interface GetCoinDeltaAmountParamsV5 { - coin?: string; -} -⋮---- -export interface RepayInstitutionalLoanParamsV5 { - token: string; // Coin name - quantity: string; // The qty to be repaid -} -⋮---- -token: string; // Coin name -quantity: string; // The qty to be repaid - -================ -File: src/types/request/v5-user.ts -================ -import { PermissionsV5 } from '../shared-v5'; -⋮---- -export interface CreateSubMemberParamsV5 { - username: string; - password?: string; - /** - * 1: normal, 6: custodial - */ - memberType: 1 | 6; - /** - * 0: quick login disabled (default), 1: quick login enabled - */ - switch?: 0 | 1; - isUta?: boolean; - note?: string; -} -⋮---- -/** - * 1: normal, 6: custodial - */ -⋮---- -/** - * 0: quick login disabled (default), 1: quick login enabled - */ -⋮---- -export interface CreateSubApiKeyParamsV5 { - subuid: number; - note?: string; - readOnly: 0 | 1; - ips?: string; - permissions: PermissionsV5; -} -⋮---- -export interface UpdateApiKeyParamsV5 { - apikey?: string; - readOnly?: 0 | 1; - permissions: PermissionsV5; -} -⋮---- -export interface UpdateSubApiKeyUpdateParamsV5 { - readOnly?: number; - ips?: string[]; - permissions: PermissionsV5; +/** Personal ads list only. Empty string means the ad is not hidden. */ +⋮---- +export interface P2PPersonalAdsResponseV5 { + count: number; + items: P2PAdDetailV5[]; + hiddenFlag: boolean; } ⋮---- -export interface DeleteSubMemberParamsV5 { - subMemberId: string; +export interface P2POrderExtensionV5 { + isDelayWithdraw: boolean; + delayTime: string; + startTime: string; } ⋮---- -export interface GetSubAccountAllApiKeysParamsV5 { - subMemberId: string; - limit?: number; - cursor?: string; +export interface P2POrderV5 { + id: string; + side: number; + tokenId: string; + orderType: string; + amount: string; + currencyId: string; + price: string; + notifyTokenQuantity?: string; + notifyTokenId?: string; + fee: string; + targetNickName: string; + targetUserId: string; + /** Pending orders. Pass this to getP2PChatSessionId as userMaskId. */ + targetUserMaskId?: string; + status: number; + selfUnreadMsgCount: string; + createDate: string; + transferLastSeconds: string; + appealLastSeconds: string; + userId: string; + sellerRealName: string; + buyerRealName: string; + judgeInfo: { + autoJudgeUnlockTime: string; + dissentResult: string; + preDissent: string; + postDissent: string; + }; + unreadMsgCount: string; + extension: P2POrderExtensionV5; + bulkOrderFlag: boolean; } ⋮---- -export interface GetAffiliateUserListParamsV5 { - size?: number; - cursor?: string; - needDeposit?: boolean; - need30?: boolean; - need365?: boolean; - startDate?: string; - endDate?: string; +/** Pending orders. Pass this to getP2PChatSessionId as userMaskId. */ +⋮---- +export interface P2POrdersResponseV5 { + count: number; + items: P2POrderV5[]; } ⋮---- -/** GET /v5/affiliate/affiliate-sub-list */ -export interface GetAffiliateSubAffiliateListParamsV5 { - cursor?: string; - /** [0, 100]. Default: 0 */ - size?: number; - /** YYYY-MM-DD. Range with endDate max 3 months */ - startDate?: string; - /** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ - endDate?: string; - /** Exact sub-affiliate ID. 0 or omit for all */ - subAffId?: number; +export interface P2PPaymentConfigItemV5 { + view: boolean; + name: string; + label: string; + placeholder: string; + type: string; + maxLength: string; + required: boolean; } ⋮---- -/** [0, 100]. Default: 0 */ +export interface P2PPaymentConfigV5 { + paymentType: string; + checkType: number; + sort: number; + paymentName: string; + addTips: string; + itemTips: string; + online: number; + items: P2PPaymentConfigItemV5[]; +} ⋮---- -/** YYYY-MM-DD. Range with endDate max 3 months */ +export interface P2PPaymentTermDetailV5 { + id: string; + realName: string; + paymentType: number; + bankName: string; + branchName: string; + accountNo: string; + qrcode: string; + visible: number; + payMessage: string; + firstName: string; + lastName: string; + secondLastName: string; + clabe: string; + debitCardNumber: string; + mobile: string; + businessName: string; + concept: string; + online: string; + paymentExt1: string; + paymentExt2: string; + paymentExt3: string; + paymentExt4: string; + paymentExt5: string; + paymentExt6: string; + paymentTemplateVersion: number; + paymentConfigVo: P2PPaymentConfigV5; + ruPaymentPrompt: boolean; +} ⋮---- -/** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ +export interface P2PAppraiseInfoV5 { + anonymous: string; + appraiseContent: string; + appraiseId: string; + appraiseType: string; + modifyFlag: string; + updateDate: string; +} ⋮---- -/** Exact sub-affiliate ID. 0 or omit for all */ +export interface P2PJudgeInfoV5 { + autoJudgeUnlockTime: string; + dissentResult: string; + preDissent: string; + postDissent: string; +} ⋮---- -export interface GetAffiliateUserInfoParamsV5 { - /** The master account UID of affiliate's client */ - uid: string; - /** Coin type for filtering, e.g. USDT */ - coin?: string; - /** - * Business line filter. 1: Derivatives, 2: Spot, 3: ByFi, 4: USDC, 5: Options - */ - business?: '1' | '2' | '3' | '4' | '5'; +export interface P2POrderDetailV5 { + id: string; + side: number; + itemId: string; + accountId: string; + userId: string; + nickName: string; + makerUserId: string; + targetAccountId: string; + targetUserId: string; + targetNickName: string; + /** Counterparty mask ID. Pass this to getP2PChatSessionId as userMaskId. */ + targetUserMaskId: string; + targetFirstName: string; + targetSecondName: string; + targetUserAuthStatus: number; + targetConnectInformation: string; + payerRealName: string; + sellerRealName: string; + buyerRealName: string; + tokenId: string; + tokenName: string; + currencyId: string; + price: string; + quantity: string; + amount: string; + payCode: string; + paymentType: number; + transferDate: string; + status: number; + createDate: string; + paymentTermList: P2PPaymentTermDetailV5[]; + remark: string; + transferLastSeconds: string; + recentOrderNum: number; + recentExecuteRate: number; + appealLastSeconds: string; + appealContent: string; + appealType: number; + appealNickName: string; + canAppeal: string; + totalAppealTimes: string; + appealedTimes: string; + paymentTermResult: P2PPaymentTermDetailV5; + orderFinishMinute: number; + confirmedPayTerm: P2PPaymentTermDetailV5; + makerFee: string; + takerFee: string; + fee: string; + showContact: boolean; + tokenBalance: string; + fiatBalance: string; + unreadMsgCount: string; + updateDate: string; + extension: P2POrderExtensionV5; + selfUnreadMsgCount: string; + judgeType: string; + canReport: boolean; + canReportDisagree: boolean; + canReportType: string[]; + canReportDisagreeType: string[]; + appraiseStatus: string; + appraiseInfo: P2PAppraiseInfoV5; + canReportDisagreeTypes: string[]; + canReportTypes: string[]; + orderType: string; + middleToken: string; + beforePrice: string; + beforeQuantity: string; + beforeToken: string; + alternative: string; + appealUserId: string; + notifyTokenId: string; + notifyTokenQuantity: string; + cancelResponsible: string; + chainType: string; + chainAddress: string; + tradeHashCode: string; + estimatedGasFee: string; + gasFeeTokenId: string; + tradingFeeTokenId: string; + onChainInfo: string; + transactionId: string; + displayRefund: string; + chainWithdrawLastSeconds: string; + chainTransferLastSeconds: string; + orderSource: string; + cancelReason: string; + sellerCancelExamineRemainTime: string; + needSellerExamineCancel: boolean; + /** True when the buyer must review a pending seller cancel request. */ + needBuyerExamineCancel: boolean; + couponCurrencyAmount: string; + totalCurrencyAmount: string; + usedCoupon: boolean; + couponTokenId: string; + couponQuantity: string; + completedOrderAppealCount: number; + totalCompletedOrderAppealCount: number; + realOrderStatus: number; + appealVersion: number; + judgeInfo: P2PJudgeInfoV5; + helpType: string; + appealFlowStatus: string; + appealSubStatus: string; + bulkOrderFlag: boolean; + targetUserType: string; + targetUserDisplays: string[]; + appealProcessChangeFlag: boolean; + appealNegotiationNode: number; } ⋮---- -/** The master account UID of affiliate's client */ -⋮---- -/** Coin type for filtering, e.g. USDT */ +/** Counterparty mask ID. Pass this to getP2PChatSessionId as userMaskId. */ ⋮---- -/** - * Business line filter. 1: Derivatives, 2: Spot, 3: ByFi, 4: USDC, 5: Options - */ +/** True when the buyer must review a pending seller cancel request. */ ⋮---- -/** Get Friend Referrals - invitation relationship status. 0: alive; 1: invalid */ -export interface GetFriendReferralsParamsV5 { - status?: string; - size?: string; - cursor?: string; +export interface P2POrderMessageV5 { + id: string; + message: string; + userId: string; + msgType: number; + msgCode: number; + createDate: string; + contentType: string; + orderId: string; + msgUuid: string; + nickName: string; + fileName: string; + accountId: string; + isRead: number; + read: number; + roleType: string; + onlyForCustomer: number; } ⋮---- -/** - * Referral product line. - * - * 0 unknown, 1 spot, 2 contracts, 3 options, 4 USDC perpetual, 6 TradeFi, 9 Alpha. - * Unrecognized response values are returned as 0. - */ -export type ReferralProductLineV5 = 0 | 1 | 2 | 3 | 4 | 6 | 9; -⋮---- -/** - * Invitee status (`friendStatus`). - * - * 0 unknown, 1 signed up, 2 first deposit, 3 first trade, 4 qualified, - * 5 not qualified, 6 historical invitation, 7 boost in progress, - * 8 boost qualified, 9 boost failed, 10 boost user signed up. - */ -export type ReferralFriendStatusV5 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; -⋮---- -/** - * POST /v5/referral/commission/records - * - * All fields are optional. Send `{}` when no filter is needed. An empty - * `userIdList` does not filter by invitee. `page` 0 is treated as 1. - * `pageSize` 0 or greater than 200 is treated as 10. - * Times are `YYYY-MM-DD HH:mm:ss`. Property names are the proto camelCase - * names; gateway serialization is not independently verified. - */ -export interface GetReferralCommissionRecordsParamsV5 { - /** Invitee IDs. An empty list does not filter by invitee. */ - userIdList?: number[]; - /** Start time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ - startTime?: string; - /** End time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ - endTime?: string; - /** One-based page. `0` is treated as `1`. */ - page?: number; - /** Page size. `0` or a value greater than 200 is treated as 10. */ - pageSize?: number; - productLine?: ReferralProductLineV5; +export interface P2PChatSessionV5 { + sessionName: string; + sessionId: string; + type: 'GROUP' | 'SINGLE'; + /** The docs specify integers, but response examples use strings. */ + id: string | number; + unreadCount: string | number; } ⋮---- -/** Invitee IDs. An empty list does not filter by invitee. */ -⋮---- -/** Start time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ -⋮---- -/** End time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ -⋮---- -/** One-based page. `0` is treated as `1`. */ -⋮---- -/** Page size. `0` or a value greater than 200 is treated as 10. */ +/** The docs specify integers, but response examples use strings. */ ⋮---- -/** - * POST /v5/referral/user/invitations - * - * All fields are optional. An empty `userIdList` does not filter by invitee. - * Invalid or empty times are passed downstream as `0`. - */ -export interface GetReferralUserInvitationsParamsV5 { - /** Invitee IDs. An empty list does not filter by invitee. */ - userIdList?: number[]; - /** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ - startTime?: string; - /** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ - endTime?: string; - /** Page number. `0` is treated as `1`. */ - page?: number; - /** Page size. `0` or a value greater than 200 is treated as 10. */ - pageSize?: number; - friendStatus?: ReferralFriendStatusV5; +export interface P2PChatSessionsResponseV5 { + chatSession: P2PChatSessionV5[]; } ⋮---- -/** Invitee IDs. An empty list does not filter by invitee. */ -⋮---- -/** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ +export interface P2PChatMessageV5 { + /** The docs specify integers, but response examples use strings. */ + id: string | number; + sendUserNickName: string; + contentType: 'str' | 'pic' | 'pdf' | 'video'; + /** JSON string containing content, msgCode, msgType, fileName and size. */ + message: string; + /** Creation timestamp in milliseconds. Examples use strings. */ + createDate: string | number; +} ⋮---- -/** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ +/** The docs specify integers, but response examples use strings. */ ⋮---- -/** Page number. `0` is treated as `1`. */ +/** JSON string containing content, msgCode, msgType, fileName and size. */ ⋮---- -/** Page size. `0` or a value greater than 200 is treated as 10. */ +/** Creation timestamp in milliseconds. Examples use strings. */ ⋮---- -/** Sign Agreement. Only master account. - * - `category` (legacy): 2 = metals (XAU/XAG perps; stock perps share this); 3 = crude oil. New enum values are not added here; prefer `categoryV2`. - * - `categoryV2` (recommended): 1 = metals; 2 = crude oil. Additional values may be added by the API; use a numeric literal or variable. - * - Either `category` or `categoryV2` must be sent. */ -export interface SignAgreementParamsV5 { - agree: boolean; - category?: 2 | 3; - categoryV2?: number; -} - -================ -File: src/types/response/v5-crypto-loan.ts -================ -export interface CollateralCoinV5 { - collateralAccuracy: number; - initialLTV: string; - liquidationLTV: string; - marginCallLTV: string; - maxLimit: string; +export interface P2PChatMessagesResponseV5 { + messages: P2PChatMessageV5[]; } ⋮---- -export interface VipCollateralCoinsV5 { - list: CollateralCoinV5[]; - vipLevel: string; +export interface P2PUserInfoV5 { + nickName: string; + defaultNickName: boolean; + isOnline: boolean; + kycLevel: string; + email: string; + mobile: string; + lastLogoutTime: string; + recentRate: string; + totalFinishCount: number; + totalFinishSellCount: number; + totalFinishBuyCount: number; + recentFinishCount: number; + averageReleaseTime: string; + averageTransferTime: string; + accountCreateDays: number; + firstTradeDays: number; + realName: string; + recentTradeAmount: string; + totalTradeAmount: string; + registerTime: string; + authStatus: number; + kycCountryCode: string; + blocked: string; + goodAppraiseRate: string; + goodAppraiseCount: number; + badAppraiseCount: number; + accountId: number; + paymentCount: number; + contactCount: number; + vipLevel: number; + userCancelCountLimit: number; + paymentRealNameUneditable: boolean; + userId: string; + realNameEn: string; } ⋮---- -export interface BorrowableCoinV5 { - borrowingAccuracy: number; - currency: string; - flexibleHourlyInterestRate: string; - hourlyInterestRate7D: string; - hourlyInterestRate14D: string; - hourlyInterestRate30D: string; - hourlyInterestRate90D: string; - hourlyInterestRate180D: string; - maxBorrowingAmount: string; - minBorrowingAmount: string; +export interface P2PCounterpartyUserInfoV5 { + nickName: string; + defaultNickName: boolean; + whiteFlag: number; + contactConfig: boolean; + isOnline: boolean; + email: string; + mobile: string; + kycLevel: number; + lastLogoutTime: string; + recentRate: number; + totalFinishCount: number; + totalFinishSellCount: number; + totalFinishBuyCount: number; + recentFinishCount: number; + averageReleaseTime: string; + averageTransferTime: string; + accountCreateDays: number; + firstTradeDays: number; + realName: string; + recentTradeAmount: string; + totalTradeAmount: string; + executeNum: number; + orderNum: number; + hasUnPostAd: number; + registerTime: string; + authStatus: number; + kycCountryCode: string; + blocked: string; + goodAppraiseRate: string; + goodAppraiseCount: number; + badAppraiseCount: number; + accountId: string; + paymentCount: number; + contactCount: number; + realNameMask: string; + vipLevel: number; + vipProfit: []; + userTag: []; + userCancelCountLimit: number; + paymentRealNameUneditable: boolean; + lostRoleAffected: boolean; + userCurPrivilege: string[]; + userType: string; + userId: string; + realNameEn: string; + canSubOnline: boolean; + curPrivilegeInfo: []; + openApiSwitch: number; } ⋮---- -export interface VipBorrowableCoinsV5 { - list: BorrowableCoinV5[]; - vipLevel: string; +export interface P2PUserPaymentV5 { + id: string; + realName: string; + paymentType: string; + bankName: string; + branchName: string; + accountNo: string; + qrcode: string; + visible: number; + payMessage: string; + firstName: string; + lastName: string; + secondLastName: string; + clabe: string; + debitCardNumber: string; + mobile: string; + businessName: string; + concept: string; + online: string; + countNo: string; + paymentExt1: string; + paymentExt2: string; + paymentExt3: string; + paymentExt4: string; + paymentExt5: string; + paymentExt6: string; + paymentTemplateVersion: number; + hasPaymentTemplateChanged: boolean; + paymentConfigVo: P2PPaymentConfigV5; + realNameVerified: boolean; + channel: string; + currencyBalance: string[]; } -⋮---- -export interface AccountBorrowCollateralLimitV5 { - collateralCurrency: string; - loanCurrency: string; - maxCollateralAmount: string; - maxLoanAmount: string; - minCollateralAmount: string; - minLoanAmount: string; + +================ +File: src/types/response/v5-spot-x.ts +================ +export interface LaunchpoolPoolV5 { + poolId: string; + stakeCoin: string; + apr: string; + totalStakedAmount: string; + participantCount: string; } ⋮---- -export interface UnpaidLoanOrderV5 { - collateralAmount: string; - collateralCurrency: string; - currentLTV: string; - expirationTime: string; - hourlyInterestRate: string; - loanCurrency: string; - loanTerm: string; - orderId: string; - residualInterest: string; - residualPenaltyInterest: string; - totalDebt: string; +export interface LaunchpoolProjectV5 { + projectId: string; + activityCoin: string; + rewardCoin: string; + status: number; + totalReward: string; + stakeStartTime: string; + stakeEndTime: string; + totalParticipantCount: string; + pools: LaunchpoolPoolV5[]; } ⋮---- -export interface RepaymentHistoryV5 { - collateralCurrency: string; - collateralReturn: string; - loanCurrency: string; - loanTerm: string; - orderId: string; - repayAmount: string; - repayId: string; - repayStatus: number; - repayTime: string; - repayType: string; +export interface LaunchpoolProjectListResultV5 { + list: LaunchpoolProjectV5[]; + nextPageCursor: string; } ⋮---- -export interface CompletedLoanOrderV5 { - borrowTime: string; - collateralCurrency: string; - expirationTime: string; - hourlyInterestRate: string; - initialCollateralAmount: string; - initialLoanAmount: string; - loanCurrency: string; - loanTerm: string; - orderId: string; - repaidInterest: string; - repaidPenaltyInterest: string; +export interface LaunchpoolActivityLogItemV5 { + stakeCoin: string; + rewardCoin: string; + amount: string; + type: number; status: number; -} -export interface LoanLTVAdjustmentHistoryV5 { - collateralCurrency: string; + createdTime: string; orderId: string; - adjustId: string; - adjustTime: string; - preLTV: string; - afterLTV: string; - direction: number; - amount: string; } ⋮---- -// New Crypto Loan Types -⋮---- -export interface BorrowCoinV5 { - currency: string; - fixedBorrowable: boolean; - fixedBorrowingAccuracy: number; - flexibleBorrowable: boolean; - flexibleBorrowingAccuracy: number; - maxBorrowingAmount: string; - minFixedBorrowingAmount: string; - minFlexibleBorrowingAmount: string; - vipLevel: string; - flexibleAnnualizedInterestRate: string; - annualizedInterestRate7D: string; - annualizedInterestRate14D: string; - annualizedInterestRate30D: string; - annualizedInterestRate60D: string; - annualizedInterestRate90D: string; - annualizedInterestRate180D: string; +export interface LaunchpoolActivityLogResultV5 { + list: LaunchpoolActivityLogItemV5[]; + total: number; + pageSize: number; + current: number; } ⋮---- -export interface CollateralRatioV5 { - collateralRatio: string; - maxValue: string; - minValue: string; +export interface LaunchpoolStakingPositionV5 { + stakeCoin: string; + rewardCoin: string; + stakeAmount: string; + totalReward: string; + autoRedeemDate: string; } ⋮---- -export interface CollateralRatioConfigV5 { - collateralRatioList: CollateralRatioV5[]; - currencies: string; +export interface LaunchpoolCurrentStakingResultV5 { + totalInvestmentUsd: string; + totalEarningsUsd: string; + todayEarningsUsd: string; + list: LaunchpoolStakingPositionV5[]; } ⋮---- -export interface CurrencyLiquidationV5 { - currency: string; - liquidationOrder: number; +export interface LaunchpoolUserHistoryItemV5 { + stakeCoin: string; + rewardCoin: string; + totalReward: string; + stakeStartTime: string; + stakeEndTime: string; } ⋮---- -export interface CollateralDataV5 { - collateralRatioConfigList: CollateralRatioConfigV5[]; - currencyLiquidationList: CurrencyLiquidationV5[]; +export interface LaunchpoolUserHistoryResultV5 { + list: LaunchpoolUserHistoryItemV5[]; + total: number; + pageSize: number; + current: number; } ⋮---- -// Additional New Crypto Loan Types +export interface PuzzleProjectV5 { + projectId: string; + activityCoin: string; + rewardCoin: string; + status: number; + startTime: string; + endTime: string; + totalReward: string; + participantCount: string; +} ⋮---- -export interface AdjustCollateralAmountV5 { - adjustId: number; +export interface PuzzleProjectListResultV5 { + list: PuzzleProjectV5[]; + nextPageCursor: string; } ⋮---- -export interface CollateralAdjustmentHistoryV5 { - adjustId: number; - adjustTime: number; - afterLTV: string; - amount: string; - collateralCurrency: string; - direction: number; - preLTV: string; +export interface TokenSplashProjectV5 { status: number; + projectId: string; + activityCoin: string; + rewardCoin: string; + totalReward: string; + participantCount: string; + registrationStartTime: string; + activityEndTime: string; } ⋮---- -export interface BorrowListV5 { - fixedTotalDebt: string; - fixedTotalDebtUSD: string; - flexibleHourlyInterestRate: string; - flexibleTotalDebt: string; - flexibleTotalDebtUSD: string; - loanCurrency: string; +export interface TokenSplashProjectListResultV5 { + list: TokenSplashProjectV5[]; + nextPageCursor: string; } ⋮---- -export interface CollateralListV5 { - amount: string; - amountUSD: string; - currency: string; - ltv: string; +export interface TokenSplashTradeTaskV5 { + tradeRequiredAmount: string; + tradeUnit: string; + /** Token counted by the trade task. On-chain tasks use the activity token ID. */ + tradeToken?: string; + tradedAmount: string; + maxRewardAmount: string; + estimatedRewardAmount: string; + rewardCoin: string; } ⋮---- -export interface SupplyListV5 { - amount: string; - amountUSD: string; - currency: string; -} +/** Token counted by the trade task. On-chain tasks use the activity token ID. */ ⋮---- -export interface CryptoLoanPositionV5 { - borrowList: BorrowListV5[]; - collateralList: CollateralListV5[]; - supplyList: SupplyListV5[]; - totalCollateral: string; - totalDebt: string; - totalSupply: string; - colRes?: string; +export interface TokenSplashUserActivityItemV5 { + projectId: string; + activityCoin: string; + tradeTask: TokenSplashTradeTaskV5; } ⋮---- -// Flexible Loan Types +export interface TokenSplashUserActivityResultV5 { + list: TokenSplashUserActivityItemV5[]; +} + +================ +File: src/types/response/v5-trade.ts +================ +import { + CategoryV5, + OrderCancelTypeV5, + OrderCreateTypeV5, + OrderRejectReasonV5, + OrderSideV5, + OrderStatusV5, + OrderTimeInForceV5, + OrderTriggerByV5, + OrderTypeV5, + PositionIdx, + StopOrderTypeV5, +} from '../shared-v5'; ⋮---- -export interface BorrowFlexibleV5 { +export interface OrderResultV5 { orderId: string; + orderLinkId: string; } ⋮---- -export interface RepayFlexibleV5 { - repayId: string; -} -⋮---- -export interface OngoingFlexibleLoanV5 { - hourlyInterestRate: string; - loanCurrency: string; - totalDebt: string; - unpaidAmount: string; - unpaidInterest: string; -} -⋮---- -export interface BorrowHistoryFlexibleV5 { - borrowTime: number; - initialLoanAmount: string; - loanCurrency: string; +export interface AccountOrderV5 { orderId: string; - status: number; + orderLinkId: string; + parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) + blockTradeId: string; + symbol: string; + price: string; + qty: string; + side: OrderSideV5; + isLeverage: '0' | '1'; + positionIdx: PositionIdx; + orderStatus: OrderStatusV5; + createType: OrderCreateTypeV5; + cancelType: OrderCancelTypeV5; + rejectReason: OrderRejectReasonV5; + avgPrice: string; + leavesQty: string; + leavesValue: string; + cumExecQty: string; + cumExecValue: string; + cumExecFee: string; + timeInForce: OrderTimeInForceV5; + orderType: OrderTypeV5; + stopOrderType: StopOrderTypeV5; + orderIv: string; + marketUnit: 'baseCoin' | 'quoteCoin'; + slippageToleranceType: string; + slippageTolerance: string; + triggerPrice: string; + takeProfit: string; + stopLoss: string; + tpslMode: 'Full' | 'Partial' | ''; + ocoTriggerType: + | 'OcoTriggerByUnknown' + | 'OcoTriggerTp' + | 'OcoTriggerBySl' + | ''; + tpLimitPrice: string; + slLimitPrice: string; + tpTriggerBy: OrderTriggerByV5; + slTriggerBy: OrderTriggerByV5; + triggerDirection: 1 | 2; + triggerBy: OrderTriggerByV5; + lastPriceOnCreated: string; + basePrice: string; + reduceOnly: boolean; + closeOnTrigger: boolean; + placeType: 'iv' | 'price' | ''; + smpType: string; + smpGroup: string; + smpOrderId: string; + createdTime: string; + updatedTime: string; + extraFees: string; + cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee + rpiTakerAccess?: boolean; + rpiMatchedQty?: string; + fromAccount?: string; + toAccount?: string; + externalEventType?: string; } ⋮---- -export interface RepaymentHistoryFlexibleV5 { - loanCurrency: string; - repayAmount: string; - repayId: string; - repayStatus: number; - repayTime: number; - repayType: number; -} +parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) ⋮---- -// Fixed Loan Types +cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee ⋮---- -export interface SupplyOrderQuoteFixedV5 { - orderCurrency: string; - term: number; - annualRate: string; - qty: string; +export interface BatchCreateOrderResultV5 { + category: CategoryV5; + symbol: string; + orderId: string; + orderLinkId: string; + createAt?: string; } ⋮---- -export interface BorrowOrderQuoteFixedV5 { - orderCurrency: string; - term: number; - annualRate: string; - qty: string; +export interface BatchOrdersRetExtInfoV5 { + list: { + code: number; + msg: string; + }[]; } ⋮---- -export interface CreateBorrowOrderFixedV5 { +export interface BatchAmendOrderResultV5 { + category: CategoryV5; + symbol: string; orderId: string; + orderLinkId: string; } ⋮---- -export interface CreateSupplyOrderFixedV5 { +export interface BatchCancelOrderResultV5 { + category: CategoryV5; + symbol: string; orderId: string; + orderLinkId: string; } ⋮---- -export interface BorrowContractInfoFixedV5 { - annualRate: string; - autoRepay: string; // Deprecated - borrowCurrency: string; - borrowTime: string; - interestPaid: string; - loanId: string; - orderId: string; - repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment - repaymentTime: string; - residualPenaltyInterest: string; - residualPrincipal: string; - status: number; - term: string; +export interface SpotBorrowCheckResultV5 { + symbol: string; + side: OrderSideV5; + maxTradeQty: string; + maxTradeAmount: string; + spotMaxTradeQty: string; + spotMaxTradeAmount: string; + borrowCoin: string; } ⋮---- -autoRepay: string; // Deprecated -⋮---- -repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment -⋮---- -export interface SupplyContractInfoFixedV5 { - annualRate: string; - supplyCurrency: string; - supplyTime: string; - supplyAmount: string; - interestPaid: string; - supplyId: string; +export interface PreCheckOrderResultV5 { orderId: string; - redemptionTime: string; - penaltyInterest: string; - actualRedemptionTime: string; - status: number; - term: string; + orderLinkId: string; + preImrE4: number; // Initial margin rate before checking (in basis points) + preMmrE4: number; // Maintenance margin rate before checking (in basis points) + postImrE4: number; // Initial margin rate after checking (in basis points) + postMmrE4: number; // Maintenance margin rate after checking (in basis points) } ⋮---- -export interface BorrowOrderInfoFixedV5 { - annualRate: string; - orderId: number; - orderTime: string; - filledQty: string; - orderQty: string; - orderCurrency: string; - state: number; - term: number; - repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment - strategyType?: 'PARTIAL' | 'FULL' | string; +preImrE4: number; // Initial margin rate before checking (in basis points) +preMmrE4: number; // Maintenance margin rate before checking (in basis points) +postImrE4: number; // Initial margin rate after checking (in basis points) +postMmrE4: number; // Maintenance margin rate after checking (in basis points) + +================ +File: src/types/request/v5-crypto-loan.ts +================ +export interface BorrowCryptoLoanParamsV5 { + loanCurrency: string; + loanAmount?: string; + loanTerm?: string; + collateralCurrency: string; + collateralAmount?: string; } ⋮---- -repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment -⋮---- -export interface FixedLoanAvailableInventoryV5 { - currency: string; - term: string; - annualRate: string; - availableInventory: string; - updateTime: string; +export interface GetUnpaidLoanOrdersParamsV5 { + orderId?: string; + loanCurrency?: string; + collateralCurrency?: string; + loanTermType?: string; + loanTerm?: string; + limit?: string; + cursor?: string; } ⋮---- -export interface FlexibleLoanAvailableInventoryV5 { - currency: string; - availableInventory: string; - updateTime: string; +export interface GetRepaymentHistoryParamsV5 { + orderId?: string; + repayId?: string; + loanCurrency?: string; + limit?: string; + cursor?: string; } ⋮---- -export interface SupplyOrderInfoFixedV5 { - annualRate: string; - orderId: number; - orderTime: string; - filledQty: string; - orderQty: string; - orderCurrency: string; - state: number; - term: number; +export interface GetCompletedLoanOrderHistoryParamsV5 { + orderId?: string; + loanCurrency?: string; + collateralCurrency?: string; + limit?: string; + cursor?: string; } ⋮---- -export interface RepayFixedV5 { - repayId: string; +export interface GetLoanLTVAdjustmentHistoryParamsV5 { + orderId?: string; + adjustId?: string; + collateralCurrency?: string; + limit?: string; + cursor?: string; } ⋮---- -export interface RepaymentHistoryFixedV5 { - details: { - loanCurrency: string; - loanId: string; - repayAmount: string; - }[]; - loanCurrency: string; - repayAmount: string; - repayId: string; - repayStatus: number; - repayTime: number; - repayType: number; +// New Crypto Loan Request Types +⋮---- +export interface GetBorrowableCoinsParamsV5 { + vipLevel?: string; + currency?: string; } ⋮---- -export interface RenewBorrowOrderFixedV5 { - orderId: string; +export interface GetCollateralCoinsParamsV5 { + currency?: string; } ⋮---- -export interface RenewOrderInfoFixedV5 { - amount: string; - autoRepay: number; - borrowCurrency: string; - contractNo: string; - dueTime: string; - loanId: string; - orderId: number; - renewLoanNo: string; - time: string; +export interface GetMaxCollateralAmountParamsV5 { + currency: string; } ⋮---- -// Institutional Loan Types +export interface AdjustCollateralAmountParamsV5 { + currency: string; + amount: string; + direction: '0' | '1'; +} ⋮---- -export interface InstitutionalLendingProductInfoV5 { - productId: string; - leverage: string; - supportSpot: number; - supportContract: number; - supportMarginTrading: number; - withdrawLine: string; - transferLine: string; - spotBuyLine: string; - spotSellLine: string; - contractOpenLine: string; - liquidationLine: string; - stopLiquidationLine: string; - contractLeverage: string; - transferRatio: string; - spotSymbols: unknown[]; - contractSymbols: unknown[]; - supportUSDCContract: number; - supportUSDCOptions: number; - USDTPerpetualOpenLine?: string; - USDCContractOpenLine?: string; - USDCOptionsOpenLine?: string; - USDTPerpetualCloseLine?: string; - USDCContractCloseLine?: string; - USDCOptionsCloseLine?: string; - USDTPerpetualLeverage?: { symbol: string; leverage: string }[]; - USDCContractLeverage?: { symbol: string; leverage: string }[]; - deferredLiquidationLine?: string; - deferredLiquidationTime?: string; - marginLeverage?: string; - /** `0`: Default, `1`: CTA, `2`: Hedge */ - productType?: '0' | '1' | '2' | string; +export interface GetCollateralAdjustmentHistoryParamsV5 { + adjustId?: string; + collateralCurrency?: string; + limit?: string; + cursor?: string; } ⋮---- -/** `0`: Default, `1`: CTA, `2`: Hedge */ +// Flexible Loan Request Types ⋮---- -export interface InstitutionalLendingCoinDeltaItemV5 { - coin: string; - coinDeltaSize: string; - coinDeltaAvailableAmount: string; - coinDeltaAmount: string; +export interface BorrowFlexibleParamsV5 { + loanCurrency: string; + loanAmount: string; + collateralList?: { + currency: string; + amount: string; + }[]; } ⋮---- -export interface InstitutionalLendingCoinDeltaAmountV5 { - riskUnitDeltaAmount: string; - riskUnitDeltaAvailableAmount: string; - riskUnitDelta?: string; - list: InstitutionalLendingCoinDeltaItemV5[]; +export interface RepayFlexibleParamsV5 { + loanCurrency: string; + amount: string; } ⋮---- -export interface InstitutionalLendingDelayLiquidationStatusV5 { - ltv: string; - /** 0 normal, 1 passive liquidation, 2 callback liquidation, 3 delay liquidation */ - liquidationStatus: 0 | 1 | 2 | 3; - delayLiqStartTime: string; - delayLiqRemainingSec: string; +export interface RepayCollateralFlexibleParamsV5 { + loanCurrency: string; + collateralCoin: string; + amount: string; } ⋮---- -/** 0 normal, 1 passive liquidation, 2 callback liquidation, 3 delay liquidation */ -⋮---- -export interface UnpaidInfoV5 { - token: string; // Coin - unpaidQty: string; // Unpaid principle - unpaidInterest: string; // Unpaid interest +export interface GetOngoingFlexibleLoansParamsV5 { + loanCurrency?: string; } ⋮---- -token: string; // Coin -unpaidQty: string; // Unpaid principle -unpaidInterest: string; // Unpaid interest -⋮---- -export interface BalanceInfoV5 { - token: string; // Margin coin - price: string; // Margin coin price - qty: string; // Margin coin quantity - convertedAmount: string; // Margin conversion amount +export interface GetBorrowHistoryFlexibleParamsV5 { + orderId?: string; + loanCurrency?: string; + limit?: string; + cursor?: string; } ⋮---- -token: string; // Margin coin -price: string; // Margin coin price -qty: string; // Margin coin quantity -convertedAmount: string; // Margin conversion amount -⋮---- -export interface LTVInfoV5 { - ltv: string; // Risk rate (when liqStatus != 0, returns empty string) - rst: string; // Remaining liquidation time in UTC seconds (when liqStatus != 0, returns empty string) - parentUid: string; // The designated Risk Unit ID - subAccountUids: string[]; // Bound user IDs - unpaidAmount: string; // Total debt in USDT (when liqStatus != 0, returns empty string) - unpaidInfo: UnpaidInfoV5[]; // Debt details (when liqStatus != 0, returns empty array) - balance: string; // Total asset in USDT (when liqStatus != 0, returns empty string) - balanceInfo: BalanceInfoV5[]; // Asset details (when liqStatus != 0, returns empty array) - liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress +export interface GetRepaymentHistoryFlexibleParamsV5 { + repayId?: string; + loanCurrency?: string; + limit?: string; + cursor?: string; } ⋮---- -ltv: string; // Risk rate (when liqStatus != 0, returns empty string) -rst: string; // Remaining liquidation time in UTC seconds (when liqStatus != 0, returns empty string) -parentUid: string; // The designated Risk Unit ID -subAccountUids: string[]; // Bound user IDs -unpaidAmount: string; // Total debt in USDT (when liqStatus != 0, returns empty string) -unpaidInfo: UnpaidInfoV5[]; // Debt details (when liqStatus != 0, returns empty array) -balance: string; // Total asset in USDT (when liqStatus != 0, returns empty string) -balanceInfo: BalanceInfoV5[]; // Asset details (when liqStatus != 0, returns empty array) -liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress +// Fixed Loan Request Types ⋮---- -export interface InstitutionalLoanLTVV5 { - ltvInfo: LTVInfoV5[]; // LTV info array - liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress +export interface GetSupplyOrderQuoteFixedParamsV5 { + orderCurrency: string; + term?: string; + orderBy: 'apy' | 'term' | 'quantity'; + sort?: number; + limit?: number; } ⋮---- -ltvInfo: LTVInfoV5[]; // LTV info array -liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress -⋮---- -export interface RepayInstitutionalLoanResultV5 { - repayOrderStatus: string; // P: processing +export interface GetBorrowOrderQuoteFixedParamsV5 { + orderCurrency: string; + term?: string; + orderBy: 'apy' | 'term' | 'quantity'; + sort?: number; + limit?: number; } ⋮---- -repayOrderStatus: string; // P: processing +export interface CreateBorrowOrderFixedParamsV5 { + orderCurrency: string; + orderAmount: string; + annualRate: string; + term: string; + autoRepay?: string; // Deprecated + repayType?: string; // 1: Auto Repayment (default); 2: Transfer to flexible loan + strategyType?: 'PARTIAL' | 'FULL'; + collateralList?: { + currency: string; + amount: string; + }[]; +} ⋮---- -// Max Loan Amount Response Types +autoRepay?: string; // Deprecated +repayType?: string; // 1: Auto Repayment (default); 2: Transfer to flexible loan ⋮---- -export interface MaxLoanAmountV5 { - currency: string; // Coin to borrow - maxLoan: string; // Maximum borrowable amount based on current collateral - notionalUsd: string; // Notional USD value - remainingQuota: string; // Remaining individual platform borrowing limit (shared between main and sub accounts) +export interface GetFixedLoanAvailableInventoryParamsV5 { + currency: string; + term: string; + annualRate: string; } ⋮---- -currency: string; // Coin to borrow -maxLoan: string; // Maximum borrowable amount based on current collateral -notionalUsd: string; // Notional USD value -remainingQuota: string; // Remaining individual platform borrowing limit (shared between main and sub accounts) - -================ -File: src/websocket-client.ts -================ -/* eslint-disable @typescript-eslint/no-unused-vars */ -⋮---- -import { - MessageEventLike, - WSCategoryV5, - WSClientConfigurableOptions, - WsKey, - WsMarket, - WsTopic, -} from './types'; -import { - Exact, - WSAPIOperation, - WsAPIOperationResponseMap, - WSAPIRequest, - WsAPITopicRequestParamMap, - WsAPIWsKeyTopicMap, - WsOperation, - WsRequestOperationBybit, -} from './types/websockets/ws-api'; -import { - APIID, - DefaultLogger, - getMaxTopicsPerSubscribeEvent, - getNormalisedTopicRequests, - getPromiseRefForWSAPIRequest, - getTopicsPerWSKey, - getWsKeyForTopic, - getWsUrl, - isPrivateWsTopic, - isTopicSubscriptionConfirmation, - isTopicSubscriptionSuccess, - isWSAPIResponse, - isWsPong, - neverGuard, - WS_AUTH_ON_CONNECT_KEYS, - WS_KEY_MAP, - WSConnectedResult, - WsTopicRequest, -} from './util'; -import { - BaseWebsocketClient, - EmittableEvent, - MidflightWsRequestEvent, -} from './util/BaseWSClient'; -import { SignAlgorithm, signMessage } from './util/webCryptoAPI'; +export interface GetFlexibleLoanAvailableInventoryParamsV5 { + currency: string; +} ⋮---- -export interface WSAPIRequestFlags { - /** If true, will skip auth requirement for WS API connection */ - authIsOptional?: boolean | undefined; +export interface CreateSupplyOrderFixedParamsV5 { + orderCurrency: string; + orderAmount: string; + annualRate: string; + term: string; + /** + * Source account for supply. 0: Funding Account; 1: Earn Flexible Account; 2: ALL. Default: 0 + */ + availableSource?: '0' | '1' | '2'; } ⋮---- -/** If true, will skip auth requirement for WS API connection */ -⋮---- -export class WebsocketClient extends BaseWebsocketClient< +/** + * Source account for supply. 0: Funding Account; 1: Earn Flexible Account; 2: ALL. Default: 0 + */ ⋮---- -constructor(options?: WSClientConfigurableOptions, logger?: DefaultLogger) +export interface CancelBorrowOrderFixedParamsV5 { + orderId: string; +} ⋮---- -/** - * Request connection of all dependent (public & private) websockets, instead of waiting - * for automatic connection by SDK. +export interface CancelSupplyOrderFixedParamsV5 { + orderId: string; + /** + * Account to receive the refund. 0: Funding Account; 1: EasyEarn. Default: 0 */ -public connectAll(): Promise[] + refundedAccount?: '0' | '1'; +} ⋮---- /** - * Ensures the WS API connection is active and ready. - * - * You do not need to call this, but if you call this before making any WS API requests, - * it can accelerate the first request (by preparing the connection in advance). + * Account to receive the refund. 0: Funding Account; 1: EasyEarn. Default: 0 */ -public connectWSAPI(): Promise ⋮---- -/** This call automatically ensures the connection is active AND authenticated before resolving */ +export interface GetBorrowContractInfoFixedParamsV5 { + orderId?: string; + loanId?: string; + orderCurrency?: string; + term?: string; + limit?: string; + cursor?: string; +} ⋮---- -public connectPublic(): Promise[] +export interface GetSupplyContractInfoFixedParamsV5 { + orderId?: string; + supplyId?: string; + supplyCurrency?: string; + term?: string; + limit?: string; + cursor?: string; +} ⋮---- -public connectPrivate(): Promise +export interface GetBorrowOrderInfoFixedParamsV5 { + orderId?: string; + orderCurrency?: string; + state?: string; + term?: string; + limit?: string; + cursor?: string; +} ⋮---- -/** - * Subscribe to V5 topics & track/persist them. - * @param wsTopics - topic or list of topics - * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). - * The value is only important when connecting to public topics and will be ignored for private topics. - * @param isPrivateTopic - optional - the library will try to detect private topics, you can use this - * to mark a topic as private (if the topic isn't recognised yet) - */ -public subscribeV5( - wsTopics: WsTopic[] | WsTopic, - category: WSCategoryV5, - isPrivateTopic?: boolean, - ): Promise[] +export interface GetSupplyOrderInfoFixedParamsV5 { + orderId?: string; + orderCurrency?: string; + state?: string; + term?: string; + limit?: string; + cursor?: string; +} ⋮---- -// Sort into per-WsKey batches, in case there is a mix of topics here +export interface RepayFixedParamsV5 { + loanId?: string; + loanCurrency?: string; +} ⋮---- -// Prevent duplicate requests to the same topic +export interface RepayCollateralFixedParamsV5 { + loanCurrency: string; + collateralCoin: string; + amount: string; +} ⋮---- -// Batch sub topics per ws key +export interface GetRepaymentHistoryFixedParamsV5 { + repayId?: string; + loanCurrency?: string; + limit?: string; + cursor?: string; +} ⋮---- -// Return promise to resolve midflight WS request (only works if already connected before request) +export interface RenewBorrowOrderFixedParamsV5 { + loanId: string; + collateralList?: { + currency?: string; + amount?: string; + }[]; +} ⋮---- -/** - * Unsubscribe from V5 topics & remove them from memory. They won't be re-subscribed to if the - * connection reconnects. - * - * @param wsTopics - topic or list of topics - * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). The value is only - * important when connecting to public topics and will be ignored for private topics. - * @param isPrivateTopic - optional - the library will try to detect private topics, you can - * use this to mark a topic as private (if the topic isn't recognised yet) - */ -public unsubscribeV5( - wsTopics: WsTopic[] | WsTopic, - category: WSCategoryV5, - isPrivateTopic?: boolean, - ): Promise[] +export interface GetRenewOrderInfoFixedParamsV5 { + orderId?: string; + orderCurrency?: string; + limit?: string; + cursor?: string; +} ⋮---- -// Sort into per-WsKey batches, in case there is a mix of topics here +// Max Loan Amount Request Types ⋮---- -// Batch sub topics per ws key +export interface GetMaxLoanAmountParamsV5 { + currency: string; // Coin to borrow + collateralList?: { + ccy: string; // Collateral coin + amount: string; // Collateral amount + }[]; +} ⋮---- -// Return promise to resolve midflight WS request (only works if already connected before request) +currency: string; // Coin to borrow ⋮---- -/** - * Note: subscribeV5() might be simpler to use. The end result is the same. - * - * Request subscription to one or more topics. Pass topics as either an array of strings, - * or array of objects (if the topic has parameters). - * - * Objects should be formatted as {topic: string, params: object, category: WSCategoryV5}. - * - * - Subscriptions are automatically routed to the correct websocket connection. - * - Authentication/connection is automatic. - * - Resubscribe after network issues is automatic. - * - * Call `unsubscribe(topics)` to remove topics - */ -public subscribe( - requests: - | (WsTopicRequest | WsTopic) - | (WsTopicRequest | WsTopic)[], - requestedWsKey?: WsKey, - ) +ccy: string; // Collateral coin +amount: string; // Collateral amount ⋮---- -// Batch sub topics per ws key +// Institutional Loan Request Types ⋮---- -/** - * Note: unsubscribe() might be simpler to use. The end result is the same. - * Unsubscribe from one or more topics. Similar to subscribe() but in reverse. - * - * - Requests are automatically routed to the correct websocket connection. - * - These topics will be removed from the topic cache, so they won't be subscribed to again. - */ -public unsubscribe( - requests: - | (WsTopicRequest | WsTopic) - | (WsTopicRequest | WsTopic)[], - wsKey?: WsKey, - ) +export interface GetCoinDeltaAmountParamsV5 { + coin?: string; +} +⋮---- +export interface RepayInstitutionalLoanParamsV5 { + token: string; // Coin name + quantity: string; // The qty to be repaid +} +⋮---- +token: string; // Coin name +quantity: string; // The qty to be repaid + +================ +File: src/types/request/v5-earn.ts +================ +export interface GetEarnCouponListParamsV5 { + category: 'FlexibleSaving' | 'DualAssets'; +} +⋮---- +/** GET /v5/earn/flexible-saving/auto-savings. coins is a repeated query param, max 50. */ +export interface GetFlexibleSavingAutoSavingsParamsV5 { + coins?: string[]; +} +⋮---- +/** POST /v5/earn/flexible-saving/auto-savings. Omit coin to update the global setting. */ +export interface SetFlexibleSavingAutoSavingsParamsV5 { + coin?: string; + isSelected: boolean; + purchaseImmediately?: boolean; +} +⋮---- +export interface SubmitStakeRedeemParamsV5 { + category: string; + orderType: 'Stake' | 'Redeem'; + accountType: 'FUND' | 'UNIFIED'; + amount: string; + coin: string; + productId: string; + orderLinkId: string; + toAccountType?: 'FUND' | 'UNIFIED'; +} +⋮---- +export interface GetEarnOrderHistoryParamsV5 { + category: string; + orderId?: string; + orderLinkId?: string; + productId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} +⋮---- +export interface GetEarnPositionParamsV5 { + category: string; + productId?: string; + coin?: string; +} +⋮---- +export interface GetEarnYieldHistoryParamsV5 { + category: string; + productId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} +⋮---- +export interface GetEarnHourlyYieldHistoryParamsV5 { + category: string; + productId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} +⋮---- +export interface ModifyEarnPositionParamsV5 { + category: 'OnChain'; + productId: number; + positionId: number; + autoReinvest: 0 | 1; +} ⋮---- -// Batch sub topics per ws key +export interface GetEarnAprHistoryParamsV5 { + category: 'FlexibleSaving' | 'OnChain'; + productId: string; + startTime?: number; + endTime?: number; +} ⋮---- /** - * - * - * - * WS API Methods - similar to the REST API, but via WebSockets - * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline - * - * - * + * GET /v5/earn/advance/product — Advanced Earn: Dual Asset, Double Win, Smart Leverage, etc. + * Public, no auth. Rate limit: 50 req/s per IP. + */ +export interface GetAdvanceEarnProductParamsV5 { + category: 'DualAssets' | 'DoubleWin' | 'SmartLeverage' | 'DiscountBuy'; + coin?: string; + /** + * Product duration, e.g. 8h, 1d, 2d, 3d, 6d, 7d, 12d (depends on product). */ + duration?: string; +} ⋮---- /** - * Send a Websocket API command/request on a connection. Returns a promise that resolves on reply. - * - * WS API Documentation for list of operations and parameters: - * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline - * - * Returned promise is rejected if: - * - an exception is detected in the reply, OR - * - the connection disconnects for any reason (even if automatic reconnect will happen). - * - * Authentication is automatic. If you didn't request authentication yourself, there might - * be a small delay after your first request, while the SDK automatically authenticates. - * - * @param wsKey - The connection this event is for. Currently only "v5PrivateTrade" is supported - * for Bybit, since that is the dedicated WS API connection. - * @param operation - The command being sent, e.g. "order.create" to submit a new order. - * @param params - Any request parameters for the command. E.g. `OrderParamsV5` to submit a new - * order. Only send parameters for the request body. Everything else is automatically handled. - * @returns Promise - tries to resolve with async WS API response. Rejects if disconnected or exception is seen in async WS API response + * Product duration, e.g. 8h, 1d, 2d, 3d, 6d, 7d, 12d (depends on product). */ ⋮---- -// This overload allows the caller to omit the 3rd param, if it isn't required -sendWSAPIRequest< - TWSKey extends keyof WsAPIWsKeyTopicMap, - TWSOperation extends WsAPIWsKeyTopicMap[TWSKey], - TWSParams extends Exact, - >( - wsKey: TWSKey, - operation: TWSOperation, - params?: TWSParams extends void | never ? undefined : TWSParams, - requestFlags?: WSAPIRequestFlags, - ): Promise; +/** GET /v5/earn/hold-to-earn/yield-history — Hold to Earn airdrop daily PnL (Earn permission) */ +export interface GetHoldToEarnAirdropYieldHistoryParamsV5 { + /** Unix seconds. Cannot be earlier than now minus 3 months */ + timeStart?: number; + /** Unix seconds. Requires timeStart ≤ timeEnd */ + timeEnd?: number; + /** Page size [1, 49] */ + limit: number; + /** Pagination cursor from previous `nextCursor` */ + cursor?: string; +} ⋮---- -// These overloads give stricter types than mapped generics, since generic constraints -// do not trigger excess property checks -// Without these overloads, TypeScript won't complain if you include an -// unexpected property with your request (if it doesn't clash with an existing property) -sendWSAPIRequest( - wsKey: typeof WS_KEY_MAP.v5PrivateTrade, - operation: TWSOperation, - params: WsAPITopicRequestParamMap[TWSOperation], - requestFlags?: WSAPIRequestFlags, - ): Promise; +/** Unix seconds. Cannot be earlier than now minus 3 months */ ⋮---- -sendWSAPIRequest( - wsKey: typeof WS_KEY_MAP.v5PrivateTrade, - operation: TWSOperation, - params: WsAPITopicRequestParamMap[TWSOperation], - requestFlags?: WSAPIRequestFlags, - ): Promise; +/** Unix seconds. Requires timeStart ≤ timeEnd */ ⋮---- -sendWSAPIRequest( - wsKey: typeof WS_KEY_MAP.v5PrivateTrade, - operation: TWSOperation, - params: WsAPITopicRequestParamMap[TWSOperation], - requestFlags?: WSAPIRequestFlags, - ): Promise; +/** Page size [1, 49] */ ⋮---- -async sendWSAPIRequest< - TWSKey extends keyof WsAPIWsKeyTopicMap, - TWSOperation extends WsAPIWsKeyTopicMap[TWSKey], - TWSParams extends Exact, - TWSAPIResponse extends - WsAPIOperationResponseMap[TWSOperation] = WsAPIOperationResponseMap[TWSOperation], - >( - wsKey: WsKey = WS_KEY_MAP.v5PrivateTrade, - operation: TWSOperation, - params: TWSParams, - requestFlags?: WSAPIRequestFlags, - ): Promise +/** Pagination cursor from previous `nextCursor` */ + +================ +File: src/types/request/v5-spot-leverage-token.ts +================ +import { LTOrderTypeV5 } from '../shared-v5'; ⋮---- -// Some commands don't require authentication. +export interface PurchaseSpotLeveragedTokenParamsV5 { + ltCoin: string; + amount: string; + serialNo?: string; +} ⋮---- -// Sign, if needed +export interface RedeemSpotLeveragedTokenParamsV5 { + ltCoin: string; + quantity: string; + serialNo?: string; +} ⋮---- -// Store deferred promise, resolved within the "resolveEmittableEvents" method while parsing incoming events +export interface GetSpotLeveragedTokenOrderHistoryParamsV5 { + ltCoin?: string; + orderId?: string; + startTime?: number; + endTime?: number; + limit?: number; + ltOrderType?: LTOrderTypeV5; + serialNo?: string; +} ⋮---- -// eslint-disable-next-line @typescript-eslint/no-explicit-any +export interface GetVIPMarginDataParamsV5 { + vipLevel?: string; + currency?: string; +} ⋮---- -// Enrich returned promise with request context for easier debugging +export interface GetSpotMarginCurrencyDataParamsV5 { + currency?: string; +} ⋮---- -// throw e; +// Spot Margin Trade (UTA) endpoints +export interface ManualBorrowParamsV5 { + coin: string; + amount: string; +} ⋮---- -// Send event +export interface GetMaxBorrowableAmountParamsV5 { + currency: string; +} ⋮---- -// Return deferred promise, so caller can await this call +export interface GetPositionTiersParamsV5 { + currency?: string; +} ⋮---- -/** - * - * - * Internal methods - not intended for public use - * - * +export interface GetCoinStateParamsV5 { + currency?: string; +} +⋮---- +export interface GetAvailableAmountToRepayParamsV5 { + currency: string; +} +⋮---- +export interface SetSpotMarginLeverageParamsV5 { + leverage: string; + currency?: string; +} +⋮---- +export interface ManualRepayWithoutConversionParamsV5 { + coin: string; + amount?: string; + /** + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. */ + repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; +} ⋮---- /** - * Note: implementing this method will wipe the WsStore state for this WsKey, once this method returns + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. */ -protected isCustomReconnectionNeeded(): boolean ⋮---- -protected async triggerCustomReconnectionWorkflow(): Promise +export interface GetAutoRepayModeParamsV5 { + currency?: string; // Coin name, uppercase only. If not passed, returns all currencies +} ⋮---- -/** - * @returns The WS URL to connect to for this WS key - */ -protected async getWsUrl(wsKey: WsKey): Promise +currency?: string; // Coin name, uppercase only. If not passed, returns all currencies ⋮---- -// If auth is needed for this wsKey URL, this returns a suffix +export interface SetAutoRepayModeParamsV5 { + /** Coin name, uppercase only. If omitted, sets the global switch; when enabled, includes currencies that become borrowable later */ + currency?: string; + autoRepayMode: '0' | '1'; // 0: Off, 1: On +} ⋮---- -/** - * Return params required to make authorized request - */ -private async getWsAuthURLSuffix(): Promise +/** Coin name, uppercase only. If omitted, sets the global switch; when enabled, includes currencies that become borrowable later */ ⋮---- -private async signMessage( - paramsStr: string, - secret: string, - method?: 'hex' | 'base64', - algorithm: SignAlgorithm = 'SHA-256', - ): Promise +autoRepayMode: '0' | '1'; // 0: Off, 1: On ⋮---- -protected async getWsAuthRequestEvent( - wsKey: WsKey, - ): Promise> +export interface SetTradeAutoRepayParamsV5 { + /** 1: enable trade auto repayment; 0: disable */ + autoRepay: '0' | '1'; +} ⋮---- -private async getWsAuthSignature( - wsKey: WsKey, - ): Promise<{ expiresAt: number; signature: string }> +/** 1: enable trade auto repayment; 0: disable */ ⋮---- -undefined, // Let the function automatically determine encoding based on key type +export interface GetSpotMarginLiabilityInfoParamsV5 { + currency: string; +} ⋮---- -private async signWSAPIRequest( - requestEvent: WSAPIRequest, - ): Promise> +export interface FixedRateBorrowParamsV5 { + orderCurrency: string; + orderAmount: string; + /** e.g. 0.02 = 2% p.a. */ + annualRate: string; + /** 7, 14, 30, 90, 180 (days) */ + term: string; + /** 1: auto repayment; 2: transfer to flexible loan */ + repayType?: '1' | '2'; +} ⋮---- -// Not needed for Bybit. Auth happens only on connection open, automatically. +/** e.g. 0.02 = 2% p.a. */ ⋮---- -protected sendPingEvent(wsKey: WsKey) +/** 7, 14, 30, 90, 180 (days) */ ⋮---- -protected sendPongEvent(wsKey: WsKey) +/** 1: auto repayment; 2: transfer to flexible loan */ +⋮---- +export interface GetFixedRateBorrowOrderInfoParamsV5 { + orderId?: string; + orderCurrency?: string; + state?: string; + term?: string; + limit?: string; + cursor?: string; +} ⋮---- -/** Force subscription requests to be sent in smaller batches, if a number is returned */ -protected getMaxTopicsPerSubscribeEvent(wsKey: WsKey): number | null +export interface GetFixedRateBorrowContractInfoParamsV5 { + orderId?: string; + orderCurrency?: string; + term?: string; + limit?: string; + cursor?: string; +} ⋮---- -protected authPrivateConnectionsOnConnect(_wsKey: WsKey): boolean +export interface GetFixedRateBorrowOrderQuoteParamsV5 { + orderCurrency: string; + term?: string; + orderBy?: 'apy' | 'term' | 'quantity'; + sort?: 0 | 1; + limit?: number; +} ⋮---- -/** - * @returns one or more correctly structured request events for performing a operations over WS. This can vary per exchange spec. - */ -protected async getWsRequestEvents( - market: WsMarket, - operation: WsOperation, - requests: WsTopicRequest[], - // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars - _wsKey: WsKey, - ): Promise>[]> +export interface RenewFixedRateBorrowParamsV5 { + loanId: string; + qty?: string; +} ⋮---- -// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars +export interface GetFixedRateBorrowInterestAccruedParamsV5 { + orderId?: string; + orderCurrency?: string; + limit?: string; + cursor?: string; +} ⋮---- -// Previously used to track topics in a request. Keeping this for subscribe/unsubscribe requests, no need for incremental values +export interface CancelFixedRateBorrowOrderParamsV5 { + orderId: string; +} ⋮---- -protected getPrivateWSKeys(): WsKey[] +export interface GetFlexibleAvailableInventoryParamsV5 { + currency: string; +} ⋮---- -protected isAuthOnConnectWsKey(wsKey: WsKey): boolean +export interface GetFixedRateAvailableInventoryParamsV5 { + currency: string; + term: string; + annualRate: string; +} + +================ +File: src/types/response/v5-account.ts +================ +import { + AccountMarginModeV5, + AccountTypeV5, + CategoryV5, + TransactionTypeV5, + UnifiedUpdateStatusV5, +} from '../shared-v5'; ⋮---- -/** - * Determines if a topic is for a private channel, using a hardcoded list of strings - */ -protected isPrivateTopicRequest(request: WsTopicRequest): boolean +export interface WalletBalanceV5Coin { + coin: string; + equity: string; + usdValue: string; + walletBalance: string; + free: string; // spot only + locked: string; // spot only + borrowAmount: string; + availableToBorrow: string; // deprecated field + availableToWithdraw: string; + accruedInterest: string; + totalOrderIM: string; + totalPositionIM: string; + totalPositionMM: string; + unrealisedPnl: string; + cumRealisedPnl: string; + bonus: string; + marginCollateral: boolean; + collateralSwitch: boolean; + spotBorrow: string; + colRes?: string; +} ⋮---- -// eslint-disable-next-line @typescript-eslint/no-explicit-any -protected isWsPing(msg: any): boolean +free: string; // spot only +locked: string; // spot only ⋮---- -// eslint-disable-next-line @typescript-eslint/no-explicit-any -protected isWsPong(msg: any): boolean +availableToBorrow: string; // deprecated field ⋮---- -// public ws connections +export interface WalletBalanceV5 { + accountType: AccountTypeV5; + accountLTV: string; + accountIMRate: string; + accountMMRate: string; + accountIMRateByMp: string; + accountMMRateByMp: string; + totalInitialMarginByMp: string; + totalMaintenanceMarginByMp: string; + totalEquity: string; + totalWalletBalance: string; + totalMarginBalance: string; + totalAvailableBalance: string; + totalPerpUPL: string; + totalInitialMargin: string; + totalMaintenanceMargin: string; + coin: WalletBalanceV5Coin[]; +} ⋮---- -// private ws connections +export interface UnifiedAccountUpgradeResultV5 { + unifiedUpdateStatus: UnifiedUpdateStatusV5; + unifiedUpdateMsg: { + msg: string[] | null; + }; +} ⋮---- -/** - * Abstraction called to sort ws events into emittable event types (response to a request, data update, etc) - */ -protected resolveEmittableEvents( - wsKey: WsKey, - event: MessageEventLike, - ): EmittableEvent[] +export interface BorrowHistoryRecordV5 { + currency: string; + createdTime: number; + borrowCost: string; + hourlyBorrowRate: string; + InterestBearingBorrowSize: string; + costExemption: string; + borrowAmount: string; + unrealisedLoss: string; + freeBorrowedAmount: string; +} ⋮---- -// this.logger.trace('resolveEmittableEvents', { -// ...WS_LOGGER_CATEGORY, -// wsKey, -// parsed: JSON.stringify(parsed), -// }); +export interface CollateralInfoV5 { + currency: string; + hourlyBorrowRate: string; + maxBorrowingAmount: string; + freeBorrowAmount: string; + freeBorrowingLimit: string; + borrowAmount: string; + availableToBorrow: string; + borrowable: boolean; + borrowUsageRate: string; + marginCollateral: boolean; + collateralSwitch: boolean; + collateralRatio: string; +} ⋮---- -// Only applies to the V5 WS topics +export interface CoinGreeksV5 { + baseCoin: string; + totalDelta: string; + totalGamma: string; + totalVega: string; + totalTheta: string; +} ⋮---- -// WS API response +export interface FeeRateV5 { + symbol: string; + baseCoin: string; + takerFeeRate: string; + makerFeeRate: string; + rpiMakerFeeRate?: string; +} ⋮---- -// eslint-disable-next-line max-len +export interface AccountInfoV5 { + unifiedMarginStatus: number; + marginMode: AccountMarginModeV5; + isMasterTrader: boolean; + spotHedgingStatus: string; + updatedTime: string; +} ⋮---- -// WS API Exception +/** + * Get Trade Behaviour Config / `getLimitPriceAction()` — `/v5/account/user-setting-config` + */ +export interface UserSettingConfigV5 { + lpaSpot: boolean; + lpaPerp: boolean; + /** Spot MNT fee deduction enabled. */ + smsef?: boolean; + /** Futures MNT fee deduction enabled. */ + fmsef?: boolean; + /** Delta Neutral mode; may be absent on older API responses. */ + deltaEnable?: boolean; + smpType?: '0' | '1' | '2' | '3' | string; +} ⋮---- -// WS API Success +/** Spot MNT fee deduction enabled. */ ⋮---- -// Messages for a subscribed topic all include the "topic" property +/** Futures MNT fee deduction enabled. */ ⋮---- -// Messages that are a "reply" to a request/command (e.g. subscribe to these topics) typically include the "op" property +/** Delta Neutral mode; may be absent on older API responses. */ ⋮---- -// Failed request +export interface TransactionLogV5 { + symbol: string; + category: CategoryV5; + side: string; + transactionTime: string; + type: TransactionTypeV5; + qty: string; + size: string; + currency: string; + tradePrice: string; + funding: string; + fee: string; + cashFlow: string; + change: string; + cashBalance: string; + feeRate: string; + bonusChange: string; + tradeId: string; + orderId: string; + orderLinkId: string; + extraFees: string; + transSubType: string; + displayType?: string; +} ⋮---- -// These are r equest/reply pattern events (e.g. after subscribing to topics or authenticating) +export interface MMPStateV5 { + baseCoin: string; + mmpEnabled: boolean; + window: string; + frozenPeriod: string; + qtyLimit: string; + deltaLimit: string; + vegaLimit?: string; + mmpFrozenUntil: string; + mmpFrozen: boolean; +} ⋮---- -// Request/reply pattern for authentication success +export interface RepayLiabilityResultV5 { + coin: string; + repaymentQty: string; +} ⋮---- -// In case of catastrophic failure, fallback to noisy emit update - -================ -File: src/types/request/v5-earn.ts -================ -export interface GetEarnCouponListParamsV5 { - category: 'FlexibleSaving' | 'DualAssets'; +export interface DCPInfoV5 { + product: 'SPOT' | 'DERIVATIVES' | 'OPTIONS'; + dcpStatus: 'ON'; + timeWindow: string; } ⋮---- -/** GET /v5/earn/flexible-saving/auto-savings. coins is a repeated query param, max 50. */ -export interface GetFlexibleSavingAutoSavingsParamsV5 { - coins?: string[]; +export interface ManualRepayResultV5 { + resultStatus: 'P' | 'SU' | 'FA'; } ⋮---- -/** POST /v5/earn/flexible-saving/auto-savings. Omit coin to update the global setting. */ -export interface SetFlexibleSavingAutoSavingsParamsV5 { - coin?: string; - isSelected: boolean; - purchaseImmediately?: boolean; +/** GET /v5/account/option-asset-info — response `result` wraps a nested `result` array. */ +export interface OptionAssetInfoRowV5 { + coin: string; + totalDelta: string; + totalRPL: string; + totalUPL: string; + assetIM: string; + assetMM: string; + sendTime: number; } ⋮---- -export interface SubmitStakeRedeemParamsV5 { - category: string; - orderType: 'Stake' | 'Redeem'; - accountType: 'FUND' | 'UNIFIED'; - amount: string; - coin: string; - productId: string; - orderLinkId: string; - toAccountType?: 'FUND' | 'UNIFIED'; +export interface OptionAssetInfoNestedResultV5 { + result: OptionAssetInfoRowV5[]; } ⋮---- -export interface GetEarnOrderHistoryParamsV5 { - category: string; - orderId?: string; - orderLinkId?: string; - productId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +/** GET /v5/account/pay-info */ +export interface PayInfoCollateralItemV5 { + coin: string; + availableSize: string; + availableValue: string; + coinScale: number; + borrowSize: string; + spotHedgeAmount: string; + assetFrozen: string; } ⋮---- -export interface GetEarnPositionParamsV5 { - category: string; - productId?: string; +export interface PayInfoBorrowBlockV5 { coin?: string; + borrowSize: string; + borrowValue?: string; + assetFrozen: string; + availableBalance: string; } ⋮---- -export interface GetEarnYieldHistoryParamsV5 { - category: string; - productId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface PayInfoResultV5 { + collateralInfo: { + collateralList: PayInfoCollateralItemV5[]; + }; + borrowInfo: PayInfoBorrowBlockV5; } ⋮---- -export interface GetEarnHourlyYieldHistoryParamsV5 { - category: string; - productId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +/** GET /v5/account/trade-info-for-analysis */ +export interface TradeInfoAnalysisDailyV5 { + day: string; + sumBuyExecValue: string; + sumSellExecValue: string; + sumExecValue: string; } ⋮---- -export interface ModifyEarnPositionParamsV5 { - category: 'OnChain'; - productId: number; - positionId: number; - autoReinvest: 0 | 1; +export interface TradeInfoForAnalysisResultV5 { + symbolRnl: string; + netExecQty: string; + sumExecValue: string; + sumExecQty: string; + avgBuyExecPrice: string; + sumBuyExecValue: string; + sumBuyExecQty: string; + sumBuyExecFee: string; + sumBuyOrderQty: string; + avgSellExecPrice: string; + sumSellExecValue: string; + sumSellExecQty: string; + sumSellExecFee: string; + sumSellOrderQty: string; + maxMarginVersion: number; + baseCoin: string; + settleCoin: string; + sumPriceList?: TradeInfoAnalysisDailyV5[]; } -⋮---- -export interface GetEarnAprHistoryParamsV5 { - category: 'FlexibleSaving' | 'OnChain'; - productId: string; - startTime?: number; - endTime?: number; + +================ +File: src/types/response/v5-crypto-loan.ts +================ +export interface CollateralCoinV5 { + collateralAccuracy: number; + initialLTV: string; + liquidationLTV: string; + marginCallLTV: string; + maxLimit: string; } ⋮---- -/** - * GET /v5/earn/advance/product — Advanced Earn: Dual Asset, Double Win, Smart Leverage, etc. - * Public, no auth. Rate limit: 50 req/s per IP. - */ -export interface GetAdvanceEarnProductParamsV5 { - category: 'DualAssets' | 'DoubleWin' | 'SmartLeverage' | 'DiscountBuy'; - coin?: string; - /** - * Product duration, e.g. 8h, 1d, 2d, 3d, 6d, 7d, 12d (depends on product). - */ - duration?: string; +export interface VipCollateralCoinsV5 { + list: CollateralCoinV5[]; + vipLevel: string; } ⋮---- -/** - * Product duration, e.g. 8h, 1d, 2d, 3d, 6d, 7d, 12d (depends on product). - */ -⋮---- -/** GET /v5/earn/hold-to-earn/yield-history — Hold to Earn airdrop daily PnL (Earn permission) */ -export interface GetHoldToEarnAirdropYieldHistoryParamsV5 { - /** Unix seconds. Cannot be earlier than now minus 3 months */ - timeStart?: number; - /** Unix seconds. Requires timeStart ≤ timeEnd */ - timeEnd?: number; - /** Page size [1, 49] */ - limit: number; - /** Pagination cursor from previous `nextCursor` */ - cursor?: string; +export interface BorrowableCoinV5 { + borrowingAccuracy: number; + currency: string; + flexibleHourlyInterestRate: string; + hourlyInterestRate7D: string; + hourlyInterestRate14D: string; + hourlyInterestRate30D: string; + hourlyInterestRate90D: string; + hourlyInterestRate180D: string; + maxBorrowingAmount: string; + minBorrowingAmount: string; } ⋮---- -/** Unix seconds. Cannot be earlier than now minus 3 months */ +export interface VipBorrowableCoinsV5 { + list: BorrowableCoinV5[]; + vipLevel: string; +} ⋮---- -/** Unix seconds. Requires timeStart ≤ timeEnd */ +export interface AccountBorrowCollateralLimitV5 { + collateralCurrency: string; + loanCurrency: string; + maxCollateralAmount: string; + maxLoanAmount: string; + minCollateralAmount: string; + minLoanAmount: string; +} ⋮---- -/** Page size [1, 49] */ +export interface UnpaidLoanOrderV5 { + collateralAmount: string; + collateralCurrency: string; + currentLTV: string; + expirationTime: string; + hourlyInterestRate: string; + loanCurrency: string; + loanTerm: string; + orderId: string; + residualInterest: string; + residualPenaltyInterest: string; + totalDebt: string; +} ⋮---- -/** Pagination cursor from previous `nextCursor` */ - -================ -File: src/types/request/v5-spot-leverage-token.ts -================ -import { LTOrderTypeV5 } from '../shared-v5'; +export interface RepaymentHistoryV5 { + collateralCurrency: string; + collateralReturn: string; + loanCurrency: string; + loanTerm: string; + orderId: string; + repayAmount: string; + repayId: string; + repayStatus: number; + repayTime: string; + repayType: string; +} ⋮---- -export interface PurchaseSpotLeveragedTokenParamsV5 { - ltCoin: string; +export interface CompletedLoanOrderV5 { + borrowTime: string; + collateralCurrency: string; + expirationTime: string; + hourlyInterestRate: string; + initialCollateralAmount: string; + initialLoanAmount: string; + loanCurrency: string; + loanTerm: string; + orderId: string; + repaidInterest: string; + repaidPenaltyInterest: string; + status: number; +} +export interface LoanLTVAdjustmentHistoryV5 { + collateralCurrency: string; + orderId: string; + adjustId: string; + adjustTime: string; + preLTV: string; + afterLTV: string; + direction: number; amount: string; - serialNo?: string; } ⋮---- -export interface RedeemSpotLeveragedTokenParamsV5 { - ltCoin: string; - quantity: string; - serialNo?: string; +// New Crypto Loan Types +⋮---- +export interface BorrowCoinV5 { + currency: string; + fixedBorrowable: boolean; + fixedBorrowingAccuracy: number; + flexibleBorrowable: boolean; + flexibleBorrowingAccuracy: number; + maxBorrowingAmount: string; + minFixedBorrowingAmount: string; + minFlexibleBorrowingAmount: string; + vipLevel: string; + flexibleAnnualizedInterestRate: string; + annualizedInterestRate7D: string; + annualizedInterestRate14D: string; + annualizedInterestRate30D: string; + annualizedInterestRate60D: string; + annualizedInterestRate90D: string; + annualizedInterestRate180D: string; } ⋮---- -export interface GetSpotLeveragedTokenOrderHistoryParamsV5 { - ltCoin?: string; - orderId?: string; - startTime?: number; - endTime?: number; - limit?: number; - ltOrderType?: LTOrderTypeV5; - serialNo?: string; +export interface CollateralRatioV5 { + collateralRatio: string; + maxValue: string; + minValue: string; } ⋮---- -export interface GetVIPMarginDataParamsV5 { - vipLevel?: string; - currency?: string; +export interface CollateralRatioConfigV5 { + collateralRatioList: CollateralRatioV5[]; + currencies: string; } ⋮---- -export interface GetSpotMarginCurrencyDataParamsV5 { - currency?: string; +export interface CurrencyLiquidationV5 { + currency: string; + liquidationOrder: number; } ⋮---- -// Spot Margin Trade (UTA) endpoints -export interface ManualBorrowParamsV5 { - coin: string; - amount: string; +export interface CollateralDataV5 { + collateralRatioConfigList: CollateralRatioConfigV5[]; + currencyLiquidationList: CurrencyLiquidationV5[]; } ⋮---- -export interface GetMaxBorrowableAmountParamsV5 { - currency: string; +// Additional New Crypto Loan Types +⋮---- +export interface AdjustCollateralAmountV5 { + adjustId: number; } ⋮---- -export interface GetPositionTiersParamsV5 { - currency?: string; +export interface CollateralAdjustmentHistoryV5 { + adjustId: number; + adjustTime: number; + afterLTV: string; + amount: string; + collateralCurrency: string; + direction: number; + preLTV: string; + status: number; } ⋮---- -export interface GetCoinStateParamsV5 { - currency?: string; +export interface BorrowListV5 { + fixedTotalDebt: string; + fixedTotalDebtUSD: string; + flexibleHourlyInterestRate: string; + flexibleTotalDebt: string; + flexibleTotalDebtUSD: string; + loanCurrency: string; } ⋮---- -export interface GetAvailableAmountToRepayParamsV5 { +export interface CollateralListV5 { + amount: string; + amountUSD: string; currency: string; + ltv: string; } ⋮---- -export interface SetSpotMarginLeverageParamsV5 { - leverage: string; - currency?: string; +export interface SupplyListV5 { + amount: string; + amountUSD: string; + currency: string; } ⋮---- -export interface ManualRepayWithoutConversionParamsV5 { - coin: string; - amount?: string; - /** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - */ - repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; +export interface CryptoLoanPositionV5 { + borrowList: BorrowListV5[]; + collateralList: CollateralListV5[]; + supplyList: SupplyListV5[]; + totalCollateral: string; + totalDebt: string; + totalSupply: string; + colRes?: string; } ⋮---- -/** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - */ +// Flexible Loan Types ⋮---- -export interface GetAutoRepayModeParamsV5 { - currency?: string; // Coin name, uppercase only. If not passed, returns all currencies +export interface BorrowFlexibleV5 { + orderId: string; } ⋮---- -currency?: string; // Coin name, uppercase only. If not passed, returns all currencies -⋮---- -export interface SetAutoRepayModeParamsV5 { - /** Coin name, uppercase only. If omitted, sets the global switch; when enabled, includes currencies that become borrowable later */ - currency?: string; - autoRepayMode: '0' | '1'; // 0: Off, 1: On +export interface RepayFlexibleV5 { + repayId: string; } ⋮---- -/** Coin name, uppercase only. If omitted, sets the global switch; when enabled, includes currencies that become borrowable later */ -⋮---- -autoRepayMode: '0' | '1'; // 0: Off, 1: On -⋮---- -export interface SetTradeAutoRepayParamsV5 { - /** 1: enable trade auto repayment; 0: disable */ - autoRepay: '0' | '1'; +export interface OngoingFlexibleLoanV5 { + hourlyInterestRate: string; + loanCurrency: string; + totalDebt: string; + unpaidAmount: string; + unpaidInterest: string; } ⋮---- -/** 1: enable trade auto repayment; 0: disable */ -⋮---- -export interface GetSpotMarginLiabilityInfoParamsV5 { - currency: string; +export interface BorrowHistoryFlexibleV5 { + borrowTime: number; + initialLoanAmount: string; + loanCurrency: string; + orderId: string; + status: number; } ⋮---- -export interface FixedRateBorrowParamsV5 { - orderCurrency: string; - orderAmount: string; - /** e.g. 0.02 = 2% p.a. */ - annualRate: string; - /** 7, 14, 30, 90, 180 (days) */ - term: string; - /** 1: auto repayment; 2: transfer to flexible loan */ - repayType?: '1' | '2'; +export interface RepaymentHistoryFlexibleV5 { + loanCurrency: string; + repayAmount: string; + repayId: string; + repayStatus: number; + repayTime: number; + repayType: number; } ⋮---- -/** e.g. 0.02 = 2% p.a. */ -⋮---- -/** 7, 14, 30, 90, 180 (days) */ -⋮---- -/** 1: auto repayment; 2: transfer to flexible loan */ -⋮---- -export interface GetFixedRateBorrowOrderInfoParamsV5 { - orderId?: string; - orderCurrency?: string; - state?: string; - term?: string; - limit?: string; - cursor?: string; -} +// Fixed Loan Types ⋮---- -export interface GetFixedRateBorrowContractInfoParamsV5 { - orderId?: string; - orderCurrency?: string; - term?: string; - limit?: string; - cursor?: string; +export interface SupplyOrderQuoteFixedV5 { + orderCurrency: string; + term: number; + annualRate: string; + qty: string; } ⋮---- -export interface GetFixedRateBorrowOrderQuoteParamsV5 { +export interface BorrowOrderQuoteFixedV5 { orderCurrency: string; - term?: string; - orderBy?: 'apy' | 'term' | 'quantity'; - sort?: 0 | 1; - limit?: number; + term: number; + annualRate: string; + qty: string; } ⋮---- -export interface RenewFixedRateBorrowParamsV5 { - loanId: string; - qty?: string; +export interface CreateBorrowOrderFixedV5 { + orderId: string; } ⋮---- -export interface GetFixedRateBorrowInterestAccruedParamsV5 { - orderId?: string; - orderCurrency?: string; - limit?: string; - cursor?: string; +export interface CreateSupplyOrderFixedV5 { + orderId: string; } ⋮---- -export interface CancelFixedRateBorrowOrderParamsV5 { +export interface BorrowContractInfoFixedV5 { + annualRate: string; + autoRepay: string; // Deprecated + borrowCurrency: string; + borrowTime: string; + interestPaid: string; + loanId: string; orderId: string; + repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment + repaymentTime: string; + residualPenaltyInterest: string; + residualPrincipal: string; + status: number; + term: string; } ⋮---- -export interface GetFlexibleAvailableInventoryParamsV5 { - currency: string; -} +autoRepay: string; // Deprecated ⋮---- -export interface GetFixedRateAvailableInventoryParamsV5 { - currency: string; - term: string; +repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment +⋮---- +export interface SupplyContractInfoFixedV5 { annualRate: string; + supplyCurrency: string; + supplyTime: string; + supplyAmount: string; + interestPaid: string; + supplyId: string; + orderId: string; + redemptionTime: string; + penaltyInterest: string; + actualRedemptionTime: string; + status: number; + term: string; } - -================ -File: src/types/response/v5-account.ts -================ -import { - AccountMarginModeV5, - AccountTypeV5, - CategoryV5, - TransactionTypeV5, - UnifiedUpdateStatusV5, -} from '../shared-v5'; ⋮---- -export interface WalletBalanceV5Coin { - coin: string; - equity: string; - usdValue: string; - walletBalance: string; - free: string; // spot only - locked: string; // spot only - borrowAmount: string; - availableToBorrow: string; // deprecated field - availableToWithdraw: string; - accruedInterest: string; - totalOrderIM: string; - totalPositionIM: string; - totalPositionMM: string; - unrealisedPnl: string; - cumRealisedPnl: string; - bonus: string; - marginCollateral: boolean; - collateralSwitch: boolean; - spotBorrow: string; - colRes?: string; +export interface BorrowOrderInfoFixedV5 { + annualRate: string; + orderId: number; + orderTime: string; + filledQty: string; + orderQty: string; + orderCurrency: string; + state: number; + term: number; + repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment + strategyType?: 'PARTIAL' | 'FULL' | string; } ⋮---- -free: string; // spot only -locked: string; // spot only -⋮---- -availableToBorrow: string; // deprecated field +repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment ⋮---- -export interface WalletBalanceV5 { - accountType: AccountTypeV5; - accountLTV: string; - accountIMRate: string; - accountMMRate: string; - accountIMRateByMp: string; - accountMMRateByMp: string; - totalInitialMarginByMp: string; - totalMaintenanceMarginByMp: string; - totalEquity: string; - totalWalletBalance: string; - totalMarginBalance: string; - totalAvailableBalance: string; - totalPerpUPL: string; - totalInitialMargin: string; - totalMaintenanceMargin: string; - coin: WalletBalanceV5Coin[]; +export interface FixedLoanAvailableInventoryV5 { + currency: string; + term: string; + annualRate: string; + availableInventory: string; + updateTime: string; } ⋮---- -export interface UnifiedAccountUpgradeResultV5 { - unifiedUpdateStatus: UnifiedUpdateStatusV5; - unifiedUpdateMsg: { - msg: string[] | null; - }; +export interface FlexibleLoanAvailableInventoryV5 { + currency: string; + availableInventory: string; + updateTime: string; } ⋮---- -export interface BorrowHistoryRecordV5 { - currency: string; - createdTime: number; - borrowCost: string; - hourlyBorrowRate: string; - InterestBearingBorrowSize: string; - costExemption: string; - borrowAmount: string; - unrealisedLoss: string; - freeBorrowedAmount: string; +export interface SupplyOrderInfoFixedV5 { + annualRate: string; + orderId: number; + orderTime: string; + filledQty: string; + orderQty: string; + orderCurrency: string; + state: number; + term: number; } ⋮---- -export interface CollateralInfoV5 { - currency: string; - hourlyBorrowRate: string; - maxBorrowingAmount: string; - freeBorrowAmount: string; - freeBorrowingLimit: string; - borrowAmount: string; - availableToBorrow: string; - borrowable: boolean; - borrowUsageRate: string; - marginCollateral: boolean; - collateralSwitch: boolean; - collateralRatio: string; +export interface RepayFixedV5 { + repayId: string; } ⋮---- -export interface CoinGreeksV5 { - baseCoin: string; - totalDelta: string; - totalGamma: string; - totalVega: string; - totalTheta: string; +export interface RepaymentHistoryFixedV5 { + details: { + loanCurrency: string; + loanId: string; + repayAmount: string; + }[]; + loanCurrency: string; + repayAmount: string; + repayId: string; + repayStatus: number; + repayTime: number; + repayType: number; } ⋮---- -export interface FeeRateV5 { - symbol: string; - baseCoin: string; - takerFeeRate: string; - makerFeeRate: string; - rpiMakerFeeRate?: string; +export interface RenewBorrowOrderFixedV5 { + orderId: string; } ⋮---- -export interface AccountInfoV5 { - unifiedMarginStatus: number; - marginMode: AccountMarginModeV5; - isMasterTrader: boolean; - spotHedgingStatus: string; - updatedTime: string; +export interface RenewOrderInfoFixedV5 { + amount: string; + autoRepay: number; + borrowCurrency: string; + contractNo: string; + dueTime: string; + loanId: string; + orderId: number; + renewLoanNo: string; + time: string; } ⋮---- -/** - * Get Trade Behaviour Config / `getLimitPriceAction()` — `/v5/account/user-setting-config` - */ -export interface UserSettingConfigV5 { - lpaSpot: boolean; - lpaPerp: boolean; - /** Spot MNT fee deduction enabled. */ - smsef?: boolean; - /** Futures MNT fee deduction enabled. */ - fmsef?: boolean; - /** Delta Neutral mode; may be absent on older API responses. */ - deltaEnable?: boolean; - smpType?: '0' | '1' | '2' | '3' | string; +// Institutional Loan Types +⋮---- +export interface InstitutionalLendingProductInfoV5 { + productId: string; + leverage: string; + supportSpot: number; + supportContract: number; + supportMarginTrading: number; + withdrawLine: string; + transferLine: string; + spotBuyLine: string; + spotSellLine: string; + contractOpenLine: string; + liquidationLine: string; + stopLiquidationLine: string; + contractLeverage: string; + transferRatio: string; + spotSymbols: unknown[]; + contractSymbols: unknown[]; + supportUSDCContract: number; + supportUSDCOptions: number; + USDTPerpetualOpenLine?: string; + USDCContractOpenLine?: string; + USDCOptionsOpenLine?: string; + USDTPerpetualCloseLine?: string; + USDCContractCloseLine?: string; + USDCOptionsCloseLine?: string; + USDTPerpetualLeverage?: { symbol: string; leverage: string }[]; + USDCContractLeverage?: { symbol: string; leverage: string }[]; + deferredLiquidationLine?: string; + deferredLiquidationTime?: string; + marginLeverage?: string; + /** `0`: Default, `1`: CTA, `2`: Hedge */ + productType?: '0' | '1' | '2' | string; } ⋮---- -/** Spot MNT fee deduction enabled. */ +/** `0`: Default, `1`: CTA, `2`: Hedge */ ⋮---- -/** Futures MNT fee deduction enabled. */ +export interface InstitutionalLendingCoinDeltaItemV5 { + coin: string; + coinDeltaSize: string; + coinDeltaAvailableAmount: string; + coinDeltaAmount: string; +} ⋮---- -/** Delta Neutral mode; may be absent on older API responses. */ +export interface InstitutionalLendingCoinDeltaAmountV5 { + riskUnitDeltaAmount: string; + riskUnitDeltaAvailableAmount: string; + riskUnitDelta?: string; + list: InstitutionalLendingCoinDeltaItemV5[]; +} ⋮---- -export interface TransactionLogV5 { - symbol: string; - category: CategoryV5; - side: string; - transactionTime: string; - type: TransactionTypeV5; - qty: string; - size: string; - currency: string; - tradePrice: string; - funding: string; - fee: string; - cashFlow: string; - change: string; - cashBalance: string; - feeRate: string; - bonusChange: string; - tradeId: string; - orderId: string; - orderLinkId: string; - extraFees: string; - transSubType: string; - displayType?: string; +export interface InstitutionalLendingDelayLiquidationStatusV5 { + ltv: string; + /** 0 normal, 1 passive liquidation, 2 callback liquidation, 3 delay liquidation */ + liquidationStatus: 0 | 1 | 2 | 3; + delayLiqStartTime: string; + delayLiqRemainingSec: string; } ⋮---- -export interface MMPStateV5 { - baseCoin: string; - mmpEnabled: boolean; - window: string; - frozenPeriod: string; - qtyLimit: string; - deltaLimit: string; - vegaLimit?: string; - mmpFrozenUntil: string; - mmpFrozen: boolean; +/** 0 normal, 1 passive liquidation, 2 callback liquidation, 3 delay liquidation */ +⋮---- +export interface UnpaidInfoV5 { + token: string; // Coin + unpaidQty: string; // Unpaid principle + unpaidInterest: string; // Unpaid interest } ⋮---- -export interface RepayLiabilityResultV5 { - coin: string; - repaymentQty: string; +token: string; // Coin +unpaidQty: string; // Unpaid principle +unpaidInterest: string; // Unpaid interest +⋮---- +export interface BalanceInfoV5 { + token: string; // Margin coin + price: string; // Margin coin price + qty: string; // Margin coin quantity + convertedAmount: string; // Margin conversion amount } ⋮---- -export interface DCPInfoV5 { - product: 'SPOT' | 'DERIVATIVES' | 'OPTIONS'; - dcpStatus: 'ON'; - timeWindow: string; +token: string; // Margin coin +price: string; // Margin coin price +qty: string; // Margin coin quantity +convertedAmount: string; // Margin conversion amount +⋮---- +export interface LTVInfoV5 { + ltv: string; // Risk rate (when liqStatus != 0, returns empty string) + rst: string; // Remaining liquidation time in UTC seconds (when liqStatus != 0, returns empty string) + parentUid: string; // The designated Risk Unit ID + subAccountUids: string[]; // Bound user IDs + unpaidAmount: string; // Total debt in USDT (when liqStatus != 0, returns empty string) + unpaidInfo: UnpaidInfoV5[]; // Debt details (when liqStatus != 0, returns empty array) + balance: string; // Total asset in USDT (when liqStatus != 0, returns empty string) + balanceInfo: BalanceInfoV5[]; // Asset details (when liqStatus != 0, returns empty array) + liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress } ⋮---- -export interface ManualRepayResultV5 { - resultStatus: 'P' | 'SU' | 'FA'; -} +ltv: string; // Risk rate (when liqStatus != 0, returns empty string) +rst: string; // Remaining liquidation time in UTC seconds (when liqStatus != 0, returns empty string) +parentUid: string; // The designated Risk Unit ID +subAccountUids: string[]; // Bound user IDs +unpaidAmount: string; // Total debt in USDT (when liqStatus != 0, returns empty string) +unpaidInfo: UnpaidInfoV5[]; // Debt details (when liqStatus != 0, returns empty array) +balance: string; // Total asset in USDT (when liqStatus != 0, returns empty string) +balanceInfo: BalanceInfoV5[]; // Asset details (when liqStatus != 0, returns empty array) +liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress ⋮---- -/** GET /v5/account/option-asset-info — response `result` wraps a nested `result` array. */ -export interface OptionAssetInfoRowV5 { - coin: string; - totalDelta: string; - totalRPL: string; - totalUPL: string; - assetIM: string; - assetMM: string; - sendTime: number; +export interface InstitutionalLoanLTVV5 { + ltvInfo: LTVInfoV5[]; // LTV info array + liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress } ⋮---- -export interface OptionAssetInfoNestedResultV5 { - result: OptionAssetInfoRowV5[]; -} +ltvInfo: LTVInfoV5[]; // LTV info array +liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress ⋮---- -/** GET /v5/account/pay-info */ -export interface PayInfoCollateralItemV5 { - coin: string; - availableSize: string; - availableValue: string; - coinScale: number; - borrowSize: string; - spotHedgeAmount: string; - assetFrozen: string; +export interface RepayInstitutionalLoanResultV5 { + repayOrderStatus: string; // P: processing } ⋮---- -export interface PayInfoBorrowBlockV5 { - coin?: string; - borrowSize: string; - borrowValue?: string; - assetFrozen: string; - availableBalance: string; -} +repayOrderStatus: string; // P: processing ⋮---- -export interface PayInfoResultV5 { - collateralInfo: { - collateralList: PayInfoCollateralItemV5[]; - }; - borrowInfo: PayInfoBorrowBlockV5; -} +// Max Loan Amount Response Types ⋮---- -/** GET /v5/account/trade-info-for-analysis */ -export interface TradeInfoAnalysisDailyV5 { - day: string; - sumBuyExecValue: string; - sumSellExecValue: string; - sumExecValue: string; +export interface MaxLoanAmountV5 { + currency: string; // Coin to borrow + maxLoan: string; // Maximum borrowable amount based on current collateral + notionalUsd: string; // Notional USD value + remainingQuota: string; // Remaining individual platform borrowing limit (shared between main and sub accounts) } ⋮---- -export interface TradeInfoForAnalysisResultV5 { - symbolRnl: string; - netExecQty: string; - sumExecValue: string; - sumExecQty: string; - avgBuyExecPrice: string; - sumBuyExecValue: string; - sumBuyExecQty: string; - sumBuyExecFee: string; - sumBuyOrderQty: string; - avgSellExecPrice: string; - sumSellExecValue: string; - sumSellExecQty: string; - sumSellExecFee: string; - sumSellOrderQty: string; - maxMarginVersion: number; - baseCoin: string; - settleCoin: string; - sumPriceList?: TradeInfoAnalysisDailyV5[]; -} +currency: string; // Coin to borrow +maxLoan: string; // Maximum borrowable amount based on current collateral +notionalUsd: string; // Notional USD value +remainingQuota: string; // Remaining individual platform borrowing limit (shared between main and sub accounts) ================ File: src/types/response/v5-position.ts @@ -12135,407 +11744,395 @@ export interface ClosedOptionsPositionV5 { } ================ -File: src/types/websockets/ws-general.ts +File: src/websocket-client.ts ================ -import { AxiosRequestConfig } from 'axios'; -import type { ClientRequestArgs } from 'http'; -import WebSocket from 'isomorphic-ws'; +/* eslint-disable @typescript-eslint/no-unused-vars */ +⋮---- +import { + MessageEventLike, + WSCategoryV5, + WSClientConfigurableOptions, + WsKey, + WsMarket, + WsTopic, +} from './types'; +import { + Exact, + WSAPIOperation, + WsAPIOperationResponseMap, + WSAPIRequest, + WsAPITopicRequestParamMap, + WsAPIWsKeyTopicMap, + WsOperation, + WsRequestOperationBybit, +} from './types/websockets/ws-api'; +import { + APIID, + DefaultLogger, + getMaxTopicsPerSubscribeEvent, + getNormalisedTopicRequests, + getPromiseRefForWSAPIRequest, + getTopicsPerWSKey, + getWsKeyForTopic, + getWsUrl, + isPrivateWsTopic, + isTopicSubscriptionConfirmation, + isTopicSubscriptionSuccess, + isWSAPIResponse, + isWsPong, + neverGuard, + WS_AUTH_ON_CONNECT_KEYS, + WS_KEY_MAP, + WSConnectedResult, + WsTopicRequest, +} from './util'; +import { + BaseWebsocketClient, + EmittableEvent, + MidflightWsRequestEvent, +} from './util/BaseWSClient'; +import { SignAlgorithm, signMessage } from './util/webCryptoAPI'; +⋮---- +export interface WSAPIRequestFlags { + /** If true, will skip auth requirement for WS API connection */ + authIsOptional?: boolean | undefined; +} +⋮---- +/** If true, will skip auth requirement for WS API connection */ +⋮---- +export class WebsocketClient extends BaseWebsocketClient< +⋮---- +constructor(options?: WSClientConfigurableOptions, logger?: DefaultLogger) +⋮---- +/** + * Request connection of all dependent (public & private) websockets, instead of waiting + * for automatic connection by SDK. + */ +public connectAll(): Promise[] +⋮---- +/** + * Ensures the WS API connection is active and ready. + * + * You do not need to call this, but if you call this before making any WS API requests, + * it can accelerate the first request (by preparing the connection in advance). + */ +public connectWSAPI(): Promise +⋮---- +/** This call automatically ensures the connection is active AND authenticated before resolving */ +⋮---- +public connectPublic(): Promise[] +⋮---- +public connectPrivate(): Promise +⋮---- +/** + * Subscribe to V5 topics & track/persist them. + * @param wsTopics - topic or list of topics + * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). + * The value is only important when connecting to public topics and will be ignored for private topics. + * @param isPrivateTopic - optional - the library will try to detect private topics, you can use this + * to mark a topic as private (if the topic isn't recognised yet) + */ +public subscribeV5( + wsTopics: WsTopic[] | WsTopic, + category: WSCategoryV5, + isPrivateTopic?: boolean, + ): Promise[] +⋮---- +// Sort into per-WsKey batches, in case there is a mix of topics here +⋮---- +// Prevent duplicate requests to the same topic +⋮---- +// Batch sub topics per ws key +⋮---- +// Return promise to resolve midflight WS request (only works if already connected before request) +⋮---- +/** + * Unsubscribe from V5 topics & remove them from memory. They won't be re-subscribed to if the + * connection reconnects. + * + * @param wsTopics - topic or list of topics + * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). The value is only + * important when connecting to public topics and will be ignored for private topics. + * @param isPrivateTopic - optional - the library will try to detect private topics, you can + * use this to mark a topic as private (if the topic isn't recognised yet) + */ +public unsubscribeV5( + wsTopics: WsTopic[] | WsTopic, + category: WSCategoryV5, + isPrivateTopic?: boolean, + ): Promise[] +⋮---- +// Sort into per-WsKey batches, in case there is a mix of topics here +⋮---- +// Batch sub topics per ws key +⋮---- +// Return promise to resolve midflight WS request (only works if already connected before request) +⋮---- +/** + * Note: subscribeV5() might be simpler to use. The end result is the same. + * + * Request subscription to one or more topics. Pass topics as either an array of strings, + * or array of objects (if the topic has parameters). + * + * Objects should be formatted as {topic: string, params: object, category: WSCategoryV5}. + * + * - Subscriptions are automatically routed to the correct websocket connection. + * - Authentication/connection is automatic. + * - Resubscribe after network issues is automatic. + * + * Call `unsubscribe(topics)` to remove topics + */ +public subscribe( + requests: + | (WsTopicRequest | WsTopic) + | (WsTopicRequest | WsTopic)[], + requestedWsKey?: WsKey, + ) +⋮---- +// Batch sub topics per ws key +⋮---- +/** + * Note: unsubscribe() might be simpler to use. The end result is the same. + * Unsubscribe from one or more topics. Similar to subscribe() but in reverse. + * + * - Requests are automatically routed to the correct websocket connection. + * - These topics will be removed from the topic cache, so they won't be subscribed to again. + */ +public unsubscribe( + requests: + | (WsTopicRequest | WsTopic) + | (WsTopicRequest | WsTopic)[], + wsKey?: WsKey, + ) ⋮---- -import { APIRegion, RestClientOptions, WS_KEY_MAP } from '../../util'; +// Batch sub topics per ws key ⋮---- -/** For spot markets, spotV3 is recommended */ -export type APIMarket = 'v5'; +/** + * + * + * + * WS API Methods - similar to the REST API, but via WebSockets + * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline + * + * + * + */ ⋮---- -// Same as inverse futures -export type WsPublicInverseTopic = - | 'orderBookL2_25' - | 'orderBookL2_200' - | 'trade' - | 'insurance' - | 'instrument_info' - | 'klineV2'; +/** + * Send a Websocket API command/request on a connection. Returns a promise that resolves on reply. + * + * WS API Documentation for list of operations and parameters: + * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline + * + * Returned promise is rejected if: + * - an exception is detected in the reply, OR + * - the connection disconnects for any reason (even if automatic reconnect will happen). + * + * Authentication is automatic. If you didn't request authentication yourself, there might + * be a small delay after your first request, while the SDK automatically authenticates. + * + * @param wsKey - The connection this event is for. Currently only "v5PrivateTrade" is supported + * for Bybit, since that is the dedicated WS API connection. + * @param operation - The command being sent, e.g. "order.create" to submit a new order. + * @param params - Any request parameters for the command. E.g. `OrderParamsV5` to submit a new + * order. Only send parameters for the request body. Everything else is automatically handled. + * @returns Promise - tries to resolve with async WS API response. Rejects if disconnected or exception is seen in async WS API response + */ ⋮---- -export type WsPublicUSDTPerpTopic = - | 'orderBookL2_25' - | 'orderBookL2_200' - | 'trade' - | 'insurance' - | 'instrument_info' - | 'kline'; +// This overload allows the caller to omit the 3rd param, if it isn't required +sendWSAPIRequest< + TWSKey extends keyof WsAPIWsKeyTopicMap, + TWSOperation extends WsAPIWsKeyTopicMap[TWSKey], + TWSParams extends Exact, + >( + wsKey: TWSKey, + operation: TWSOperation, + params?: TWSParams extends void | never ? undefined : TWSParams, + requestFlags?: WSAPIRequestFlags, + ): Promise; ⋮---- -export type WsPublicSpotV1Topic = - | 'trade' - | 'realtimes' - | 'kline' - | 'depth' - | 'mergedDepth' - | 'diffDepth'; +// These overloads give stricter types than mapped generics, since generic constraints +// do not trigger excess property checks +// Without these overloads, TypeScript won't complain if you include an +// unexpected property with your request (if it doesn't clash with an existing property) +sendWSAPIRequest( + wsKey: typeof WS_KEY_MAP.v5PrivateTrade, + operation: TWSOperation, + params: WsAPITopicRequestParamMap[TWSOperation], + requestFlags?: WSAPIRequestFlags, + ): Promise; ⋮---- -export type WsPublicSpotV2Topic = - | 'depth' - | 'kline' - | 'trade' - | 'bookTicker' - | 'realtimes'; +sendWSAPIRequest( + wsKey: typeof WS_KEY_MAP.v5PrivateTrade, + operation: TWSOperation, + params: WsAPITopicRequestParamMap[TWSOperation], + requestFlags?: WSAPIRequestFlags, + ): Promise; ⋮---- -export type WsPublicTopics = - | WsPublicInverseTopic - | WsPublicUSDTPerpTopic - | WsPublicSpotV1Topic - | WsPublicSpotV2Topic - | string; +sendWSAPIRequest( + wsKey: typeof WS_KEY_MAP.v5PrivateTrade, + operation: TWSOperation, + params: WsAPITopicRequestParamMap[TWSOperation], + requestFlags?: WSAPIRequestFlags, + ): Promise; ⋮---- -// Same as inverse futures -export type WsPrivateInverseTopic = - | 'position' - | 'execution' - | 'order' - | 'stop_order'; +async sendWSAPIRequest< + TWSKey extends keyof WsAPIWsKeyTopicMap, + TWSOperation extends WsAPIWsKeyTopicMap[TWSKey], + TWSParams extends Exact, + TWSAPIResponse extends + WsAPIOperationResponseMap[TWSOperation] = WsAPIOperationResponseMap[TWSOperation], + >( + wsKey: WsKey = WS_KEY_MAP.v5PrivateTrade, + operation: TWSOperation, + params: TWSParams, + requestFlags?: WSAPIRequestFlags, + ): Promise ⋮---- -export type WsPrivateUSDTPerpTopic = - | 'position' - | 'execution' - | 'order' - | 'stop_order' - | 'wallet'; +// Some commands don't require authentication. ⋮---- -export type WsPrivateSpotTopic = - | 'outboundAccountInfo' - | 'executionReport' - | 'ticketInfo'; +// Sign, if needed ⋮---- -export type WsPrivateTopic = - | WsPrivateInverseTopic - | WsPrivateUSDTPerpTopic - | WsPrivateSpotTopic - | string; +// Store deferred promise, resolved within the "resolveEmittableEvents" method while parsing incoming events ⋮---- -export type WsTopic = WsPublicTopics | WsPrivateTopic; +// eslint-disable-next-line @typescript-eslint/no-explicit-any ⋮---- -/** This is used to differentiate between each of the available websocket streams (as bybit has multiple websockets) */ -export type WsKey = (typeof WS_KEY_MAP)[keyof typeof WS_KEY_MAP]; -export type WsMarket = 'all'; +// Enrich returned promise with request context for easier debugging ⋮---- -export interface WSClientConfigurableOptions { - /** Your API key */ - key?: string; - - /** Your API secret */ - secret?: string; - - /** - * Set to `true` to connect to Bybit's testnet environment. +// throw e; +⋮---- +// Send event +⋮---- +// Return deferred promise, so caller can await this call +⋮---- +/** * - * Notes: * - * - If demo trading, `testnet` should be set to false! - * - If testing a strategy, use demo trading instead. Testnet market data is very different from real market conditions. - */ - testnet?: boolean; - - /** - * Set to `true` to connect to Bybit's V5 demo trading: https://bybit-exchange.github.io/docs/v5/demo + * Internal methods - not intended for public use * - * Only the "V5" "market" is supported here. - */ - demoTrading?: boolean; - - /** - * The API group this client should connect to. The V5 market is currently used by default. * - * Only the "V5" "market" is supported here. - */ - market?: APIMarket; - - /** Define a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 seconds */ - recvWindow?: number; - - /** How often to check if the connection is alive */ - pingInterval?: number; - - /** How long to wait for a pong (heartbeat reply) before assuming the connection is dead */ - pongTimeout?: number; - - /** Delay in milliseconds before respawning the connection */ - reconnectTimeout?: number; - - /** - * Select WebSocket routing with the same region values as REST. Uses a - * dedicated mainnet stream when Bybit documents one for that region. - * Top-level `apiRegion` takes precedence over `restOptions.apiRegion`. - */ - apiRegion?: APIRegion; - - /** - * Site ID sent as `x-site-id` during the Node.js WebSocket handshake. - * Brazil and Argentina internal accounts now use `stream.bybit.com` without this header. - * Keep passing it only if a remaining site still requires `x-site-id`. */ - siteId?: string; - - /** - * REST options reused for WebSocket routing. - * Regional and site ID values are retained as fallbacks; prefer the matching - * top-level `apiRegion` and `siteId` options. +⋮---- +/** + * Note: implementing this method will wipe the WsStore state for this WsKey, once this method returns */ - restOptions?: RestClientOptions; - requestOptions?: AxiosRequestConfig; - - wsOptions?: { - protocols?: string[]; - agent?: any; - } & ( - | Omit, 'agent'> - | Omit, 'agent'> - ); - - wsUrl?: string; - - /** - * Default: false. - * - * When enabled, any calls to the subscribe method will return a promise. - * Note: internally, subscription requests are sent in batches. This may not behave as expected when - * subscribing to a large number of topics, especially if you are not yet connected when subscribing. +protected isCustomReconnectionNeeded(): boolean +⋮---- +protected async triggerCustomReconnectionWorkflow(): Promise +⋮---- +/** + * @returns The WS URL to connect to for this WS key */ - promiseSubscribeRequests?: boolean; - - /** - * Allows you to provide a custom "signMessage" function, e.g. to use node's much faster createHmac method - * - * Look in the examples folder for a demonstration on using node's createHmac instead. +protected async getWsUrl(wsKey: WsKey): Promise +⋮---- +// If auth is needed for this wsKey URL, this returns a suffix +⋮---- +/** + * Return params required to make authorized request */ - customSignMessageFn?: (message: string, secret: string) => Promise; -} +private async getWsAuthURLSuffix(): Promise +⋮---- +private async signMessage( + paramsStr: string, + secret: string, + method?: 'hex' | 'base64', + algorithm: SignAlgorithm = 'SHA-256', + ): Promise ⋮---- -/** Your API key */ +protected async getWsAuthRequestEvent( + wsKey: WsKey, + ): Promise> ⋮---- -/** Your API secret */ +private async getWsAuthSignature( + wsKey: WsKey, + ): Promise<{ expiresAt: number; signature: string }> ⋮---- -/** - * Set to `true` to connect to Bybit's testnet environment. - * - * Notes: - * - * - If demo trading, `testnet` should be set to false! - * - If testing a strategy, use demo trading instead. Testnet market data is very different from real market conditions. - */ +undefined, // Let the function automatically determine encoding based on key type ⋮---- -/** - * Set to `true` to connect to Bybit's V5 demo trading: https://bybit-exchange.github.io/docs/v5/demo - * - * Only the "V5" "market" is supported here. - */ +private async signWSAPIRequest( + requestEvent: WSAPIRequest, + ): Promise> ⋮---- -/** - * The API group this client should connect to. The V5 market is currently used by default. - * - * Only the "V5" "market" is supported here. - */ +// Not needed for Bybit. Auth happens only on connection open, automatically. ⋮---- -/** Define a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 seconds */ +protected sendPingEvent(wsKey: WsKey) ⋮---- -/** How often to check if the connection is alive */ +protected sendPongEvent(wsKey: WsKey) ⋮---- -/** How long to wait for a pong (heartbeat reply) before assuming the connection is dead */ +/** Force subscription requests to be sent in smaller batches, if a number is returned */ +protected getMaxTopicsPerSubscribeEvent(wsKey: WsKey): number | null ⋮---- -/** Delay in milliseconds before respawning the connection */ +protected authPrivateConnectionsOnConnect(_wsKey: WsKey): boolean ⋮---- /** - * Select WebSocket routing with the same region values as REST. Uses a - * dedicated mainnet stream when Bybit documents one for that region. - * Top-level `apiRegion` takes precedence over `restOptions.apiRegion`. + * @returns one or more correctly structured request events for performing a operations over WS. This can vary per exchange spec. */ +protected async getWsRequestEvents( + market: WsMarket, + operation: WsOperation, + requests: WsTopicRequest[], + // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars + _wsKey: WsKey, + ): Promise>[]> ⋮---- -/** - * Site ID sent as `x-site-id` during the Node.js WebSocket handshake. - * Brazil and Argentina internal accounts now use `stream.bybit.com` without this header. - * Keep passing it only if a remaining site still requires `x-site-id`. - */ +// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars ⋮---- -/** - * REST options reused for WebSocket routing. - * Regional and site ID values are retained as fallbacks; prefer the matching - * top-level `apiRegion` and `siteId` options. - */ +// Previously used to track topics in a request. Keeping this for subscribe/unsubscribe requests, no need for incremental values ⋮---- -/** - * Default: false. - * - * When enabled, any calls to the subscribe method will return a promise. - * Note: internally, subscription requests are sent in batches. This may not behave as expected when - * subscribing to a large number of topics, especially if you are not yet connected when subscribing. - */ +protected getPrivateWSKeys(): WsKey[] ⋮---- -/** - * Allows you to provide a custom "signMessage" function, e.g. to use node's much faster createHmac method - * - * Look in the examples folder for a demonstration on using node's createHmac instead. - */ +protected isAuthOnConnectWsKey(wsKey: WsKey): boolean ⋮---- /** - * WS configuration that's always defined, regardless of user configuration - * (usually comes from defaults if there's no user-provided values) - */ -export interface WebsocketClientOptions extends WSClientConfigurableOptions { - market: APIMarket; - pongTimeout: number; - pingInterval: number; - reconnectTimeout: number; - recvWindow: number; - - /** - * If true, require a "receipt" that the connection is ready for use (e.g. a specific event type) - */ - requireConnectionReadyConfirmation: boolean; - authPrivateConnectionsOnConnect: boolean; - authPrivateRequests: boolean; - reauthWSAPIOnReconnect: boolean; - - /** - * Whether to use native WebSocket ping/pong frames for heartbeats + * Determines if a topic is for a private channel, using a hardcoded list of strings */ - useNativeHeartbeats: boolean; -} +protected isPrivateTopicRequest(request: WsTopicRequest): boolean ⋮---- -/** - * If true, require a "receipt" that the connection is ready for use (e.g. a specific event type) - */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +protected isWsPing(msg: any): boolean +⋮---- +// eslint-disable-next-line @typescript-eslint/no-explicit-any +protected isWsPong(msg: any): boolean +⋮---- +// public ws connections +⋮---- +// private ws connections ⋮---- /** - * Whether to use native WebSocket ping/pong frames for heartbeats + * Abstraction called to sort ws events into emittable event types (response to a request, data update, etc) */ +protected resolveEmittableEvents( + wsKey: WsKey, + event: MessageEventLike, + ): EmittableEvent[] ⋮---- -export type WsEventInternalSrc = 'event' | 'function' | 'frame'; - -================ -File: .gitignore -================ -!.gitkeep -.DS_STORE -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json -pids -*.pid -*.seed -*.pid.lock -node_modules/ -.npm -.eslintcache -.node_repl_history -*.tgz -.yarn-integrity -.env -.env.test -.cache -lib -dist -doc -bundleReport.html -.history/ -rawReq.ts -localtest.sh -localtest.ts -privaterepotracker -restClientRegex.ts -repomix.sh - -examples/ignored -examples/ts-testnet-private.ts -examples/ts-testnet-trade.ts -examples/ts-testnet.ts -*.pem -.issue* -docs/research -tmp - -================ -File: examples/Rest/rest-v5-custom-url.ts -================ -import { RestClientV5 } from '../../src/index'; +// this.logger.trace('resolveEmittableEvents', { +// ...WS_LOGGER_CATEGORY, +// wsKey, +// parsed: JSON.stringify(parsed), +// }); ⋮---- -// or -// import { RestClientV5 } from 'bybit-api'; +// Only applies to the V5 WS topics ⋮---- -/** - * The first parameter of the REST client allows you to pass any configuration parameters supported by the SDK. - * - * These include API keys, if you wish to use private endpoints, but also expose other features such as - * setting a custom base URL (e.g. for Turkish users). - * - * Refer to the API documentation for a complete list of domains: https://bybit-exchange.github.io/docs/v5/guide#authentication - */ +// WS API response ⋮---- -/** - * You can pass a completely custom base URL, - * e.g. if you're trying to use a domain that hasn't been added yet (please let us know) - */ -// baseUrl: 'https://api5.bybit.com', -// -// -/** - * - * Predefined API regions are available through the `apiRegion` property. - * Choose the region where your Bybit account is registered: - * - */ -// -// -// default: routes to api.bybit.com -// apiRegion: 'default', -// -// -// bytick: routes to api.bytick.com -// apiRegion: 'bytick', -// -// -// NL: Bybit removed api.bybit.nl from Integration Guidance on 2026-09-22. apiRegion no longer includes NL. -// -// -// TK: routes to api.bybit.tr (for Turkey users) -// apiRegion: 'TK', -// -// -// KZ: routes to api.bybit.kz (for Kazakhstan users) -// apiRegion: 'KZ', -// -// -// HK: routes to api.spark-fintech.com and adds x-refer-site-id: HKG -// Testnet routes to api-testnet.spark-fintech.com -// apiRegion: 'HK', -// -// -// GE: routes to api.bybitgeorgia.ge (for Georgia users) -// apiRegion: 'GE', -// -// -// UAE: routes to api.bybit.ae (for United Arab Emirates users) -// apiRegion: 'UAE', -// -// -// EU: routes to api.bybit.eu (for EU and EEA users) -// apiRegion: 'EU', -// -// -// ID: routes to api.bybit.id (for Indonesian users) -// apiRegion: 'ID', -// -// -// JP: routes to api.manepa.jp (for Japan users) -// Testnet routes to api-testnet.manepa.jp -// apiRegion: 'JP', -// -// -/** - * Brazil and Argentina international accounts use the global API domain - * with an x-site-id header. Choose the site ID for your account: - */ -// siteId: 'BRA_BTL', -// siteId: 'ARG_BTL', +// eslint-disable-next-line max-len +⋮---- +// WS API Exception +⋮---- +// WS API Success +⋮---- +// Messages for a subscribed topic all include the "topic" property +⋮---- +// Messages that are a "reply" to a request/command (e.g. subscribe to these topics) typically include the "op" property +⋮---- +// Failed request +⋮---- +// These are r equest/reply pattern events (e.g. after subscribing to topics or authenticating) +⋮---- +// Request/reply pattern for authentication success +⋮---- +// In case of catastrophic failure, fallback to noisy emit update ================ File: src/types/response/v5-earn.ts @@ -13676,211 +13273,614 @@ export interface WSCoinV5 { colRes?: string; } ⋮---- -export interface WSWalletV5 { - accountType: string; - accountLTV: string; - accountIMRate: string; - accountMMRate: string; - accountIMRateByMp: string; - accountMMRateByMp: string; - totalInitialMarginByMp: string; - totalMaintenanceMarginByMp: string; - totalEquity: string; - totalWalletBalance: string; - totalMarginBalance: string; - totalAvailableBalance: string; - totalPerpUPL: string; - totalInitialMargin: string; - totalMaintenanceMargin: string; - coin: WSCoinV5[]; -} +export interface WSWalletV5 { + accountType: string; + accountLTV: string; + accountIMRate: string; + accountMMRate: string; + accountIMRateByMp: string; + accountMMRateByMp: string; + totalInitialMarginByMp: string; + totalMaintenanceMarginByMp: string; + totalEquity: string; + totalWalletBalance: string; + totalMarginBalance: string; + totalAvailableBalance: string; + totalPerpUPL: string; + totalInitialMargin: string; + totalMaintenanceMargin: string; + coin: WSCoinV5[]; +} +⋮---- +export type WSWalletEventV5 = WSPrivateTopicEventV5<'wallet', WSWalletV5[]>; +⋮---- +export interface WSGreeksV5 { + baseCoin: string; + totalDelta: string; + totalGamma: string; + totalVega: string; + totalTheta: string; +} +⋮---- +export type WSGreeksEventV5 = WSPrivateTopicEventV5<'greeks', WSGreeksV5[]>; +⋮---- +export interface WSSpreadOrderV5 { + category: 'combination' | 'spot_leg' | 'future_leg'; + symbol: string; + parentOrderId: string; + orderId: string; + orderLinkId: string; + side: OrderSideV5; + orderStatus: OrderStatusV5; + cancelType: OrderCancelTypeV5; + rejectReason: OrderRejectReasonV5; + timeInForce: OrderTimeInForceV5; + price: string; + qty: string; + avgPrice: string; + leavesQty: string; + leavesValue: string; + cumExecQty: string; + cumExecValue: string; + cumExecFee: string; + orderType: OrderTypeV5; + isLeverage: string; + createdTime: string; + updatedTime: string; + feeCurrency: string; + createType: OrderCreateTypeV5; + closedPnl: string; + cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +} +⋮---- +cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +⋮---- +export type WSSpreadOrderEventV5 = WSPrivateTopicEventV5< + 'spread.order', + WSSpreadOrderV5[] +>; +⋮---- +export interface WSSpreadExecutionV5 { + category: 'combination' | 'spot_leg' | 'future_leg'; + symbol: string; + isLeverage: string; + orderId: string; + orderLinkId: string; + side: OrderSideV5; + orderPrice: string; + orderQty: string; + leavesQty: string; + createType: OrderCreateTypeV5; + orderType: OrderTypeV5; + execFee: string; + execFeeV2: string; + feeCurrency: string; // Trading fee currency + parentExecId: string; + execId: string; + execPrice: string; + execQty: string; + execPnl: string; + execType: ExecTypeV5; + execValue: string; + execTime: string; + isMaker: boolean; + feeRate: string; + markPrice: string; + closedSize: string; + seq: number; +} +⋮---- +feeCurrency: string; // Trading fee currency +⋮---- +export type WSSpreadExecutionEventV5 = WSPrivateTopicEventV5< + 'spread.execution', + WSSpreadExecutionV5[] +>; +⋮---- +export interface WSInsuranceV5 { + coin: string; + symbols: string; + balance: string; + updateTime: string; +} +⋮---- +export type WSInsuranceEventV5 = WSPublicTopicEventV5< + 'insurance.USDT' | 'insurance.USDC' | 'insurance.inverse', + 'snapshot' | 'delta', + WSInsuranceV5[] +>; +⋮---- +export interface WSPriceLimitV5 { + symbol: string; + buyLmt: string; + sellLmt: string; +} +⋮---- +export type WSPriceLimitEventV5 = WSPublicTopicEventV5< + string, + 'snapshot', + WSPriceLimitV5 +>; +⋮---- +export interface WSADLAlertV5 { + c: string; // Token of the insurance pool + s: string; // Trading pair name + b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) + mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours + i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL + pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped + adl_tt: string; // Trigger threshold for contract PnL drawdown ADL + adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL +} +⋮---- +c: string; // Token of the insurance pool +s: string; // Trading pair name +b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) +mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours +i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL +pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped +adl_tt: string; // Trigger threshold for contract PnL drawdown ADL +adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL +⋮---- +export type WSADLAlertEventV5 = WSPublicTopicEventV5< + 'adlAlert.USDT' | 'adlAlert.USDC' | 'adlAlert.inverse', + 'snapshot', + WSADLAlertV5[] +>; +⋮---- +export type WSSystemStatusEventV5 = WSPublicTopicEventV5< + 'system.status', + 'snapshot', + SystemStatusItemV5[] +>; +⋮---- +/** + * RFQ WebSocket Events + */ +⋮---- +/** + * RFQ Inquiry Channel + * Private push for RFQ inquiries sent or received by the user + * Topics: rfq.open.rfqs, rfq.site.rfqs + */ +export type WSRFQInquiryEventV5 = WSPrivateTopicEventV5< + 'rfq.open.rfqs' | 'rfq.site.rfqs', + RFQItemV5[] +>; +⋮---- +/** + * RFQ Quote Channel + * Private push for quotes sent or received by the user + * Topics: rfq.open.quotes, rfq.site.quotes + */ +export type WSRFQQuoteEventV5 = WSPrivateTopicEventV5< + 'rfq.open.quotes' | 'rfq.site.quotes', + RFQQuoteItemV5[] +>; +⋮---- +/** + * RFQ Trade Channel + * Private push for block trades executed by the user + * Topics: rfq.open.trades, rfq.site.trades + */ +export type WSRFQTradeEventV5 = WSPrivateTopicEventV5< + 'rfq.open.trades' | 'rfq.site.trades', + RFQTradeV5[] +>; +⋮---- +/** + * RFQ Public Trade Channel + * Public push for all block trades + * Topics: rfq.open.public.trades, rfq.site.public.trades + */ +export type WSRFQPublicTradeEventV5 = WSPublicTopicEventV5< + 'rfq.open.public.trades' | 'rfq.site.public.trades', + 'snapshot', + RFQPublicTradeV5[] +>; + +================ +File: src/types/websockets/ws-general.ts +================ +import { AxiosRequestConfig } from 'axios'; +import type { ClientRequestArgs } from 'http'; +import WebSocket from 'isomorphic-ws'; +⋮---- +import { APIRegion, RestClientOptions, WS_KEY_MAP } from '../../util'; +⋮---- +/** For spot markets, spotV3 is recommended */ +export type APIMarket = 'v5'; +⋮---- +// Same as inverse futures +export type WsPublicInverseTopic = + | 'orderBookL2_25' + | 'orderBookL2_200' + | 'trade' + | 'insurance' + | 'instrument_info' + | 'klineV2'; +⋮---- +export type WsPublicUSDTPerpTopic = + | 'orderBookL2_25' + | 'orderBookL2_200' + | 'trade' + | 'insurance' + | 'instrument_info' + | 'kline'; +⋮---- +export type WsPublicSpotV1Topic = + | 'trade' + | 'realtimes' + | 'kline' + | 'depth' + | 'mergedDepth' + | 'diffDepth'; +⋮---- +export type WsPublicSpotV2Topic = + | 'depth' + | 'kline' + | 'trade' + | 'bookTicker' + | 'realtimes'; ⋮---- -export type WSWalletEventV5 = WSPrivateTopicEventV5<'wallet', WSWalletV5[]>; +export type WsPublicTopics = + | WsPublicInverseTopic + | WsPublicUSDTPerpTopic + | WsPublicSpotV1Topic + | WsPublicSpotV2Topic + | string; ⋮---- -export interface WSGreeksV5 { - baseCoin: string; - totalDelta: string; - totalGamma: string; - totalVega: string; - totalTheta: string; -} +// Same as inverse futures +export type WsPrivateInverseTopic = + | 'position' + | 'execution' + | 'order' + | 'stop_order'; ⋮---- -export type WSGreeksEventV5 = WSPrivateTopicEventV5<'greeks', WSGreeksV5[]>; +export type WsPrivateUSDTPerpTopic = + | 'position' + | 'execution' + | 'order' + | 'stop_order' + | 'wallet'; ⋮---- -export interface WSSpreadOrderV5 { - category: 'combination' | 'spot_leg' | 'future_leg'; - symbol: string; - parentOrderId: string; - orderId: string; - orderLinkId: string; - side: OrderSideV5; - orderStatus: OrderStatusV5; - cancelType: OrderCancelTypeV5; - rejectReason: OrderRejectReasonV5; - timeInForce: OrderTimeInForceV5; - price: string; - qty: string; - avgPrice: string; - leavesQty: string; - leavesValue: string; - cumExecQty: string; - cumExecValue: string; - cumExecFee: string; - orderType: OrderTypeV5; - isLeverage: string; - createdTime: string; - updatedTime: string; - feeCurrency: string; - createType: OrderCreateTypeV5; - closedPnl: string; - cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency -} +export type WsPrivateSpotTopic = + | 'outboundAccountInfo' + | 'executionReport' + | 'ticketInfo'; ⋮---- -cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +export type WsPrivateTopic = + | WsPrivateInverseTopic + | WsPrivateUSDTPerpTopic + | WsPrivateSpotTopic + | string; ⋮---- -export type WSSpreadOrderEventV5 = WSPrivateTopicEventV5< - 'spread.order', - WSSpreadOrderV5[] ->; +export type WsTopic = WsPublicTopics | WsPrivateTopic; ⋮---- -export interface WSSpreadExecutionV5 { - category: 'combination' | 'spot_leg' | 'future_leg'; - symbol: string; - isLeverage: string; - orderId: string; - orderLinkId: string; - side: OrderSideV5; - orderPrice: string; - orderQty: string; - leavesQty: string; - createType: OrderCreateTypeV5; - orderType: OrderTypeV5; - execFee: string; - execFeeV2: string; - feeCurrency: string; // Trading fee currency - parentExecId: string; - execId: string; - execPrice: string; - execQty: string; - execPnl: string; - execType: ExecTypeV5; - execValue: string; - execTime: string; - isMaker: boolean; - feeRate: string; - markPrice: string; - closedSize: string; - seq: number; +/** This is used to differentiate between each of the available websocket streams (as bybit has multiple websockets) */ +export type WsKey = (typeof WS_KEY_MAP)[keyof typeof WS_KEY_MAP]; +export type WsMarket = 'all'; +⋮---- +export interface WSClientConfigurableOptions { + /** Your API key */ + key?: string; + + /** Your API secret */ + secret?: string; + + /** + * Set to `true` to connect to Bybit's testnet environment. + * + * Notes: + * + * - If demo trading, `testnet` should be set to false! + * - If testing a strategy, use demo trading instead. Testnet market data is very different from real market conditions. + */ + testnet?: boolean; + + /** + * Set to `true` to connect to Bybit's V5 demo trading: https://bybit-exchange.github.io/docs/v5/demo + * + * Only the "V5" "market" is supported here. + */ + demoTrading?: boolean; + + /** + * The API group this client should connect to. The V5 market is currently used by default. + * + * Only the "V5" "market" is supported here. + */ + market?: APIMarket; + + /** Define a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 seconds */ + recvWindow?: number; + + /** How often to check if the connection is alive */ + pingInterval?: number; + + /** How long to wait for a pong (heartbeat reply) before assuming the connection is dead */ + pongTimeout?: number; + + /** Delay in milliseconds before respawning the connection */ + reconnectTimeout?: number; + + /** + * Select WebSocket routing with the same region values as REST. Uses a + * dedicated mainnet stream when Bybit documents one for that region. + * Top-level `apiRegion` takes precedence over `restOptions.apiRegion`. + */ + apiRegion?: APIRegion; + + /** + * Site ID sent as `x-site-id` during the Node.js WebSocket handshake. + * Brazil and Argentina internal accounts now use `stream.bybit.com` without this header. + * Keep passing it only if a remaining site still requires `x-site-id`. + */ + siteId?: string; + + /** + * REST options reused for WebSocket routing. + * Regional and site ID values are retained as fallbacks; prefer the matching + * top-level `apiRegion` and `siteId` options. + */ + restOptions?: RestClientOptions; + requestOptions?: AxiosRequestConfig; + + wsOptions?: { + protocols?: string[]; + agent?: any; + } & ( + | Omit, 'agent'> + | Omit, 'agent'> + ); + + wsUrl?: string; + + /** + * Default: false. + * + * When enabled, any calls to the subscribe method will return a promise. + * Note: internally, subscription requests are sent in batches. This may not behave as expected when + * subscribing to a large number of topics, especially if you are not yet connected when subscribing. + */ + promiseSubscribeRequests?: boolean; + + /** + * Allows you to provide a custom "signMessage" function, e.g. to use node's much faster createHmac method + * + * Look in the examples folder for a demonstration on using node's createHmac instead. + */ + customSignMessageFn?: (message: string, secret: string) => Promise; } ⋮---- -feeCurrency: string; // Trading fee currency +/** Your API key */ ⋮---- -export type WSSpreadExecutionEventV5 = WSPrivateTopicEventV5< - 'spread.execution', - WSSpreadExecutionV5[] ->; +/** Your API secret */ ⋮---- -export interface WSInsuranceV5 { - coin: string; - symbols: string; - balance: string; - updateTime: string; -} +/** + * Set to `true` to connect to Bybit's testnet environment. + * + * Notes: + * + * - If demo trading, `testnet` should be set to false! + * - If testing a strategy, use demo trading instead. Testnet market data is very different from real market conditions. + */ ⋮---- -export type WSInsuranceEventV5 = WSPublicTopicEventV5< - 'insurance.USDT' | 'insurance.USDC' | 'insurance.inverse', - 'snapshot' | 'delta', - WSInsuranceV5[] ->; +/** + * Set to `true` to connect to Bybit's V5 demo trading: https://bybit-exchange.github.io/docs/v5/demo + * + * Only the "V5" "market" is supported here. + */ +⋮---- +/** + * The API group this client should connect to. The V5 market is currently used by default. + * + * Only the "V5" "market" is supported here. + */ +⋮---- +/** Define a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 seconds */ ⋮---- -export interface WSPriceLimitV5 { - symbol: string; - buyLmt: string; - sellLmt: string; -} +/** How often to check if the connection is alive */ ⋮---- -export type WSPriceLimitEventV5 = WSPublicTopicEventV5< - string, - 'snapshot', - WSPriceLimitV5 ->; +/** How long to wait for a pong (heartbeat reply) before assuming the connection is dead */ ⋮---- -export interface WSADLAlertV5 { - c: string; // Token of the insurance pool - s: string; // Trading pair name - b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) - mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours - i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL - pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped - adl_tt: string; // Trigger threshold for contract PnL drawdown ADL - adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL -} +/** Delay in milliseconds before respawning the connection */ ⋮---- -c: string; // Token of the insurance pool -s: string; // Trading pair name -b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) -mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours -i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL -pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped -adl_tt: string; // Trigger threshold for contract PnL drawdown ADL -adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL +/** + * Select WebSocket routing with the same region values as REST. Uses a + * dedicated mainnet stream when Bybit documents one for that region. + * Top-level `apiRegion` takes precedence over `restOptions.apiRegion`. + */ ⋮---- -export type WSADLAlertEventV5 = WSPublicTopicEventV5< - 'adlAlert.USDT' | 'adlAlert.USDC' | 'adlAlert.inverse', - 'snapshot', - WSADLAlertV5[] ->; +/** + * Site ID sent as `x-site-id` during the Node.js WebSocket handshake. + * Brazil and Argentina internal accounts now use `stream.bybit.com` without this header. + * Keep passing it only if a remaining site still requires `x-site-id`. + */ ⋮---- -export type WSSystemStatusEventV5 = WSPublicTopicEventV5< - 'system.status', - 'snapshot', - SystemStatusItemV5[] ->; +/** + * REST options reused for WebSocket routing. + * Regional and site ID values are retained as fallbacks; prefer the matching + * top-level `apiRegion` and `siteId` options. + */ ⋮---- /** - * RFQ WebSocket Events - */ + * Default: false. + * + * When enabled, any calls to the subscribe method will return a promise. + * Note: internally, subscription requests are sent in batches. This may not behave as expected when + * subscribing to a large number of topics, especially if you are not yet connected when subscribing. + */ ⋮---- /** - * RFQ Inquiry Channel - * Private push for RFQ inquiries sent or received by the user - * Topics: rfq.open.rfqs, rfq.site.rfqs - */ -export type WSRFQInquiryEventV5 = WSPrivateTopicEventV5< - 'rfq.open.rfqs' | 'rfq.site.rfqs', - RFQItemV5[] ->; + * Allows you to provide a custom "signMessage" function, e.g. to use node's much faster createHmac method + * + * Look in the examples folder for a demonstration on using node's createHmac instead. + */ ⋮---- /** - * RFQ Quote Channel - * Private push for quotes sent or received by the user - * Topics: rfq.open.quotes, rfq.site.quotes + * WS configuration that's always defined, regardless of user configuration + * (usually comes from defaults if there's no user-provided values) */ -export type WSRFQQuoteEventV5 = WSPrivateTopicEventV5< - 'rfq.open.quotes' | 'rfq.site.quotes', - RFQQuoteItemV5[] ->; +export interface WebsocketClientOptions extends WSClientConfigurableOptions { + market: APIMarket; + pongTimeout: number; + pingInterval: number; + reconnectTimeout: number; + recvWindow: number; + + /** + * If true, require a "receipt" that the connection is ready for use (e.g. a specific event type) + */ + requireConnectionReadyConfirmation: boolean; + authPrivateConnectionsOnConnect: boolean; + authPrivateRequests: boolean; + reauthWSAPIOnReconnect: boolean; + + /** + * Whether to use native WebSocket ping/pong frames for heartbeats + */ + useNativeHeartbeats: boolean; +} ⋮---- /** - * RFQ Trade Channel - * Private push for block trades executed by the user - * Topics: rfq.open.trades, rfq.site.trades - */ -export type WSRFQTradeEventV5 = WSPrivateTopicEventV5< - 'rfq.open.trades' | 'rfq.site.trades', - RFQTradeV5[] ->; + * If true, require a "receipt" that the connection is ready for use (e.g. a specific event type) + */ ⋮---- /** - * RFQ Public Trade Channel - * Public push for all block trades - * Topics: rfq.open.public.trades, rfq.site.public.trades + * Whether to use native WebSocket ping/pong frames for heartbeats + */ +⋮---- +export type WsEventInternalSrc = 'event' | 'function' | 'frame'; + +================ +File: .gitignore +================ +!.gitkeep +.DS_STORE +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +pids +*.pid +*.seed +*.pid.lock +node_modules/ +.npm +.eslintcache +.node_repl_history +*.tgz +.yarn-integrity +.env +.env.test +.cache +lib +dist +doc +bundleReport.html +.history/ +rawReq.ts +localtest.sh +localtest.ts +privaterepotracker +restClientRegex.ts +repomix.sh + +examples/ignored +examples/ts-testnet-private.ts +examples/ts-testnet-trade.ts +examples/ts-testnet.ts +*.pem +.issue* +docs/research +tmp + +================ +File: examples/Rest/rest-v5-custom-url.ts +================ +import { RestClientV5 } from '../../src/index'; +⋮---- +// or +// import { RestClientV5 } from 'bybit-api'; +⋮---- +/** + * The first parameter of the REST client allows you to pass any configuration parameters supported by the SDK. + * + * These include API keys, if you wish to use private endpoints, but also expose other features such as + * setting a custom base URL (e.g. for Turkish users). + * + * Refer to the API documentation for a complete list of domains: https://bybit-exchange.github.io/docs/v5/guide#authentication */ -export type WSRFQPublicTradeEventV5 = WSPublicTopicEventV5< - 'rfq.open.public.trades' | 'rfq.site.public.trades', - 'snapshot', - RFQPublicTradeV5[] ->; +⋮---- +/** + * You can pass a completely custom base URL, + * e.g. if you're trying to use a domain that hasn't been added yet (please let us know) + */ +// baseUrl: 'https://api5.bybit.com', +// +// +/** + * + * Predefined API regions are available through the `apiRegion` property. + * Choose the region where your Bybit account is registered: + * + */ +// +// +// default: routes to api.bybit.com +// apiRegion: 'default', +// +// +// bytick: routes to api.bytick.com +// apiRegion: 'bytick', +// +// +// NL: Bybit removed api.bybit.nl from Integration Guidance on 2026-09-22. apiRegion no longer includes NL. +// +// +// TK: routes to api.bybit.tr (for Turkey users) +// apiRegion: 'TK', +// +// +// KZ: routes to api.bybit.kz (for Kazakhstan users) +// apiRegion: 'KZ', +// +// +// HK: routes to api.spark-fintech.com and adds x-refer-site-id: HKG +// Testnet routes to api-testnet.spark-fintech.com +// apiRegion: 'HK', +// +// +// GE: routes to api.bybitgeorgia.ge (for Georgia users) +// apiRegion: 'GE', +// +// +// UAE: routes to api.bybit.ae (for United Arab Emirates users) +// apiRegion: 'UAE', +// +// +// EU: routes to api.bybit.eu (for EU and EEA users) +// apiRegion: 'EU', +// +// +// ID: routes to api.bybit.id (for Indonesian users) +// apiRegion: 'ID', +// +// +// JP: routes to api.manepa.jp (for Japan users) +// Testnet routes to api-testnet.manepa.jp +// apiRegion: 'JP', +// +// +/** + * Brazil and Argentina international accounts use the global API domain + * with an x-site-id header. Choose the site ID for your account: + */ +// siteId: 'BRA_BTL', +// siteId: 'ARG_BTL', ================ File: src/types/request/index.ts @@ -17481,10 +17481,11 @@ getSpreadOpenOrders(params?: GetSpreadOpenOrdersParamsV5): Promise< * - orderId & orderLinkId has a higher priority than startTime & endTime * - Fully canceled orders are stored for up to 24 hours * - Single leg orders can also be found with "createType"=CreateByFutureSpread via Get Order History - * - From 2026-11-12, omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * - Planned change (postponed by Bybit, no new date yet): omitting orderStatus will exclude Cancelled, Rejected and Deactivated orders from the last 24 hours. * Pass orderStatus explicitly to retrieve matching orders from that period. * Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. * @see https://t.me/Bybit_API_Announcements/464 + * @see https://t.me/Bybit_API_Announcements/468 */ getSpreadOrderHistory(params?: GetSpreadOrderHistoryParamsV5): Promise< APIResponseV3WithTime<{ @@ -17835,9 +17836,10 @@ cancelAllOrders( * * If you want to get real-time order information, you could query this endpoint or rely on the websocket stream (recommended). * - * From 2026-11-12, omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * Planned change (postponed by Bybit, no new date yet): omitting orderStatus will exclude Cancelled, Rejected and Deactivated orders from the last 24 hours. * Pass orderStatus explicitly to retrieve matching orders from that period. * @see https://t.me/Bybit_API_Announcements/464 + * @see https://t.me/Bybit_API_Announcements/468 */ getHistoricOrders( params: GetAccountHistoricOrdersParamsV5, From 96b3d6740d0b8e308c9547f3bb0ab4a1afeb40f7 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Mon, 9 Nov 2026 12:06:14 +0100 Subject: [PATCH 8/9] docs: Bybit order history default change postponed to 2026-12-03 --- src/rest-client-v5.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index 61da969f..b2ff5b1b 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -923,7 +923,7 @@ export class RestClientV5 extends BaseRestClient { * - orderId & orderLinkId has a higher priority than startTime & endTime * - Fully canceled orders are stored for up to 24 hours * - Single leg orders can also be found with "createType"=CreateByFutureSpread via Get Order History - * - Planned change (postponed by Bybit, no new date yet): omitting orderStatus will exclude Cancelled, Rejected and Deactivated orders from the last 24 hours. + * - From 2026-12-03 (postponed from 2026-11-12), omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. * Pass orderStatus explicitly to retrieve matching orders from that period. * Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. * @see https://t.me/Bybit_API_Announcements/464 @@ -1350,7 +1350,7 @@ export class RestClientV5 extends BaseRestClient { * * If you want to get real-time order information, you could query this endpoint or rely on the websocket stream (recommended). * - * Planned change (postponed by Bybit, no new date yet): omitting orderStatus will exclude Cancelled, Rejected and Deactivated orders from the last 24 hours. + * From 2026-12-03 (postponed from 2026-11-12), omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. * Pass orderStatus explicitly to retrieve matching orders from that period. * @see https://t.me/Bybit_API_Announcements/464 * @see https://t.me/Bybit_API_Announcements/468 From 9715c8dd9d7335d5add28d18b16b5acd189cabb9 Mon Sep 17 00:00:00 2001 From: JJ-Cro sync bot Date: Mon, 9 Nov 2026 12:06:23 +0100 Subject: [PATCH 9/9] chore: regenerate endpoint docs and examples --- llms.txt | 70 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/llms.txt b/llms.txt index b137dcfc..b27e7188 100644 --- a/llms.txt +++ b/llms.txt @@ -920,6 +920,39 @@ These samples can be executed using `ts-node`: ts-node ./examples/rest-spot-public.ts ``` +================ +File: src/constants/enum.ts +================ +/** Full take profit/stop loss mode (a single TP order and a single SL order can be placed, covering the entire position) */ +⋮---- +/** Partial take profit/stop loss mode (multiple TP and SL orders can be placed, covering portions of the position) */ +⋮---- +/** This could mean bad request, incorrect value types or even incorrect/missing values */ +⋮---- +/** API key requires specific whitelisted IPs, and this IP was not in the list */ +⋮---- +/** Account not unified margin, update required */ +⋮---- +/** Seen when placing an order */ +⋮---- +/** Seen if a conditional order is too large */ +⋮---- +/** E.g. trying to change position margin while on cross */ +⋮---- +/** E.g. USDC Options trading, trying to access a symbol that is no longer active */ +⋮---- +/** E.g. USDC Options trading when the account hasn't been opened for USDC Options yet */ +⋮---- +/** + * Position idx, used to identify positions in different position modes. + * Required if you are under One-Way Mode: + */ +export enum LinearPositionIdx { + OneWayMode = 0, + BuySide = 1, + SellSide = 2, +} + ================ File: src/types/request/account-asset.ts ================ @@ -4594,39 +4627,6 @@ File: tsconfig.test.json "include": ["test/**/*.ts", "test/**/*.js"] } -================ -File: src/constants/enum.ts -================ -/** Full take profit/stop loss mode (a single TP order and a single SL order can be placed, covering the entire position) */ -⋮---- -/** Partial take profit/stop loss mode (multiple TP and SL orders can be placed, covering portions of the position) */ -⋮---- -/** This could mean bad request, incorrect value types or even incorrect/missing values */ -⋮---- -/** API key requires specific whitelisted IPs, and this IP was not in the list */ -⋮---- -/** Account not unified margin, update required */ -⋮---- -/** Seen when placing an order */ -⋮---- -/** Seen if a conditional order is too large */ -⋮---- -/** E.g. trying to change position margin while on cross */ -⋮---- -/** E.g. USDC Options trading, trying to access a symbol that is no longer active */ -⋮---- -/** E.g. USDC Options trading when the account hasn't been opened for USDC Options yet */ -⋮---- -/** - * Position idx, used to identify positions in different position modes. - * Required if you are under One-Way Mode: - */ -export enum LinearPositionIdx { - OneWayMode = 0, - BuySide = 1, - SellSide = 2, -} - ================ File: src/types/request/v5-alpha-lp.ts ================ @@ -17481,7 +17481,7 @@ getSpreadOpenOrders(params?: GetSpreadOpenOrdersParamsV5): Promise< * - orderId & orderLinkId has a higher priority than startTime & endTime * - Fully canceled orders are stored for up to 24 hours * - Single leg orders can also be found with "createType"=CreateByFutureSpread via Get Order History - * - Planned change (postponed by Bybit, no new date yet): omitting orderStatus will exclude Cancelled, Rejected and Deactivated orders from the last 24 hours. + * - From 2026-12-03 (postponed from 2026-11-12), omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. * Pass orderStatus explicitly to retrieve matching orders from that period. * Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. * @see https://t.me/Bybit_API_Announcements/464 @@ -17836,7 +17836,7 @@ cancelAllOrders( * * If you want to get real-time order information, you could query this endpoint or rely on the websocket stream (recommended). * - * Planned change (postponed by Bybit, no new date yet): omitting orderStatus will exclude Cancelled, Rejected and Deactivated orders from the last 24 hours. + * From 2026-12-03 (postponed from 2026-11-12), omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. * Pass orderStatus explicitly to retrieve matching orders from that period. * @see https://t.me/Bybit_API_Announcements/464 * @see https://t.me/Bybit_API_Announcements/468