readme cleaning
This commit is contained in:
26
README.md
26
README.md
@@ -57,8 +57,8 @@ Each REST API group has a dedicated REST client. To avoid confusion, here are th
|
|||||||
| [LinearClient](src/linear-client.ts) | [USDT Perpetual Futures (v2) APIs](https://bybit-exchange.github.io/docs/futuresV2/linear/#t-introduction) |
|
| [LinearClient](src/linear-client.ts) | [USDT Perpetual Futures (v2) APIs](https://bybit-exchange.github.io/docs/futuresV2/linear/#t-introduction) |
|
||||||
| [InverseFuturesClient](src/inverse-futures-client.ts) | [Inverse Futures (v2) APIs](https://bybit-exchange.github.io/docs/futuresV2/inverse_futures/#t-introduction) |
|
| [InverseFuturesClient](src/inverse-futures-client.ts) | [Inverse Futures (v2) APIs](https://bybit-exchange.github.io/docs/futuresV2/inverse_futures/#t-introduction) |
|
||||||
| [USDCPerpetualClient](src/usdc-perpetual-client.ts) | [USDC Perpetual APIs](https://bybit-exchange.github.io/docs/usdc/option/?console#t-querydeliverylog) |
|
| [USDCPerpetualClient](src/usdc-perpetual-client.ts) | [USDC Perpetual APIs](https://bybit-exchange.github.io/docs/usdc/option/?console#t-querydeliverylog) |
|
||||||
| [UnifiedMarginClient](src/unified-margin-client.ts) | [Derivatives (v3) unified margin APIs](https://bybit-exchange.github.io/docs/derivativesV3/unified_margin/#t-introduction) |
|
|
||||||
| [USDCOptionClient](src/usdc-option-client.ts) | [USDC Option APIs](https://bybit-exchange.github.io/docs/usdc/option/#t-introduction) |
|
| [USDCOptionClient](src/usdc-option-client.ts) | [USDC Option APIs](https://bybit-exchange.github.io/docs/usdc/option/#t-introduction) |
|
||||||
|
| [UnifiedMarginClient](src/unified-margin-client.ts) | [Derivatives (v3) unified margin APIs](https://bybit-exchange.github.io/docs/derivativesV3/unified_margin/#t-introduction) |
|
||||||
| [SpotClientV3](src/spot-client-v3.ts) | [Spot Market (v3) APIs](https://bybit-exchange.github.io/docs/spot/v3/#t-introduction) |
|
| [SpotClientV3](src/spot-client-v3.ts) | [Spot Market (v3) APIs](https://bybit-exchange.github.io/docs/spot/v3/#t-introduction) |
|
||||||
| [~SpotClient~](src/spot-client.ts) (deprecated, v3 client recommended)| [Spot Market (v1) APIs](https://bybit-exchange.github.io/docs/spot/v1/#t-introduction) |
|
| [~SpotClient~](src/spot-client.ts) (deprecated, v3 client recommended)| [Spot Market (v1) APIs](https://bybit-exchange.github.io/docs/spot/v1/#t-introduction) |
|
||||||
| [AccountAssetClient](src/account-asset-client.ts) | [Account Asset APIs](https://bybit-exchange.github.io/docs/account_asset/#t-introduction) |
|
| [AccountAssetClient](src/account-asset-client.ts) | [Account Asset APIs](https://bybit-exchange.github.io/docs/account_asset/#t-introduction) |
|
||||||
@@ -86,25 +86,23 @@ const {
|
|||||||
LinearClient,
|
LinearClient,
|
||||||
InverseFuturesClient,
|
InverseFuturesClient,
|
||||||
SpotClient,
|
SpotClient,
|
||||||
SpotClient3,
|
SpotClientV3,
|
||||||
|
UnifiedMarginClient,
|
||||||
USDCOptionClient,
|
USDCOptionClient,
|
||||||
USDCPerpetualClient,
|
USDCPerpetualClient,
|
||||||
CopyTradingClient,
|
|
||||||
AccountAssetClient,
|
AccountAssetClient,
|
||||||
|
CopyTradingClient,
|
||||||
} = require('bybit-api');
|
} = require('bybit-api');
|
||||||
|
|
||||||
const restClientOptions = {
|
const restClientOptions = {
|
||||||
// override the max size of the request window (in ms)
|
// override the max size of the request window (in ms)
|
||||||
recv_window?: number;
|
recv_window?: number;
|
||||||
|
|
||||||
// how often to sync time drift with bybit servers
|
// Disabled by default, not recommended unless you know what you're doing
|
||||||
sync_interval_ms?: number;
|
|
||||||
|
|
||||||
// Default: false. Disable above sync mechanism if true.
|
|
||||||
enable_time_sync?: boolean;
|
enable_time_sync?: boolean;
|
||||||
|
|
||||||
// Default: false. If true, we'll throw errors if any params are undefined
|
// how often to sync time drift with bybit servers
|
||||||
strict_param_validation?: boolean;
|
sync_interval_ms?: number;
|
||||||
|
|
||||||
// Optionally override API protocol + domain
|
// Optionally override API protocol + domain
|
||||||
// e.g 'https://api.bytick.com'
|
// e.g 'https://api.bytick.com'
|
||||||
@@ -119,16 +117,20 @@ const PRIVATE_KEY = 'yyy';
|
|||||||
const useLivenet = false;
|
const useLivenet = false;
|
||||||
|
|
||||||
const client = new InverseClient(
|
const client = new InverseClient(
|
||||||
|
// Optional, unless you plan on making private API calls
|
||||||
API_KEY,
|
API_KEY,
|
||||||
PRIVATE_KEY,
|
PRIVATE_KEY,
|
||||||
|
|
||||||
// optional, uses testnet by default. Set to 'true' to use livenet.
|
// Optional, uses testnet by default. Set to 'true' to use livenet.
|
||||||
useLivenet,
|
useLivenet,
|
||||||
|
|
||||||
// restClientOptions,
|
// restClientOptions,
|
||||||
// requestLibraryOptions
|
// requestLibraryOptions
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// For public-only API calls, simply set key and secret to "undefined":
|
||||||
|
// const client = new InverseClient(undefined, undefined, useLivenet);
|
||||||
|
|
||||||
client.getApiKeyInfo()
|
client.getApiKeyInfo()
|
||||||
.then(result => {
|
.then(result => {
|
||||||
console.log("getApiKeyInfo result: ", result);
|
console.log("getApiKeyInfo result: ", result);
|
||||||
@@ -152,8 +154,8 @@ All API groups can be used via a shared `WebsocketClient`. However, to listen to
|
|||||||
The WebsocketClient can be configured to a specific API group using the market parameter. These are the currently available API groups:
|
The WebsocketClient can be configured to a specific API group using the market parameter. These are the currently available API groups:
|
||||||
| API Category | Market | Description |
|
| API Category | Market | Description |
|
||||||
|:----------------------------: |:-------------------: |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|:----------------------------: |:-------------------: |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||||
| Unified Margin - Options | `market: 'unifiedOption'`| The [derivatives v3](https://bybit-exchange.github.io/docs/derivativesV3/unified_margin/#t-websocket) category for unified margin. Note: public topics only support options topics. If you need USDC/USDT perps, use `unifiedPerp` instead. |
|
| Unified Margin - Options | `market: 'unifiedOption'`| The [derivatives v3](https://bybit-exchange.github.io/docs/derivativesV3/unified_margin/#t-websocket) category for unified margin. \nNote: public topics only support options topics. If you need USDC/USDT perps, use `unifiedPerp` instead. |
|
||||||
| Unified Margin - Perps | `market: 'unifiedPerp'` | The [derivatives v3](https://bybit-exchange.github.io/docs/derivativesV3/unified_margin/#t-websocket) category for unified margin. Note: public topics only USDT/USDC perps topics - use `unifiedOption` if you need public options topics. |
|
| Unified Margin - Perps | `market: 'unifiedPerp'` | The [derivatives v3](https://bybit-exchange.github.io/docs/derivativesV3/unified_margin/#t-websocket) category for unified margin. \nNote: public topics only USDT/USDC perps topics - use `unifiedOption` if you need public options topics. |
|
||||||
| Futures v2 - Inverse Perps | `market: 'inverse'` | The [inverse v2 perps](https://bybit-exchange.github.io/docs/futuresV2/inverse/#t-websocket) category. |
|
| Futures v2 - Inverse Perps | `market: 'inverse'` | The [inverse v2 perps](https://bybit-exchange.github.io/docs/futuresV2/inverse/#t-websocket) category. |
|
||||||
| Futures v2 - USDT Perps | `market: 'linear'` | The [USDT/linear v2 perps](https://bybit-exchange.github.io/docs/futuresV2/linear/#t-websocket) category. |
|
| Futures v2 - USDT Perps | `market: 'linear'` | The [USDT/linear v2 perps](https://bybit-exchange.github.io/docs/futuresV2/linear/#t-websocket) category. |
|
||||||
| Futures v2 - Inverse Futures | `market: 'inverse'` | The [inverse futures v2](https://bybit-exchange.github.io/docs/futuresV2/inverse_futures/#t-websocket) category uses the same market as inverse perps. |
|
| Futures v2 - Inverse Futures | `market: 'inverse'` | The [inverse futures v2](https://bybit-exchange.github.io/docs/futuresV2/inverse_futures/#t-websocket) category uses the same market as inverse perps. |
|
||||||
|
|||||||
Reference in New Issue
Block a user