bybit-api 4.2.0 → 4.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -64
- package/lib/rest-client-v5.d.ts +205 -2
- package/lib/rest-client-v5.js +218 -1
- package/lib/rest-client-v5.js.map +1 -1
- package/lib/types/request/v5-account.d.ts +4 -0
- package/lib/types/request/v5-crypto-loan.d.ts +127 -0
- package/lib/types/response/v5-account.d.ts +1 -0
- package/lib/types/response/v5-crypto-loan.d.ts +183 -0
- package/lib/types/shared-v5.d.ts +18 -1
- package/lib/types/websockets/ws-events.d.ts +2 -1
- package/lib/types/websockets/ws-events.js.map +1 -1
- package/lib/util/BaseRestClient.js +4 -0
- package/lib/util/BaseRestClient.js.map +1 -1
- package/lib/util/BaseWSClient.js +7 -0
- package/lib/util/BaseWSClient.js.map +1 -1
- package/lib/util/webCryptoAPI.d.ts +1 -0
- package/lib/util/webCryptoAPI.js +12 -0
- package/lib/util/webCryptoAPI.js.map +1 -1
- package/llms.txt +6011 -4732
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -29,10 +29,10 @@ Professional Node.js, JavaScript & TypeScript SDK for the Bybit REST APIs, WebSo
|
|
|
29
29
|
- Rate limits are raised to 400 requests per second, higher than the highest VIP tier.
|
|
30
30
|
- No action required. This is automatic for any API calls made with this SDK, for any user.
|
|
31
31
|
- Read more in the announcement: [here](https://github.com/tiagosiebler/bybit-api/issues/458).
|
|
32
|
-
- Lower minimum order notional value with this SDK
|
|
32
|
+
- Lower minimum order notional value with this SDK!\*
|
|
33
33
|
- Place orders with a notional value as low as $1.
|
|
34
34
|
- Lower than the default minimum notional order value $5.
|
|
35
|
-
-
|
|
35
|
+
- \*Note: the lower min notional requirement is an undocumented benefit that may end at any time.
|
|
36
36
|
- Automatic support for HMAC & RSA authentication.
|
|
37
37
|
- TypeScript support (thorough type declarations for most API requests & responses, including WS API).
|
|
38
38
|
- JavaScript support (TypeScript not required but definitely recommended).
|
|
@@ -46,21 +46,22 @@ Professional Node.js, JavaScript & TypeScript SDK for the Bybit REST APIs, WebSo
|
|
|
46
46
|
- Emit `reconnected` event when dropped connection is restored.
|
|
47
47
|
- WebSocket API integration, with two design patterns to choose from:
|
|
48
48
|
1. Asynchronous **promise**-driven responses:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
- Make requests like a REST API, using the WebSocket API. No need to subscribe to asynchronous events.
|
|
50
|
+
- Import the `WebsocketAPIClient` and use it like the REST API client. Call functions and await responses.
|
|
51
|
+
- See example for more details: [examples/ws-api-client.ts](./examples/ws-api-client.ts).
|
|
52
|
+
- Prefer something more raw? Use the `sendWSAPIRequest(...)` method and await responses
|
|
53
|
+
- See example for more details: [examples/ws-api-raw-promises.ts](./examples/ws-api-raw-promises.ts)
|
|
54
54
|
2. Asynchronous **event**-driven responses:
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
- Subscribe to `response` and `error` events from WebsocketClient's event emitter.
|
|
56
|
+
- Send commands with the `sendWSAPIRequest(...)` method.
|
|
57
|
+
- Responses to commands will arrive via the `response` and `error` events emitted by the client.
|
|
58
|
+
- See example for more details: [examples/ws-api-raw-events.ts](./examples/ws-api-raw-events.ts)
|
|
59
59
|
- Active community support & collaboration in telegram: [Node.js Algo Traders](https://t.me/nodetraders).
|
|
60
60
|
|
|
61
61
|
# Table of Contents
|
|
62
62
|
|
|
63
63
|
## Overview
|
|
64
|
+
|
|
64
65
|
- [Installation](#installation)
|
|
65
66
|
- [Issues & Discussion](#issues--discussion)
|
|
66
67
|
- [Related Projects](#related-projects)
|
|
@@ -68,16 +69,19 @@ Professional Node.js, JavaScript & TypeScript SDK for the Bybit REST APIs, WebSo
|
|
|
68
69
|
- [Examples](#examples)
|
|
69
70
|
|
|
70
71
|
## REST API Examples
|
|
72
|
+
|
|
71
73
|
- [API Clients](#api-clients)
|
|
72
74
|
- [REST API Usage](#rest-api-usage)
|
|
73
75
|
|
|
74
76
|
## WebSocket Integration & Examples
|
|
77
|
+
|
|
75
78
|
- [WebSockets](#websockets)
|
|
76
79
|
- [WebSocket Subscriptions - Consuming Events](#websocket-subscriptions---consuming-events)
|
|
77
80
|
- [Websocket API - Sending Orders via WebSockets](#websocket-api---sending-orders-via-websockets)
|
|
78
81
|
- [Consumer Load Balancing](#balancing-load-across-multiple-connections)
|
|
79
82
|
|
|
80
83
|
## Additional Features
|
|
84
|
+
|
|
81
85
|
- [Logging](#logging)
|
|
82
86
|
- [Customise Logging](#customise-logging)
|
|
83
87
|
- [Debug HTTP Requests](#debug-http-requests)
|
|
@@ -85,11 +89,13 @@ Professional Node.js, JavaScript & TypeScript SDK for the Bybit REST APIs, WebSo
|
|
|
85
89
|
- [Import](#import)
|
|
86
90
|
- [Webpack](#webpack)
|
|
87
91
|
- [Use with LLMs & AI](#use-with-llms--ai)
|
|
92
|
+
- [Used By](#used-by)
|
|
88
93
|
|
|
89
94
|
## Contributing
|
|
95
|
+
|
|
90
96
|
- [Contributions & Thanks](#contributions--thanks)
|
|
91
97
|
|
|
92
|
-
|
|
98
|
+
---
|
|
93
99
|
|
|
94
100
|
## Installation
|
|
95
101
|
|
|
@@ -135,7 +141,6 @@ Most methods accept JS objects. These can be populated using parameters specifie
|
|
|
135
141
|
|
|
136
142
|
The SDK is written in TypeScript, but fully compatible with both TypeScript and pure JavaScript projects. A pure JavaScript version can be built using `npm run build`. The output of the `build` command is the version published to npm, packaged as a JavaScript module (with types available for you TypeScript users).
|
|
137
143
|
|
|
138
|
-
|
|
139
144
|
- [src](./src) - the complete SDK written in TypeScript.
|
|
140
145
|
- [lib](./lib) - the JavaScript version of the project (built from TypeScript) that is published to npm. This should not be edited directly, as it will be overwritten with each release.
|
|
141
146
|
- [examples](./examples) - examples & demonstrations. Contributions are welcome!
|
|
@@ -160,13 +165,12 @@ Refer to the [V5 interface mapping page](https://bybit-exchange.github.io/docs/v
|
|
|
160
165
|
|
|
161
166
|
Here are the available REST clients and the corresponding API groups described in the documentation:
|
|
162
167
|
|
|
163
|
-
|
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
|
|
168
|
+
| Class | Description |
|
|
169
|
+
| :-----------------------------------------------: | :------------------------------------------------------------------------------------------------------: |
|
|
170
|
+
| [ **V5 API** ] | The new unified V5 APIs (successor to previously fragmented APIs for all API groups). |
|
|
171
|
+
| [RestClientV5](src/rest-client-v5.ts) | Unified V5 all-in-one REST client for all [V5 REST APIs](https://bybit-exchange.github.io/docs/v5/intro) |
|
|
172
|
+
| [WebsocketClient](src/websocket-client.ts) | All WebSocket features (Public & Private consumers for all API categories & the WebSocket API) |
|
|
173
|
+
| [WebsocketAPIClient](src/websocket-api-client.ts) | Use the WebSocket API like a REST API. Call functions and await responses, powered by WebSockets. |
|
|
170
174
|
|
|
171
175
|
## REST API Usage
|
|
172
176
|
|
|
@@ -175,7 +179,6 @@ Create API credentials on Bybit's website:
|
|
|
175
179
|
- [Livenet](https://bybit.com/app/user/api-management?affiliate_id=9410&language=en-US&group_id=0&group_type=1)
|
|
176
180
|
- [Testnet](https://testnet.bybit.com/app/user/api-management)
|
|
177
181
|
|
|
178
|
-
|
|
179
182
|
The following is a minimal example for using the REST clients included with this SDK. For more detailed examples, refer to the [examples](./examples/) folder in the repository on GitHub:
|
|
180
183
|
|
|
181
184
|
```typescript
|
|
@@ -242,34 +245,37 @@ const restClientOptions = {
|
|
|
242
245
|
const API_KEY = 'xxx';
|
|
243
246
|
const API_SECRET = 'yyy';
|
|
244
247
|
|
|
245
|
-
const client = new RestClientV5(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
248
|
+
const client = new RestClientV5(
|
|
249
|
+
{
|
|
250
|
+
key: API_KEY,
|
|
251
|
+
secret: API_SECRET,
|
|
252
|
+
// demoTrading: true,
|
|
249
253
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
},
|
|
254
|
+
// Optional: enable to try parsing rate limit values from responses
|
|
255
|
+
// parseAPIRateLimits: true
|
|
256
|
+
},
|
|
253
257
|
// requestLibraryOptions
|
|
254
258
|
);
|
|
255
259
|
|
|
256
260
|
// For public-only API calls, simply don't provide a key & secret or set them to undefined
|
|
257
261
|
// const client = new RestClientV5();
|
|
258
262
|
|
|
259
|
-
client
|
|
260
|
-
.
|
|
261
|
-
|
|
263
|
+
client
|
|
264
|
+
.getAccountInfo()
|
|
265
|
+
.then((result) => {
|
|
266
|
+
console.log('getAccountInfo result: ', result);
|
|
262
267
|
})
|
|
263
|
-
.catch(err => {
|
|
264
|
-
console.error(
|
|
268
|
+
.catch((err) => {
|
|
269
|
+
console.error('getAccountInfo error: ', err);
|
|
265
270
|
});
|
|
266
271
|
|
|
267
|
-
client
|
|
268
|
-
.
|
|
269
|
-
|
|
272
|
+
client
|
|
273
|
+
.getOrderbook({ category: 'linear', symbol: 'BTCUSDT' })
|
|
274
|
+
.then((result) => {
|
|
275
|
+
console.log('getOrderBook result: ', result);
|
|
270
276
|
})
|
|
271
|
-
.catch(err => {
|
|
272
|
-
console.error(
|
|
277
|
+
.catch((err) => {
|
|
278
|
+
console.error('getOrderBook error: ', err);
|
|
273
279
|
});
|
|
274
280
|
```
|
|
275
281
|
|
|
@@ -416,6 +422,7 @@ ws.on('reconnected', (data) => {
|
|
|
416
422
|
Bybit supports sending, amending and cancelling orders over a WebSocket connection. The [WebsocketClient](./src/WebsocketClient.ts) fully supports Bybit's WebSocket API via the `sendWSAPIRequest(...)` method. There is also a dedicated [WebsocketAPIClient](./src/websocket-api-client.ts), built over the WSClient's sendWSAPIRequest mechanism for a simpler experience.
|
|
417
423
|
|
|
418
424
|
Links for reference:
|
|
425
|
+
|
|
419
426
|
- [Bybit WebSocket API Documentation](https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline)
|
|
420
427
|
- [WebsocketAPIClient example, use the Websocket API like a REST API](./examples/ws-api-client.ts)
|
|
421
428
|
- [Raw Asynchronous Websocket API Node.js/TypeScript/JavaScript example](./examples/ws-api-raw-promises.ts)
|
|
@@ -423,16 +430,17 @@ Links for reference:
|
|
|
423
430
|
Note: as of January 2025, the demo trading environment does not support the WebSocket API.
|
|
424
431
|
|
|
425
432
|
There are two ways to use the WS API, depending on individual preference:
|
|
433
|
+
|
|
426
434
|
1. event-driven:
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
435
|
+
- send requests via `client.sendWSAPIRequest(wsKey, operation, params)`, fire and forget
|
|
436
|
+
- handle async replies via event handlers on `client.on('exception', cb)` and `client.on('response', cb)`
|
|
437
|
+
- See example for more details: [examples/ws-api-raw-events.ts](./examples/ws-api-raw-events.ts)
|
|
430
438
|
2. promise-driven:
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
439
|
+
- import the `WebsocketAPIClient` and use it much like a REST API.
|
|
440
|
+
- make an instance & call the Websocket API with a function.
|
|
441
|
+
- await responses, much like a REST API.
|
|
442
|
+
- use try/catch blocks to handle promise rejections
|
|
443
|
+
- See example for more details: [examples/ws-api-client.ts](./examples/ws-api-client.ts)
|
|
436
444
|
|
|
437
445
|
The below example demonstrates the promise-driven approach, which behaves similar to a REST API. The WebSocket API even accepts the same parameters as the corresponding REST API endpoints, so this approach should be compatible with existing REST implementations.
|
|
438
446
|
|
|
@@ -448,25 +456,23 @@ const { WS_KEY_MAP, WebsocketAPIClient } = require('bybit-api');
|
|
|
448
456
|
// top of the WebsocketClient and will automatically handle WebSocket
|
|
449
457
|
// persistence and authentication for you.
|
|
450
458
|
// supports HMAC & RSA API keys - automatically detected
|
|
451
|
-
const wsClient = new WebsocketAPIClient(
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
secret: 'yourApiSecretHere',
|
|
459
|
+
const wsClient = new WebsocketAPIClient({
|
|
460
|
+
key: 'yourApiKeyHere',
|
|
461
|
+
secret: 'yourApiSecretHere',
|
|
455
462
|
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
463
|
+
// Whether to use the testnet environment.
|
|
464
|
+
// Create testnet API keys here: https://testnet.bybit.com/app/user/api-management
|
|
465
|
+
// testnet: true,
|
|
459
466
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
467
|
+
// Whether to use the livenet demo trading environment
|
|
468
|
+
// Note: As of Jan 2025, demo trading only supports consuming events, it does
|
|
469
|
+
// NOT support the WS API.
|
|
470
|
+
// demoTrading: false,
|
|
464
471
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
);
|
|
472
|
+
// If you want your own event handlers instead of the default ones with logs,
|
|
473
|
+
// disable this setting and see ws-api-client example for more details.
|
|
474
|
+
// attachEventListeners: false
|
|
475
|
+
});
|
|
470
476
|
|
|
471
477
|
// This example is wrapped in an async function, so "await" can be used
|
|
472
478
|
async function main() {
|
|
@@ -523,7 +529,6 @@ async function main() {
|
|
|
523
529
|
|
|
524
530
|
// Start executing the example workflow
|
|
525
531
|
main();
|
|
526
|
-
|
|
527
532
|
```
|
|
528
533
|
|
|
529
534
|
---
|
|
@@ -561,7 +566,10 @@ const customLogger = {
|
|
|
561
566
|
trace: (...params) => console.log('trace', ...params),
|
|
562
567
|
};
|
|
563
568
|
|
|
564
|
-
const wsClient = new WebsocketClient(
|
|
569
|
+
const wsClient = new WebsocketClient(
|
|
570
|
+
{ key: 'xxx', secret: 'yyy' },
|
|
571
|
+
customLogger,
|
|
572
|
+
);
|
|
565
573
|
```
|
|
566
574
|
|
|
567
575
|
### Debug HTTP requests
|
|
@@ -613,6 +621,12 @@ This file contains AI optimised structure of all the functions in this package,
|
|
|
613
621
|
|
|
614
622
|
---
|
|
615
623
|
|
|
624
|
+
## Used By
|
|
625
|
+
|
|
626
|
+
[](https://github.com/tiagosiebler/bybit-api/network/dependents)
|
|
627
|
+
|
|
628
|
+
---
|
|
629
|
+
|
|
616
630
|
<!-- template_contributions -->
|
|
617
631
|
|
|
618
632
|
### Contributions & Thanks
|
package/lib/rest-client-v5.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountBorrowCollateralLimitV5, AccountCoinBalanceV5, AccountInfoV5, AccountMarginModeV5, AccountOrderV5, AccountTypeV5, AddOrReduceMarginParamsV5, AddOrReduceMarginResultV5, AffiliateUserInfoV5, AffiliateUserListItemV5, AllCoinsBalanceV5, AllowedDepositCoinInfoV5, AmendOrderParamsV5, AmendSpreadOrderParamsV5, ApiKeyInfoV5, APIResponseV3, APIResponseV3WithTime, AssetInfoV5, BatchAmendOrderParamsV5, BatchAmendOrderResultV5, BatchCancelOrderParamsV5, BatchCancelOrderResultV5, BatchCreateOrderResultV5, BatchOrderParamsV5, BatchOrdersRetExtInfoV5, BorrowCryptoLoanParamsV5, BorrowHistoryRecordV5, BrokerIssuedVoucherV5, BrokerVoucherSpecV5, CancelAllOrdersParamsV5, CancelOrderParamsV5, CategoryCursorListV5, CategoryListV5, CategorySymbolListV5, CategoryV5, ClosedOptionsPositionV5, ClosedPnLV5, CoinExchangeRecordV5, CoinGreeksV5, CoinInfoV5, CollateralInfoV5, CompletedLoanOrderV5, ConfirmNewRiskLimitParamsV5, ConvertCoinsParamsV5, ConvertCoinSpecV5, ConvertHistoryRecordV5, ConvertQuoteV5, ConvertStatusV5, CreateP2PAdParamsV5, CreateSubApiKeyParamsV5, CreateSubApiKeyResultV5, CreateSubMemberParamsV5, CreateSubMemberResultV5, CursorListV5, CursorRowsV5, DCPInfoV5, DeleteSubMemberParamsV5, DeliveryPriceV5, DeliveryRecordV5, DepositAddressChainV5, DepositRecordV5, EarnOrderHistoryV5, EarnPositionV5, EarnProductV5, ExchangeBrokerAccountInfoV5, ExchangeBrokerEarningResultV5, ExchangeBrokerSubAccountDepositRecordV5, ExecutionV5, FeeRateV5, FundingRateHistoryResponseV5, GetAccountCoinBalanceParamsV5, GetAccountHistoricOrdersParamsV5, GetAccountOrdersParamsV5, GetAllCoinsBalanceParamsV5, GetAllowedDepositCoinInfoParamsV5, GetAssetInfoParamsV5, GetBorrowHistoryParamsV5, GetBrokerIssuedVoucherParamsV5, GetBrokerSubAccountDepositsV5, GetClassicTransactionLogsParamsV5, GetClosedOptionsPositionsParamsV5, GetClosedPnLParamsV5, GetCoinExchangeRecordParamsV5, GetCompletedLoanOrderHistoryParamsV5, GetConvertHistoryParamsV5, GetDeliveryPriceParamsV5, GetDeliveryRecordParamsV5, GetDepositRecordParamsV5, GetEarnOrderHistoryParamsV5, GetEarnPositionParamsV5, GetExchangeBrokerEarningsParamsV5, GetExecutionListParamsV5, GetFeeRateParamsV5, GetFundingRateHistoryParamsV5, GetHistoricalVolatilityParamsV5, GetIndexPriceKlineParamsV5, GetInstrumentsInfoParamsV5, GetInsuranceParamsV5, GetInternalDepositRecordParamsV5, GetInternalTransferParamsV5, GetKlineParamsV5, GetLoanLTVAdjustmentHistoryParamsV5, GetLongShortRatioParamsV5, GetMarkPriceKlineParamsV5, GetMovePositionHistoryParamsV5, GetOpenInterestParamsV5, GetOptionDeliveryPriceParamsV5, GetOrderbookParamsV5, GetP2PAccountCoinsBalanceParamsV5, GetP2PCounterpartyUserInfoParamsV5, GetP2POnlineAdsParamsV5, GetP2POrderMessagesParamsV5, GetP2POrdersParamsV5, GetP2PPendingOrdersParamsV5, GetP2PPersonalAdsParamsV5, GetPremiumIndexPriceKlineParamsV5, GetPreUpgradeClosedPnlParamsV5, GetPreUpgradeOptionDeliveryRecordParamsV5, GetPreUpgradeOrderHistoryParamsV5, GetPreUpgradeTradeHistoryParamsV5, GetPreUpgradeTransactionLogParamsV5, GetPreUpgradeUSDCSessionParamsV5, GetPublicTradingHistoryParamsV5, GetRepaymentHistoryParamsV5, GetRiskLimitParamsV5, GetSettlementRecordParamsV5, GetSpreadInstrumentsInfoParamsV5, GetSpreadOpenOrdersParamsV5, GetSpreadOrderHistoryParamsV5, GetSpreadTradeHistoryParamsV5, GetSubAccountAllApiKeysParamsV5, GetSubAccountDepositRecordParamsV5, GetTickersParamsV5, GetTransactionLogParamsV5, GetUniversalTransferRecordsParamsV5, GetUnpaidLoanOrdersParamsV5, GetVIPMarginDataParamsV5, GetWalletBalanceParamsV5, GetWithdrawalRecordsParamsV5, HistoricalVolatilityV5, InstrumentInfoResponseV5, InsuranceResponseV5, InternalDepositRecordV5, InternalTransferRecordV5, IssueVoucherParamsV5, LoanLTVAdjustmentHistoryV5, LongShortRatioV5, MarkP2POrderAsPaidParamsV5, MMPModifyParamsV5, MMPStateV5, MovePositionHistoryV5, MovePositionParamsV5, MovePositionResultV5, OHLCKlineV5, OHLCVKlineV5, OpenInterestResponseV5, OptionDeliveryPriceV5, OrderbookResponseV5, OrderParamsV5, OrderPriceLimitV5, OrderResultV5, OrderSideV5, P2PAccountCoinsBalanceV5, P2PAdDetailV5, P2PCounterpartyUserInfoV5, P2PCreateAdResponseV5, P2POnlineAdsResponseV5, P2POrderDetailV5, P2POrderMessageV5, P2POrdersResponseV5, P2PPersonalAdsResponseV5, P2PUserInfoV5, P2PUserPaymentV5, PositionInfoParamsV5, PositionV5, PreCheckOrderResultV5, PreUpgradeOptionsDelivery, PreUpgradeTransaction, PreUpgradeUSDCSessionSettlement, PublicTradeV5, RepayLiabilityParamsV5, RepayLiabilityResultV5, RepaymentHistoryV5, RequestConvertQuoteParamsV5, RiskLimitV5, SendP2POrderMessageParamsV5, SetAutoAddMarginParamsV5, SetCollateralCoinParamsV5, SetLeverageParamsV5, SetRiskLimitParamsV5, SetRiskLimitResultV5, SettlementRecordV5, SetTPSLModeParamsV5, SetTradingStopParamsV5, SpotBorrowCheckResultV5, SpotMarginStateV5, SpreadInstrumentInfoV5, SpreadOpenOrderV5, SpreadOrderbookResponseV5, SpreadOrderHistoryV5, SpreadRecentTradeV5, SpreadTickerV5, SpreadTradeV5, SubMemberV5, SubmitSpreadOrderParamsV5, SubmitStakeRedeemParamsV5, SwitchIsolatedMarginParamsV5, SwitchPositionModeParamsV5, TickerLinearInverseV5, TickerOptionV5, TickerSpotV5, TPSLModeV5, TransactionLogV5, UnifiedAccountUpgradeResultV5, UniversalTransferParamsV5, UniversalTransferRecordV5, UnpaidLoanOrderV5, UpdateApiKeyParamsV5, UpdateApiKeyResultV5, UpdateP2PAdParamsV5, VaspEntityV5, VipBorrowableCoinsV5, VipCollateralCoinsV5, VIPMarginDataV5, WalletBalanceV5, WithdrawableAmountV5, WithdrawalRecordV5, WithdrawParamsV5 } from './types';
|
|
1
|
+
import { AccountBorrowCollateralLimitV5, AccountCoinBalanceV5, AccountInfoV5, AccountMarginModeV5, AccountOrderV5, AccountTypeV5, AddOrReduceMarginParamsV5, AddOrReduceMarginResultV5, AdjustCollateralAmountParamsV5, AdjustCollateralAmountV5, AffiliateUserInfoV5, AffiliateUserListItemV5, AllCoinsBalanceV5, AllowedDepositCoinInfoV5, AmendOrderParamsV5, AmendSpreadOrderParamsV5, ApiKeyInfoV5, APIResponseV3, APIResponseV3WithTime, AssetInfoV5, BatchAmendOrderParamsV5, BatchAmendOrderResultV5, BatchCancelOrderParamsV5, BatchCancelOrderResultV5, BatchCreateOrderResultV5, BatchOrderParamsV5, BatchOrdersRetExtInfoV5, BorrowableCoinV5, BorrowContractInfoFixedV5, BorrowCryptoLoanParamsV5, BorrowFlexibleParamsV5, BorrowFlexibleV5, BorrowHistoryFlexibleV5, BorrowHistoryRecordV5, BorrowOrderInfoFixedV5, BorrowOrderQuoteFixedV5, BrokerIssuedVoucherV5, BrokerVoucherSpecV5, CancelAllOrdersParamsV5, CancelBorrowOrderFixedParamsV5, CancelOrderParamsV5, CancelSupplyOrderFixedParamsV5, CategoryCursorListV5, CategoryListV5, CategorySymbolListV5, CategoryV5, ClosedOptionsPositionV5, ClosedPnLV5, CoinExchangeRecordV5, CoinGreeksV5, CoinInfoV5, CollateralAdjustmentHistoryV5, CollateralDataV5, CollateralInfoV5, CompletedLoanOrderV5, ConfirmNewRiskLimitParamsV5, ConvertCoinsParamsV5, ConvertCoinSpecV5, ConvertHistoryRecordV5, ConvertQuoteV5, ConvertStatusV5, CreateBorrowOrderFixedParamsV5, CreateBorrowOrderFixedV5, CreateP2PAdParamsV5, CreateSubApiKeyParamsV5, CreateSubApiKeyResultV5, CreateSubMemberParamsV5, CreateSubMemberResultV5, CreateSupplyOrderFixedParamsV5, CreateSupplyOrderFixedV5, CryptoLoanPositionV5, CursorListV5, CursorRowsV5, DCPInfoV5, DeleteSubMemberParamsV5, DeliveryPriceV5, DeliveryRecordV5, DepositAddressChainV5, DepositRecordV5, EarnOrderHistoryV5, EarnPositionV5, EarnProductV5, ExchangeBrokerAccountInfoV5, ExchangeBrokerEarningResultV5, ExchangeBrokerSubAccountDepositRecordV5, ExecutionV5, FeeRateV5, FundingRateHistoryResponseV5, GetAccountCoinBalanceParamsV5, GetAccountHistoricOrdersParamsV5, GetAccountOrdersParamsV5, GetAllCoinsBalanceParamsV5, GetAllowedDepositCoinInfoParamsV5, GetAssetInfoParamsV5, GetBorrowableCoinsParamsV5, GetBorrowContractInfoFixedParamsV5, GetBorrowHistoryFlexibleParamsV5, GetBorrowHistoryParamsV5, GetBorrowOrderInfoFixedParamsV5, GetBorrowOrderQuoteFixedParamsV5, GetBrokerIssuedVoucherParamsV5, GetBrokerSubAccountDepositsV5, GetClassicTransactionLogsParamsV5, GetClosedOptionsPositionsParamsV5, GetClosedPnLParamsV5, GetCoinExchangeRecordParamsV5, GetCollateralAdjustmentHistoryParamsV5, GetCollateralCoinsParamsV5, GetCompletedLoanOrderHistoryParamsV5, GetConvertHistoryParamsV5, GetDeliveryPriceParamsV5, GetDeliveryRecordParamsV5, GetDepositRecordParamsV5, GetEarnOrderHistoryParamsV5, GetEarnPositionParamsV5, GetExchangeBrokerEarningsParamsV5, GetExecutionListParamsV5, GetFeeRateParamsV5, GetFundingRateHistoryParamsV5, GetHistoricalVolatilityParamsV5, GetIndexPriceKlineParamsV5, GetInstrumentsInfoParamsV5, GetInsuranceParamsV5, GetInternalDepositRecordParamsV5, GetInternalTransferParamsV5, GetKlineParamsV5, GetLoanLTVAdjustmentHistoryParamsV5, GetLongShortRatioParamsV5, GetMarkPriceKlineParamsV5, GetMaxCollateralAmountParamsV5, GetMovePositionHistoryParamsV5, GetOngoingFlexibleLoansParamsV5, GetOpenInterestParamsV5, GetOptionDeliveryPriceParamsV5, GetOrderbookParamsV5, GetP2PAccountCoinsBalanceParamsV5, GetP2PCounterpartyUserInfoParamsV5, GetP2POnlineAdsParamsV5, GetP2POrderMessagesParamsV5, GetP2POrdersParamsV5, GetP2PPendingOrdersParamsV5, GetP2PPersonalAdsParamsV5, GetPremiumIndexPriceKlineParamsV5, GetPreUpgradeClosedPnlParamsV5, GetPreUpgradeOptionDeliveryRecordParamsV5, GetPreUpgradeOrderHistoryParamsV5, GetPreUpgradeTradeHistoryParamsV5, GetPreUpgradeTransactionLogParamsV5, GetPreUpgradeUSDCSessionParamsV5, GetPublicTradingHistoryParamsV5, GetRepaymentHistoryFixedParamsV5, GetRepaymentHistoryFlexibleParamsV5, GetRepaymentHistoryParamsV5, GetRiskLimitParamsV5, GetSettlementRecordParamsV5, GetSpreadInstrumentsInfoParamsV5, GetSpreadOpenOrdersParamsV5, GetSpreadOrderHistoryParamsV5, GetSpreadTradeHistoryParamsV5, GetSubAccountAllApiKeysParamsV5, GetSubAccountDepositRecordParamsV5, GetSupplyContractInfoFixedParamsV5, GetSupplyOrderInfoFixedParamsV5, GetSupplyOrderQuoteFixedParamsV5, GetSystemStatusParamsV5, GetTickersParamsV5, GetTransactionLogParamsV5, GetUniversalTransferRecordsParamsV5, GetUnpaidLoanOrdersParamsV5, GetVIPMarginDataParamsV5, GetWalletBalanceParamsV5, GetWithdrawalRecordsParamsV5, HistoricalVolatilityV5, InstrumentInfoResponseV5, InsuranceResponseV5, InternalDepositRecordV5, InternalTransferRecordV5, IssueVoucherParamsV5, LoanLTVAdjustmentHistoryV5, LongShortRatioV5, MarkP2POrderAsPaidParamsV5, MMPModifyParamsV5, MMPStateV5, MovePositionHistoryV5, MovePositionParamsV5, MovePositionResultV5, OHLCKlineV5, OHLCVKlineV5, OngoingFlexibleLoanV5, OpenInterestResponseV5, OptionDeliveryPriceV5, OrderbookResponseV5, OrderParamsV5, OrderPriceLimitV5, OrderResultV5, OrderSideV5, P2PAccountCoinsBalanceV5, P2PAdDetailV5, P2PCounterpartyUserInfoV5, P2PCreateAdResponseV5, P2POnlineAdsResponseV5, P2POrderDetailV5, P2POrderMessageV5, P2POrdersResponseV5, P2PPersonalAdsResponseV5, P2PUserInfoV5, P2PUserPaymentV5, PositionInfoParamsV5, PositionV5, PreCheckOrderResultV5, PreUpgradeOptionsDelivery, PreUpgradeTransaction, PreUpgradeUSDCSessionSettlement, PublicTradeV5, RepayFixedParamsV5, RepayFixedV5, RepayFlexibleParamsV5, RepayFlexibleV5, RepayLiabilityParamsV5, RepayLiabilityResultV5, RepaymentHistoryFixedV5, RepaymentHistoryFlexibleV5, RepaymentHistoryV5, RequestConvertQuoteParamsV5, RiskLimitV5, SendP2POrderMessageParamsV5, SetAutoAddMarginParamsV5, SetCollateralCoinParamsV5, SetLeverageParamsV5, SetLimitPriceActionParamsV5, SetRiskLimitParamsV5, SetRiskLimitResultV5, SettlementRecordV5, SetTPSLModeParamsV5, SetTradingStopParamsV5, SpotBorrowCheckResultV5, SpotMarginStateV5, SpreadInstrumentInfoV5, SpreadOpenOrderV5, SpreadOrderbookResponseV5, SpreadOrderHistoryV5, SpreadRecentTradeV5, SpreadTickerV5, SpreadTradeV5, SubMemberV5, SubmitSpreadOrderParamsV5, SubmitStakeRedeemParamsV5, SupplyContractInfoFixedV5, SupplyOrderInfoFixedV5, SupplyOrderQuoteFixedV5, SwitchIsolatedMarginParamsV5, SwitchPositionModeParamsV5, SystemStatusItemV5, TickerLinearInverseV5, TickerOptionV5, TickerSpotV5, TPSLModeV5, TransactionLogV5, UnifiedAccountUpgradeResultV5, UniversalTransferParamsV5, UniversalTransferRecordV5, UnpaidLoanOrderV5, UpdateApiKeyParamsV5, UpdateApiKeyResultV5, UpdateP2PAdParamsV5, VaspEntityV5, VipBorrowableCoinsV5, VipCollateralCoinsV5, VIPMarginDataV5, WalletBalanceV5, WithdrawableAmountV5, WithdrawalRecordV5, WithdrawParamsV5 } from './types';
|
|
2
2
|
import BaseRestClient from './util/BaseRestClient';
|
|
3
3
|
/**
|
|
4
4
|
* REST API client for V5 REST APIs
|
|
@@ -24,6 +24,9 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
24
24
|
****** Misc Bybit APIs
|
|
25
25
|
*
|
|
26
26
|
*/
|
|
27
|
+
getSystemStatus(params?: GetSystemStatusParamsV5): Promise<APIResponseV3WithTime<{
|
|
28
|
+
list: SystemStatusItemV5[];
|
|
29
|
+
}>>;
|
|
27
30
|
getClientType(): "v5";
|
|
28
31
|
fetchServerTime(): Promise<number>;
|
|
29
32
|
getServerTime(): Promise<APIResponseV3WithTime<{
|
|
@@ -687,6 +690,14 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
687
690
|
setSpotHedging(params: {
|
|
688
691
|
setHedgingMode: 'ON' | 'OFF';
|
|
689
692
|
}): Promise<APIResponseV3WithTime<{}>>;
|
|
693
|
+
/**
|
|
694
|
+
* Set Limit Price Behaviour
|
|
695
|
+
* You can configure how the system behaves when your limit order price exceeds the highest bid or lowest ask price.
|
|
696
|
+
*
|
|
697
|
+
* Spot: If the order price exceeds the boundary, the system rejects the request.
|
|
698
|
+
* Futures: If the order price exceeds the boundary, the system will automatically adjust the price to the nearest allowed boundary.
|
|
699
|
+
*/
|
|
700
|
+
setLimitPriceAction(params: SetLimitPriceActionParamsV5): Promise<APIResponseV3WithTime<{}>>;
|
|
690
701
|
/**
|
|
691
702
|
* Configure Market Maker Protection (MMP)
|
|
692
703
|
*/
|
|
@@ -1286,13 +1297,16 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1286
1297
|
}>>;
|
|
1287
1298
|
/**
|
|
1288
1299
|
*
|
|
1289
|
-
****** Crypto Loan
|
|
1300
|
+
****** Crypto Loan - Legacy
|
|
1301
|
+
*
|
|
1302
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1290
1303
|
*
|
|
1291
1304
|
*/
|
|
1292
1305
|
/**
|
|
1293
1306
|
* Get Collateral Coins
|
|
1294
1307
|
*
|
|
1295
1308
|
* INFO: Do not need authentication
|
|
1309
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1296
1310
|
*/
|
|
1297
1311
|
getCollateralCoins(params?: {
|
|
1298
1312
|
vipLevel?: string;
|
|
@@ -1304,6 +1318,7 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1304
1318
|
* Get Borrowable Coins
|
|
1305
1319
|
*
|
|
1306
1320
|
* INFO: Do not need authentication
|
|
1321
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1307
1322
|
*/
|
|
1308
1323
|
getBorrowableCoins(params?: {
|
|
1309
1324
|
vipLevel?: string;
|
|
@@ -1316,6 +1331,7 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1316
1331
|
* Query the account borrowable/collateral limit
|
|
1317
1332
|
*
|
|
1318
1333
|
* Permission: "Spot trade"
|
|
1334
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1319
1335
|
*/
|
|
1320
1336
|
getAccountBorrowCollateralLimit(params: {
|
|
1321
1337
|
loanCurrency: string;
|
|
@@ -1323,6 +1339,7 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1323
1339
|
}): Promise<APIResponseV3WithTime<AccountBorrowCollateralLimitV5>>;
|
|
1324
1340
|
/**
|
|
1325
1341
|
* Borrow Crypto Loan
|
|
1342
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1326
1343
|
*
|
|
1327
1344
|
* Permission: "Spot trade"
|
|
1328
1345
|
*
|
|
@@ -1336,6 +1353,8 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1336
1353
|
/**
|
|
1337
1354
|
* Repay Crypto Loan
|
|
1338
1355
|
*
|
|
1356
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1357
|
+
*
|
|
1339
1358
|
* You can repay partial loan. If there is interest occurred, interest will be repaid in priority
|
|
1340
1359
|
*
|
|
1341
1360
|
* Permission: "Spot trade"
|
|
@@ -1354,6 +1373,8 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1354
1373
|
* Get Unpaid Loan Orders
|
|
1355
1374
|
* Query the ongoing loan orders, which are not fully repaid
|
|
1356
1375
|
*
|
|
1376
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1377
|
+
*
|
|
1357
1378
|
* Permission: "Spot trade"
|
|
1358
1379
|
*/
|
|
1359
1380
|
getUnpaidLoanOrders(params?: GetUnpaidLoanOrdersParamsV5): Promise<APIResponseV3WithTime<{
|
|
@@ -1364,6 +1385,8 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1364
1385
|
* Get Repayment Transaction History
|
|
1365
1386
|
* Query repaid transaction history
|
|
1366
1387
|
*
|
|
1388
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1389
|
+
*
|
|
1367
1390
|
* Permission: "Spot trade"
|
|
1368
1391
|
*
|
|
1369
1392
|
* INFO:
|
|
@@ -1378,6 +1401,8 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1378
1401
|
* Get Completed Loan Order History
|
|
1379
1402
|
* Query the completed loan orders
|
|
1380
1403
|
*
|
|
1404
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1405
|
+
*
|
|
1381
1406
|
* Permission: "Spot trade"
|
|
1382
1407
|
*
|
|
1383
1408
|
* INFO:
|
|
@@ -1391,6 +1416,8 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1391
1416
|
* Get Max. Allowed Reduction Collateral Amount
|
|
1392
1417
|
* Query the maximum allowed reduction collateral amount
|
|
1393
1418
|
*
|
|
1419
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1420
|
+
*
|
|
1394
1421
|
* Permission: "Spot trade"
|
|
1395
1422
|
*/
|
|
1396
1423
|
getMaxAllowedReductionCollateralAmount(params: {
|
|
@@ -1402,6 +1429,8 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1402
1429
|
* Adjust Collateral Amount
|
|
1403
1430
|
* You can increase or reduce collateral amount. When you reduce, please follow the max. allowed reduction amount.
|
|
1404
1431
|
*
|
|
1432
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1433
|
+
*
|
|
1405
1434
|
* Permission: "Spot trade"
|
|
1406
1435
|
*
|
|
1407
1436
|
* INFO:
|
|
@@ -1418,6 +1447,8 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1418
1447
|
* Get Loan LTV Adjustment History
|
|
1419
1448
|
* Query the transaction history of collateral amount adjustment
|
|
1420
1449
|
*
|
|
1450
|
+
* @deprecated - Use "Crypto Loan - New" Endpoints instead
|
|
1451
|
+
*
|
|
1421
1452
|
* Permission: "Spot trade"
|
|
1422
1453
|
*
|
|
1423
1454
|
* INFO:
|
|
@@ -1428,6 +1459,178 @@ export declare class RestClientV5 extends BaseRestClient {
|
|
|
1428
1459
|
list: LoanLTVAdjustmentHistoryV5[];
|
|
1429
1460
|
nextPageCursor: string;
|
|
1430
1461
|
}>>;
|
|
1462
|
+
/**
|
|
1463
|
+
*
|
|
1464
|
+
****** Crypto Loan New
|
|
1465
|
+
*
|
|
1466
|
+
*/
|
|
1467
|
+
/**
|
|
1468
|
+
* Get Borrowable Coins New
|
|
1469
|
+
*
|
|
1470
|
+
*/
|
|
1471
|
+
getLoanBorrowableCoins(params?: GetBorrowableCoinsParamsV5): Promise<APIResponseV3WithTime<{
|
|
1472
|
+
list: BorrowableCoinV5[];
|
|
1473
|
+
}>>;
|
|
1474
|
+
/**
|
|
1475
|
+
* Get Collateral Coins New
|
|
1476
|
+
*
|
|
1477
|
+
*/
|
|
1478
|
+
getLoanCollateralCoins(params?: GetCollateralCoinsParamsV5): Promise<APIResponseV3WithTime<CollateralDataV5>>;
|
|
1479
|
+
/**
|
|
1480
|
+
* Get Max. Allowed Collateral Reduction Amount New
|
|
1481
|
+
*
|
|
1482
|
+
*/
|
|
1483
|
+
getMaxCollateralAmount(params: GetMaxCollateralAmountParamsV5): Promise<APIResponseV3WithTime<{
|
|
1484
|
+
maxCollateralAmount: string;
|
|
1485
|
+
}>>;
|
|
1486
|
+
/**
|
|
1487
|
+
* Adjust Collateral Amount New
|
|
1488
|
+
* You can increase or reduce your collateral amount. When you reduce, please obey the Get Max. Allowed Collateral Reduction Amount
|
|
1489
|
+
*/
|
|
1490
|
+
updateCollateralAmount(params: AdjustCollateralAmountParamsV5): Promise<APIResponseV3WithTime<AdjustCollateralAmountV5>>;
|
|
1491
|
+
/**
|
|
1492
|
+
* Get Collateral Adjustment History New
|
|
1493
|
+
* Query for your LTV adjustment history.
|
|
1494
|
+
*
|
|
1495
|
+
*/
|
|
1496
|
+
getCollateralAdjustmentHistory(params?: GetCollateralAdjustmentHistoryParamsV5): Promise<APIResponseV3WithTime<{
|
|
1497
|
+
list: CollateralAdjustmentHistoryV5[];
|
|
1498
|
+
nextPageCursor: string;
|
|
1499
|
+
}>>;
|
|
1500
|
+
/**
|
|
1501
|
+
* Get Crypto Loan Position New
|
|
1502
|
+
*
|
|
1503
|
+
*/
|
|
1504
|
+
getCryptoLoanPosition(): Promise<APIResponseV3WithTime<CryptoLoanPositionV5>>;
|
|
1505
|
+
/**
|
|
1506
|
+
*
|
|
1507
|
+
****** Crypto Loan New - Flexible Loan
|
|
1508
|
+
*
|
|
1509
|
+
*/
|
|
1510
|
+
/**
|
|
1511
|
+
* Borrow Flexible Loan
|
|
1512
|
+
* Fully or partially repay a loan. If interest is due, that is paid off first, with the loaned amount being paid off only after due interest.
|
|
1513
|
+
*
|
|
1514
|
+
*/
|
|
1515
|
+
borrowFlexible(params: BorrowFlexibleParamsV5): Promise<APIResponseV3WithTime<BorrowFlexibleV5>>;
|
|
1516
|
+
/**
|
|
1517
|
+
* Repay Flexible Loan
|
|
1518
|
+
* Fully or partially repay a loan. If interest is due, that is paid off first, with the loaned amount being paid off only after due interest.
|
|
1519
|
+
*
|
|
1520
|
+
*/
|
|
1521
|
+
repayFlexible(params: RepayFlexibleParamsV5): Promise<APIResponseV3WithTime<RepayFlexibleV5>>;
|
|
1522
|
+
/**
|
|
1523
|
+
* Get Flexible Loans
|
|
1524
|
+
* Query for your ongoing loans
|
|
1525
|
+
*
|
|
1526
|
+
*/
|
|
1527
|
+
getOngoingFlexibleLoans(params?: GetOngoingFlexibleLoansParamsV5): Promise<APIResponseV3WithTime<{
|
|
1528
|
+
list: OngoingFlexibleLoanV5[];
|
|
1529
|
+
}>>;
|
|
1530
|
+
/**
|
|
1531
|
+
* Get Borrow Orders History
|
|
1532
|
+
*
|
|
1533
|
+
*/
|
|
1534
|
+
getBorrowHistoryFlexible(params?: GetBorrowHistoryFlexibleParamsV5): Promise<APIResponseV3WithTime<{
|
|
1535
|
+
list: BorrowHistoryFlexibleV5[];
|
|
1536
|
+
nextPageCursor: string;
|
|
1537
|
+
}>>;
|
|
1538
|
+
/**
|
|
1539
|
+
* Get Repayment Orders History
|
|
1540
|
+
*
|
|
1541
|
+
*/
|
|
1542
|
+
getRepaymentHistoryFlexible(params?: GetRepaymentHistoryFlexibleParamsV5): Promise<APIResponseV3WithTime<{
|
|
1543
|
+
list: RepaymentHistoryFlexibleV5[];
|
|
1544
|
+
nextPageCursor: string;
|
|
1545
|
+
}>>;
|
|
1546
|
+
/**
|
|
1547
|
+
*
|
|
1548
|
+
****** Fixed Loan
|
|
1549
|
+
*
|
|
1550
|
+
*/
|
|
1551
|
+
/**
|
|
1552
|
+
* Get Supplying Market
|
|
1553
|
+
* If you want to supply, you can use this endpoint to check whether there are any suitable counterparty borrow orders available.
|
|
1554
|
+
*
|
|
1555
|
+
*/
|
|
1556
|
+
getSupplyOrderQuoteFixed(params: GetSupplyOrderQuoteFixedParamsV5): Promise<APIResponseV3WithTime<{
|
|
1557
|
+
list: SupplyOrderQuoteFixedV5[];
|
|
1558
|
+
}>>;
|
|
1559
|
+
/**
|
|
1560
|
+
* Get Borrowing Market
|
|
1561
|
+
* If you want to borrow, you can use this endpoint to check whether there are any suitable counterparty supply orders available.
|
|
1562
|
+
*
|
|
1563
|
+
*/
|
|
1564
|
+
getBorrowOrderQuoteFixed(params: GetBorrowOrderQuoteFixedParamsV5): Promise<APIResponseV3WithTime<{
|
|
1565
|
+
list: BorrowOrderQuoteFixedV5[];
|
|
1566
|
+
}>>;
|
|
1567
|
+
/**
|
|
1568
|
+
* Create Borrow Order
|
|
1569
|
+
* The loan funds are released to the Funding wallet.
|
|
1570
|
+
* The collateral funds are deducted from the Funding wallet, so make sure you have enough collateral amount in the Funding wallet.
|
|
1571
|
+
*/
|
|
1572
|
+
createBorrowOrderFixed(params: CreateBorrowOrderFixedParamsV5): Promise<APIResponseV3WithTime<CreateBorrowOrderFixedV5>>;
|
|
1573
|
+
/**
|
|
1574
|
+
* Create Supply Order
|
|
1575
|
+
*
|
|
1576
|
+
* Permission: "Spot trade"
|
|
1577
|
+
*/
|
|
1578
|
+
createSupplyOrderFixed(params: CreateSupplyOrderFixedParamsV5): Promise<APIResponseV3WithTime<CreateSupplyOrderFixedV5>>;
|
|
1579
|
+
/**
|
|
1580
|
+
* Cancel Borrow Order
|
|
1581
|
+
*
|
|
1582
|
+
*/
|
|
1583
|
+
cancelBorrowOrderFixed(params: CancelBorrowOrderFixedParamsV5): Promise<APIResponseV3WithTime<{}>>;
|
|
1584
|
+
/**
|
|
1585
|
+
* Cancel Supply Order
|
|
1586
|
+
*/
|
|
1587
|
+
cancelSupplyOrderFixed(params: CancelSupplyOrderFixedParamsV5): Promise<APIResponseV3WithTime<{}>>;
|
|
1588
|
+
/**
|
|
1589
|
+
* Get Borrow Contract Info
|
|
1590
|
+
*
|
|
1591
|
+
*/
|
|
1592
|
+
getBorrowContractInfoFixed(params?: GetBorrowContractInfoFixedParamsV5): Promise<APIResponseV3WithTime<{
|
|
1593
|
+
list: BorrowContractInfoFixedV5[];
|
|
1594
|
+
nextPageCursor: string;
|
|
1595
|
+
}>>;
|
|
1596
|
+
/**
|
|
1597
|
+
* Get Supply Contract Info
|
|
1598
|
+
*
|
|
1599
|
+
*/
|
|
1600
|
+
getSupplyContractInfoFixed(params?: GetSupplyContractInfoFixedParamsV5): Promise<APIResponseV3WithTime<{
|
|
1601
|
+
list: SupplyContractInfoFixedV5[];
|
|
1602
|
+
nextPageCursor: string;
|
|
1603
|
+
}>>;
|
|
1604
|
+
/**
|
|
1605
|
+
* Get Borrow Order Info
|
|
1606
|
+
*
|
|
1607
|
+
*/
|
|
1608
|
+
getBorrowOrderInfoFixed(params?: GetBorrowOrderInfoFixedParamsV5): Promise<APIResponseV3WithTime<{
|
|
1609
|
+
list: BorrowOrderInfoFixedV5[];
|
|
1610
|
+
nextPageCursor: string;
|
|
1611
|
+
}>>;
|
|
1612
|
+
/**
|
|
1613
|
+
* Get Supply Order Info
|
|
1614
|
+
*
|
|
1615
|
+
*/
|
|
1616
|
+
getSupplyOrderInfoFixed(params?: GetSupplyOrderInfoFixedParamsV5): Promise<APIResponseV3WithTime<{
|
|
1617
|
+
list: SupplyOrderInfoFixedV5[];
|
|
1618
|
+
nextPageCursor: string;
|
|
1619
|
+
}>>;
|
|
1620
|
+
/**
|
|
1621
|
+
* Repay Fixed Loan
|
|
1622
|
+
* Either loanId or loanCurrency needs to be passed
|
|
1623
|
+
*
|
|
1624
|
+
*/
|
|
1625
|
+
repayFixed(params: RepayFixedParamsV5): Promise<APIResponseV3WithTime<RepayFixedV5>>;
|
|
1626
|
+
/**
|
|
1627
|
+
* Get Repayment History
|
|
1628
|
+
*
|
|
1629
|
+
*/
|
|
1630
|
+
getRepaymentHistoryFixed(params?: GetRepaymentHistoryFixedParamsV5): Promise<APIResponseV3WithTime<{
|
|
1631
|
+
list: RepaymentHistoryFixedV5[];
|
|
1632
|
+
nextPageCursor: string;
|
|
1633
|
+
}>>;
|
|
1431
1634
|
/**
|
|
1432
1635
|
*
|
|
1433
1636
|
****** Institutional Lending
|