Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,13 @@ console.log(version, Object.keys(exchanges));

All-in-one browser bundle (dependencies included), served from a CDN of your choice:

- jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.9.31/dist/ccxt.browser.min.js
- unpkg: https://unpkg.com/ccxt@4.9.31/dist/ccxt.browser.min.js
- jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@4.9.32/dist/ccxt.browser.min.js
- unpkg: https://unpkg.com/ccxt@4.9.32/dist/ccxt.browser.min.js

CDNs are not updated in real-time and may have delays. Defaulting to the most recent version without specifying the version number is not recommended. Please, keep in mind that we are not responsible for the correct operation of those CDN servers.

```HTML
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.9.31/dist/ccxt.browser.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@4.9.32/dist/ccxt.browser.min.js"></script>
console.log (ccxt.exchanges) // print all available exchanges
```

Expand Down
5 changes: 5 additions & 0 deletions cs/ccxt/api/bit24.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ public async Task<object> publicGetProCapiV1Markets (object parameters = null)
return await this.callAsync ("publicGetProCapiV1Markets",parameters);
}

public async Task<object> publicGetApiV1CoinsSimpleList (object parameters = null)
{
return await this.callAsync ("publicGetApiV1CoinsSimpleList",parameters);
}

}
2 changes: 1 addition & 1 deletion cs/ccxt/base/Exchange.MetaData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace ccxt;
// file updated automatically by vss and export-exchanges
public partial class Exchange
{
public static string ccxtVersion = "4.9.31";
public static string ccxtVersion = "4.9.32";


public static List<string> exchanges = new List<string> { "abantether", "afratether", "alpaca", "apex", "arzinja", "arzplus", "ascendex", "bequant", "bigone", "binance", "binancecoinm", "binanceus", "binanceusdm", "bingx", "bit24", "bit2c", "bitbank", "bitbarg", "bitbns", "bitfinex", "bitflyer", "bitget", "bithumb", "bitimen", "bitir", "bitmart", "bitmex", "bitopro", "bitpin", "bitrue", "bitso", "bitstamp", "bitteam", "bittrade", "bitunix", "bitvavo", "blockchaincom", "blofin", "btcalpha", "btcbox", "btcmarkets", "btcturk", "bybit", "bydfi", "cafearz", "cex", "coinbase", "coinbaseadvanced", "coinbaseexchange", "coinbaseinternational", "coincatch", "coincheck", "coinex", "coinmate", "coinmetro", "coinone", "coinsph", "coinspot", "cryptocom", "cryptomus", "defx", "delta", "deribit", "derive", "digifinex", "ellipx", "eterex", "excoino", "exir", "exmo", "exnovin", "farhadexchange", "fmfwio", "foxbit", "gate", "gateio", "gemini", "hamtapay", "hashkey", "hibachi", "hitbtc", "hitobit", "hollaex", "htx", "huobi", "hyperliquid", "independentreserve", "indodax", "iranexchange", "jibitex", "kcex", "kifpoolme", "kraken", "krakenfutures", "kucoin", "kucoinfutures", "latoken", "lbank", "luno", "mazdax", "mercado", "mexc", "modetrade", "myokx", "ndax", "nobitex", "novadax", "oceanex", "okcoin", "okexchange", "okx", "okxus", "ompfinex", "onetrading", "oxfun", "p2b", "paradex", "paymium", "phemex", "pingi", "poloniex", "pooleno", "probit", "raastin", "ramzinex", "sarmayex", "sarrafex", "tabdeal", "tehran_exchange", "tetherland", "timex", "tokocrypto", "toobit", "tradeogre", "twox", "ubitex", "upbit", "vertex", "wallex", "wavesexchange", "whitebit", "woo", "woofipro", "xt", "yobit", "zaif", "zonda" };
Expand Down
6 changes: 3 additions & 3 deletions cs/ccxt/ccxt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<PropertyGroup>
<PackageId>ccxt</PackageId>
<Authors>Carlos, Kroitor, Carlo</Authors>
<PackageVersion>4.9.31</PackageVersion>
<AssemblyVersion>4.9.31</AssemblyVersion>
<FileVersion>4.9.31</FileVersion>
<PackageVersion>4.9.32</PackageVersion>
<AssemblyVersion>4.9.32</AssemblyVersion>
<FileVersion>4.9.32</FileVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>Cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand Down
143 changes: 139 additions & 4 deletions dist/ccxt.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -46169,6 +46169,7 @@ class bit24 extends _abstract_bit24_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
'logo': 'https://cdn.arz.digital/cr-odin/img/exchanges/bit24/64x64.png',
'api': {
'public': 'https://rest.bit24.cash',
'otc': 'https://otc-api.bit24.cash',
},
'www': 'https://bit24.cash/',
'doc': [
Expand All @@ -46179,6 +46180,7 @@ class bit24 extends _abstract_bit24_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
'public': {
'get': {
'pro/capi/v1/markets': 1,
'api/v1/coins/simple-list': 1,
},
},
},
Expand All @@ -46195,6 +46197,14 @@ class bit24 extends _abstract_bit24_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
* @returns {object[]} an array of objects representing market data
*/
const result = [];
const OTCresponse = await this.publicGetApiV1CoinsSimpleList();
const OTCmarkets = this.safeDict(OTCresponse, 'data');
const OTCmarketList = this.safeList(OTCmarkets, 'results', []);
for (let i = 0; i < OTCmarketList.length; i++) {
const marketdata = OTCmarketList[i];
const market = this.parseOtcMarket(marketdata);
result.push(market);
}
let page = 1;
const limit = 100; // check Bit24 docs for max allowed per page
while (true) {
Expand All @@ -46215,7 +46225,7 @@ class bit24 extends _abstract_bit24_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
}
page += 1;
}
return result;
return this.removeDuplicateValues(result);
}
parseMarket(market) {
// {
Expand Down Expand Up @@ -46320,6 +46330,68 @@ class bit24 extends _abstract_bit24_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
'info': market,
};
}
parseOtcMarket(market) {
// {
// symbol: "0G",
// name: "0G"
// },
let baseId = this.safeString(market, 'symbol');
let quoteId = 'IRT'; // assuming quote currency is always IRT for OTC markets
const base = this.safeCurrencyCode(baseId);
const quote = this.safeCurrencyCode(quoteId);
baseId = baseId.toLowerCase();
quoteId = quoteId.toLowerCase();
const id = baseId + '-' + quoteId;
return {
'id': id,
'symbol': base + '/' + quote,
'base': base,
'quote': quote,
'settle': undefined,
'baseId': baseId,
'quoteId': quoteId,
'settleId': undefined,
'type': 'otc',
'spot': false,
'margin': false,
'swap': false,
'future': false,
'option': false,
'active': true,
'contract': false,
'linear': undefined,
'inverse': undefined,
'contractSize': undefined,
'expiry': undefined,
'expiryDatetime': undefined,
'strike': undefined,
'optionType': undefined,
'precision': {
'amount': undefined,
'price': undefined,
},
'limits': {
'leverage': {
'min': undefined,
'max': undefined,
},
'amount': {
'min': undefined,
'max': undefined,
},
'price': {
'min': undefined,
'max': undefined,
},
'cost': {
'min': undefined,
'max': undefined,
},
},
'created': undefined,
'info': market,
};
}
async fetchTickers(symbols = undefined, params = {}) {
/**
* @method
Expand All @@ -46334,9 +46406,18 @@ class bit24 extends _abstract_bit24_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
if (symbols !== undefined) {
symbols = this.marketSymbols(symbols);
}
const result = {};
const Otcresponse = await this.publicGetApiV1CoinsSimpleList(params);
const Otcdata = this.safeDict(Otcresponse, 'data', {});
const OtctickerList = this.safeList(Otcdata, 'results', []);
for (let i = 0; i < OtctickerList.length; i++) {
const tickerData = OtctickerList[i];
const ticker = this.parseOtcTicker(tickerData);
const symbol = ticker['symbol'];
result[symbol] = ticker;
}
let page = 1;
const limit = 100; // adjust if Bit24 docs show a different default
const result = {};
while (true) {
const response = await this.publicGetProCapiV1Markets(this.extend(params, {
'page': page,
Expand Down Expand Up @@ -46452,11 +46533,65 @@ class bit24 extends _abstract_bit24_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
'info': ticker,
}, market);
}
parseOtcTicker(ticker, market = undefined) {
// {
// symbol: "0G",
// name: "0G"
// },
const marketType = 'otc';
let base_symbol = this.safeString(ticker, 'symbol');
base_symbol = base_symbol.toLowerCase();
const quote_symbol = 'irt'; // assuming quote currency is always IRT for OTC markets
const marketId = base_symbol + '-' + quote_symbol;
const symbol = this.safeSymbol(marketId, market, undefined, marketType);
return this.safeTicker({
'symbol': symbol,
'timestamp': undefined,
'datetime': undefined,
'high': undefined,
'low': undefined,
'bid': undefined,
'bidVolume': undefined,
'ask': undefined,
'askVolume': undefined,
'vwap': undefined,
'open': undefined,
'close': undefined,
'last': undefined,
'previousClose': undefined,
'change': undefined,
'percentage': undefined,
'average': undefined,
'baseVolume': undefined,
'quoteVolume': undefined,
'info': ticker,
}, market);
}
async removeDuplicateValues(markets) {
const uniqueMarkets = [];
const seenIds = new Set();
for (let i = 0; i < markets.length; i++) {
const market = markets[i];
if (!seenIds.has(market['id'])) {
seenIds.add(market['id']);
uniqueMarkets.push(market);
}
}
return uniqueMarkets;
}
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
if (path === 'api/v1/coins/simple-list') {
api = 'otc';
}
const query = this.omit(params, this.extractParams(path));
let url = this.urls['api'][api] + '/' + this.implodeParams(path, params);
url = url + '?' + this.urlencode(query);
headers = { 'Content-Type': 'application/json', 'X-BIT24-APIKEY': 'bdfa2c8c971445d5a4a95c95a5a2a4c2' };
if (api === 'otc') {
headers = { 'Content-Type': 'application/json' };
}
else {
headers = { 'Content-Type': 'application/json', 'X-BIT24-APIKEY': 'bdfa2c8c971445d5a4a95c95a5a2a4c2' };
}
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
}
}
Expand Down Expand Up @@ -431437,7 +431572,7 @@ SOFTWARE.

//-----------------------------------------------------------------------------
// this is updated by vss.js when building
const ccxt_version = '4.9.31';
const ccxt_version = '4.9.32';
ccxt_src_base_Exchange_js_WEBPACK_IMPORTED_MODULE_0_/* .Exchange */ .k.ccxtVersion = ccxt_version;
//-----------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions dist/ccxt.browser.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/ccxt.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ var xt$1 = require('./src/pro/xt.js');

//-----------------------------------------------------------------------------
// this is updated by vss.js when building
const version = '4.9.31';
const version = '4.9.32';
Exchange["default"].ccxtVersion = version;
const exchanges = {
'abantether': abantether["default"],
Expand Down
Loading
Loading