Skip to content

Commit 6876371

Browse files
Merge pull request #479 from crypto-chassis/develop
Release
2 parents 4e9e786 + 9dbd487 commit 6876371

9 files changed

+153
-68
lines changed

Diff for: .github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
{"type": "test", "release": "patch"},
3535
{"type": "minor", "release": "minor"},
3636
{"type": "major", "release": "major"},
37-
{"type": "dev", "release": "patch"}
37+
{"type": "misc", "release": "patch"}
3838
]
3939
}], ["@semantic-release/release-notes-generator", {
4040
"preset": "conventionalcommits"

Diff for: LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 cryptochassis
3+
Copyright (c) Crypto Chassis
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Diff for: README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Announcement: We have upgraded bybit API from v3 to v5 due to bybit will discontinue v3 on August 31, 2024. We've moved derivatives support from bybit-derivatives to bybit and updated documentions accordingly (See #specify-instrument-type section). We've also added websocket balance/position realtime update support on bybit. In addition, please use bybit's Unified Trading Account (https://www.bybit.com/en/help-center/article/Introduction-to-Bybit-Unified-Trading-Account) for best API support. Thank you.
1+
# Announcement: We have upgraded bybit API from v3 to v5 due to bybit will discontinue v3 on August 31, 2024. We've moved derivatives support from bybit-derivatives to bybit and updated documentations accordingly (See #specify-instrument-type section). We've also added websocket balance/position realtime update support on bybit. In addition, please use bybit's Unified Trading Account (https://www.bybit.com/en/help-center/article/Introduction-to-Bybit-Unified-Trading-Account) for best API support. Thank you.
22

33
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
44
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
@@ -64,8 +64,6 @@
6464
* FIX: coinbase, gemini.
6565
* A spot market making application is provided as an end-to-end solution for liquidity providers.
6666
* A single order execution application is provided as an end-to-end solution for executing large orders.
67-
* To spur innovation and industry collaboration, this library is open for use by the public without cost.
68-
* We specialize in market data collection, high speed trading system, infrastructure optimization, and proprietary market making. Hire us as engineers, liquidity providers, traders, or asset managers.
6967
* Join us on Discord https://discord.gg/b5EKcp9s8T and Medium https://cryptochassis.medium.com.
7068

7169
## Branches

Diff for: include/ccapi_cpp/ccapi_macro.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@
364364
#define CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_BOOKS1 "books1"
365365
#define CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_BOOKS5 "books5"
366366
#define CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_BOOKS15 "books15"
367-
#define CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_TRADES "trade"
367+
#define CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_KLINE "candle"
368368
#define CCAPI_WEBSOCKET_BITMART_CHANNEL_TRADE "spot/trade"
369369
#define CCAPI_WEBSOCKET_BITMART_CHANNEL_PUBLIC_DEPTH5 "spot/depth5"
370370
#define CCAPI_WEBSOCKET_BITMART_CHANNEL_PUBLIC_DEPTH20 "spot/depth20"

Diff for: include/ccapi_cpp/ccapi_session.h

+12
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,18 @@ class Session {
636636
return;
637637
}
638638
subscription.setInstrumentType(instrumentType);
639+
} else if (exchange == CCAPI_EXCHANGE_NAME_BITGET_FUTURES) {
640+
auto instrumentType = subscription.getInstrumentType();
641+
if (instrumentType.empty()) {
642+
instrumentType = "USDT-FUTURES";
643+
}
644+
std::vector<std::string> instrumentTypeList = {"USDT-FUTURES", "COIN-FUTURES", "USDC-FUTURES"};
645+
if (std::find(instrumentTypeList.begin(), instrumentTypeList.end(), instrumentType) == instrumentTypeList.end()) {
646+
this->onError(Event::Type::SUBSCRIPTION_STATUS, Message::Type::SUBSCRIPTION_FAILURE,
647+
"unsupported exchange instrument types: " + toString(instrumentType) + ". Allowed values: " + toString(instrumentTypeList) + ".");
648+
return;
649+
}
650+
subscription.setInstrumentType(instrumentType);
639651
}
640652
}
641653
std::map<std::string, std::vector<Subscription> > subscriptionListByServiceNameMap;

Diff for: include/ccapi_cpp/ccapi_session_configs.h

+2
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,12 @@ class SessionConfigs CCAPI_FINAL {
157157
std::map<std::string, std::string> fieldWebsocketChannelMapBitget = {
158158
{CCAPI_TRADE, CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_TRADES},
159159
{CCAPI_MARKET_DEPTH, CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_BOOKS},
160+
{CCAPI_CANDLESTICK, CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_KLINE},
160161
};
161162
std::map<std::string, std::string> fieldWebsocketChannelMapBitgetFutures = {
162163
{CCAPI_TRADE, CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_TRADES},
163164
{CCAPI_MARKET_DEPTH, CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_BOOKS},
165+
{CCAPI_CANDLESTICK, CCAPI_WEBSOCKET_BITGET_BASE_CHANNEL_KLINE},
164166
};
165167
std::map<std::string, std::string> fieldWebsocketChannelMapBitmart = {
166168
{CCAPI_TRADE, CCAPI_WEBSOCKET_BITMART_CHANNEL_TRADE},

Diff for: include/ccapi_cpp/service/ccapi_market_data_service_bitget.h

+7-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class MarketDataServiceBitget : public MarketDataServiceBitgetBase {
1010
ServiceContext* serviceContextPtr)
1111
: MarketDataServiceBitgetBase(eventHandler, sessionOptions, sessionConfigs, serviceContextPtr) {
1212
this->exchangeName = CCAPI_EXCHANGE_NAME_BITGET;
13-
this->baseUrlWs = sessionConfigs.getUrlWebsocketBase().at(this->exchangeName) + "/spot/v1/stream";
13+
this->baseUrlWs = sessionConfigs.getUrlWebsocketBase().at(this->exchangeName) + "/v2/ws/public";
1414
this->baseUrlRest = sessionConfigs.getUrlRestBase().at(this->exchangeName);
1515
this->setHostRestFromUrlRest(this->baseUrlRest);
1616
this->setHostWsFromUrlWs(this->baseUrlWs);
@@ -27,9 +27,12 @@ class MarketDataServiceBitget : public MarketDataServiceBitgetBase {
2727
// CCAPI_LOGGER_FATAL(std::string("e.what() = ") + e.what());
2828
// }
2929
// #endif
30-
this->getRecentTradesTarget = "/api/spot/v1/market/fills";
31-
this->getInstrumentTarget = "/api/spot/v1/public/product";
32-
this->getInstrumentsTarget = "/api/spot/v1/public/products";
30+
this->getRecentTradesTarget = "/api/v2/spot/market/fills";
31+
this->getHistoricalTradesTarget = "/api/v2/spot/market/fills-history";
32+
this->getInstrumentTarget = "/api/v2/spot/public/symbols";
33+
this->getInstrumentsTarget = "/api/v2/spot/public/symbols";
34+
this->getRecentCandlesticksTarget = "/api/v2/spot/market/candles";
35+
this->getHistoricalCandlesticksTarget = "/api/v2/spot/market/candles";
3336
}
3437
virtual ~MarketDataServiceBitget() {}
3538
};

0 commit comments

Comments
 (0)