Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ccxt/ccxt
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Feb 25, 2024
2 parents 3baad50 + be9935e commit b290f07
Show file tree
Hide file tree
Showing 140 changed files with 2,781 additions and 244 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,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/[email protected].49/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].49/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].51/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].51/dist/ccxt.browser.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/[email protected].49/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].51/dist/ccxt.browser.js"></script>
```

Creates a global `ccxt` object:
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ diff=$(echo "$diff" | sed -e "s/^ts\/src\/test\/static.*json//") #remove static
# diff=$(echo "$diff" | sed -e "s/^\.travis\.yml//")
# diff=$(echo "$diff" | sed -e "s/^package\-lock\.json//")
# diff=$(echo "$diff" | sed -e "s/python\/qa\.py//")
#echo $diff
#echo $diff

critical_pattern='Client(Trait)?\.php|Exchange\.php|\/base|^build|static_dependencies|^run-tests|package(-lock)?\.json|composer\.json|ccxt\.ts|__init__.py|test' # add \/test|
if [[ "$diff" =~ $critical_pattern ]]; then
Expand Down
15 changes: 14 additions & 1 deletion build/csharpTranspiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ class NewTranspiler {
// WS fixes
baseClass = baseClass.replace(/\(object client,/gm, '(WebSocketClient client,');
baseClass = baseClass.replace(/Dictionary<string,object>\)client\.futures/gm, 'Dictionary<string, ccxt.Exchange.Future>)client.futures');

baseClass = baseClass.replaceAll (/(\b\w*)RestInstance.describe/g, "(\(Exchange\)$1RestInstance).describe");

const jsDelimiter = '// ' + delimiter
const parts = baseClass.split (jsDelimiter)
Expand Down Expand Up @@ -942,6 +942,7 @@ class NewTranspiler {
if (ws) {
const wsRegexes = this.getWsRegexes();
content = this.regexAll (content, wsRegexes);
content = this.replaceImportedRestClasses (content, csharpVersion.imports);
const classNameRegex = /public\spartial\sclass\s(\w+)\s:\s(\w+)/gm;
const classNameExec = classNameRegex.exec(content);
const className = classNameExec ? classNameExec[1] : '';
Expand All @@ -952,6 +953,18 @@ class NewTranspiler {
return csharpImports + content;
}

replaceImportedRestClasses (content, imports) {
for (const imp of imports) {
// { name: "hitbtc", path: "./hitbtc.js", isDefault: true, }
// { name: "bequantRest", path: "../bequant.js", isDefault: true, }
const name = imp.name;
if (name.endsWith('Rest')) {
content = content.replaceAll(name, 'ccxt.' + name.replace('Rest', ''));
}
}
return content;
}

transpileDerivedExchangeFile (tsFolder, filename, options, csharpResult, force = false, ws = false) {

const tsPath = tsFolder + filename
Expand Down
1 change: 1 addition & 0 deletions build/transpile.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ class Transpiler {
[ /\.checkConflictingProxies\s/g, '.check_conflicting_proxies'],
[ /\.parseMarket\s/g, '.parse_market'],
[ /\.isRoundNumber\s/g, '.is_round_number'],
[ /\.getDescribeForExtendedWsExchange\s/g, '.get_describe_for_extended_ws_exchange'],
[ /\.watchMultiple\s/g, '.watch_multiple'],
[ /\ssha(1|256|384|512)([,)])/g, ' \'sha$1\'$2'], // from js imports to this
[ /\s(md5|secp256k1|ed25519|keccak)([,)])/g, ' \'$1\'$2'], // from js imports to this
Expand Down
2 changes: 2 additions & 0 deletions build/transpileWS.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,8 @@ class CCXTProTranspiler extends Transpiler {
const exchangeName = match[1];
const exchangeNameRest = exchangeName + 'Rest';
result.python3 = result.python3.replace ('\nclass ', 'import ccxt.async_support.' + exchangeName + ' as ' + exchangeNameRest + '\n\n\nclass ');
// correct `new Xyz()` format
result.python3 = result.python3.replace ('new ' + exchangeNameRest, exchangeNameRest);
result.phpAsync = result.phpAsync.replace ('new '+ exchangeNameRest, 'new \\ccxt\\async\\' + exchangeName);
}
}
Expand Down
25 changes: 25 additions & 0 deletions cs/ccxt/api/binance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,21 @@ public async Task<object> sapiGetSimpleEarnFlexibleHistoryCollateralRecord (obje
return await this.callAsync ("sapiGetSimpleEarnFlexibleHistoryCollateralRecord",parameters);
}

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

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

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

public async Task<object> sapiPostAssetDust (object parameters = null)
{
return await this.callAsync ("sapiPostAssetDust",parameters);
Expand Down Expand Up @@ -1791,6 +1806,16 @@ public async Task<object> sapiPostSimpleEarnLockedSetAutoSubscribe (object param
return await this.callAsync ("sapiPostSimpleEarnLockedSetAutoSubscribe",parameters);
}

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

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

public async Task<object> sapiPutUserDataStream (object parameters = null)
{
return await this.callAsync ("sapiPutUserDataStream",parameters);
Expand Down
25 changes: 25 additions & 0 deletions cs/ccxt/api/binancecoinm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,21 @@ public async Task<object> sapiGetSimpleEarnFlexibleHistoryCollateralRecord (obje
return await this.callAsync ("sapiGetSimpleEarnFlexibleHistoryCollateralRecord",parameters);
}

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

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

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

public async Task<object> sapiPostAssetDust (object parameters = null)
{
return await this.callAsync ("sapiPostAssetDust",parameters);
Expand Down Expand Up @@ -1791,6 +1806,16 @@ public async Task<object> sapiPostSimpleEarnLockedSetAutoSubscribe (object param
return await this.callAsync ("sapiPostSimpleEarnLockedSetAutoSubscribe",parameters);
}

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

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

public async Task<object> sapiPutUserDataStream (object parameters = null)
{
return await this.callAsync ("sapiPutUserDataStream",parameters);
Expand Down
25 changes: 25 additions & 0 deletions cs/ccxt/api/binanceus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,21 @@ public async Task<object> sapiGetSimpleEarnFlexibleHistoryCollateralRecord (obje
return await this.callAsync ("sapiGetSimpleEarnFlexibleHistoryCollateralRecord",parameters);
}

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

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

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

public async Task<object> sapiGetAssetAssetDistributionHistory (object parameters = null)
{
return await this.callAsync ("sapiGetAssetAssetDistributionHistory",parameters);
Expand Down Expand Up @@ -1946,6 +1961,16 @@ public async Task<object> sapiPostSimpleEarnLockedSetAutoSubscribe (object param
return await this.callAsync ("sapiPostSimpleEarnLockedSetAutoSubscribe",parameters);
}

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

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

public async Task<object> sapiPostOtcQuotes (object parameters = null)
{
return await this.callAsync ("sapiPostOtcQuotes",parameters);
Expand Down
25 changes: 25 additions & 0 deletions cs/ccxt/api/binanceusdm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,21 @@ public async Task<object> sapiGetSimpleEarnFlexibleHistoryCollateralRecord (obje
return await this.callAsync ("sapiGetSimpleEarnFlexibleHistoryCollateralRecord",parameters);
}

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

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

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

public async Task<object> sapiPostAssetDust (object parameters = null)
{
return await this.callAsync ("sapiPostAssetDust",parameters);
Expand Down Expand Up @@ -1791,6 +1806,16 @@ public async Task<object> sapiPostSimpleEarnLockedSetAutoSubscribe (object param
return await this.callAsync ("sapiPostSimpleEarnLockedSetAutoSubscribe",parameters);
}

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

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

public async Task<object> sapiPutUserDataStream (object parameters = null)
{
return await this.callAsync ("sapiPutUserDataStream",parameters);
Expand Down
7 changes: 7 additions & 0 deletions cs/ccxt/base/Exchange.BaseMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,13 @@ public virtual object setMarkets(object markets, object currencies = null)
return this.markets;
}

public virtual object getDescribeForExtendedWsExchange(object currentRestInstance, object parentRestInstance, object wsBaseDescribe)
{
object extendedRestDescribe = this.deepExtend(((Exchange)parentRestInstance).describe(), ((Exchange)currentRestInstance).describe());
object superWithRestDescribe = this.deepExtend(extendedRestDescribe, wsBaseDescribe);
return superWithRestDescribe;
}

public virtual object safeBalance(object balance)
{
object balances = this.omit(balance, new List<object>() {"info", "timestamp", "datetime", "free", "used", "total"});
Expand Down
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.2.49";
public static string ccxtVersion = "4.2.51";

public static List<string> exchanges = new List<string> { "ace", "alpaca", "ascendex", "bequant", "bigone", "binance", "binancecoinm", "binanceus", "binanceusdm", "bingx", "bit2c", "bitbank", "bitbay", "bitbns", "bitcoincom", "bitfinex", "bitfinex2", "bitflyer", "bitforex", "bitget", "bithumb", "bitmart", "bitmex", "bitopro", "bitpanda", "bitrue", "bitso", "bitstamp", "bitteam", "bitvavo", "bl3p", "blockchaincom", "blofin", "btcalpha", "btcbox", "btcmarkets", "btcturk", "bybit", "cex", "coinbase", "coinbasepro", "coincheck", "coinex", "coinlist", "coinmate", "coinmetro", "coinone", "coinsph", "coinspot", "cryptocom", "currencycom", "delta", "deribit", "digifinex", "exmo", "fmfwio", "gate", "gateio", "gemini", "hitbtc", "hitbtc3", "hollaex", "htx", "huobi", "huobijp", "idex", "independentreserve", "indodax", "kraken", "krakenfutures", "kucoin", "kucoinfutures", "kuna", "latoken", "lbank", "luno", "lykke", "mercado", "mexc", "ndax", "novadax", "oceanex", "okcoin", "okx", "onetrading", "p2b", "paymium", "phemex", "poloniex", "poloniexfutures", "probit", "timex", "tokocrypto", "upbit", "wavesexchange", "wazirx", "whitebit", "woo", "yobit", "zaif", "zonda" };
}
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.2.49</PackageVersion>
<AssemblyVersion>4.2.49</AssemblyVersion>
<FileVersion>4.2.49</FileVersion>
<PackageVersion>4.2.51</PackageVersion>
<AssemblyVersion>4.2.51</AssemblyVersion>
<FileVersion>4.2.51</FileVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>Cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand Down
8 changes: 7 additions & 1 deletion cs/ccxt/exchanges/binance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public override object describe()
{ "createMarketSellOrderWithCost", true },
{ "createOrder", true },
{ "createOrders", true },
{ "createOrderWithTakeProfitAndStopLoss", true },
{ "createPostOnlyOrder", true },
{ "createReduceOnlyOrder", true },
{ "createStopLimitOrder", true },
Expand Down Expand Up @@ -108,7 +109,7 @@ public override object describe()
{ "fetchTradingFee", true },
{ "fetchTradingFees", true },
{ "fetchTradingLimits", null },
{ "fetchTransactionFee", null },
{ "fetchTransactionFee", "emulated" },
{ "fetchTransactionFees", true },
{ "fetchTransactions", false },
{ "fetchTransfers", true },
Expand Down Expand Up @@ -445,6 +446,9 @@ public override object describe()
{ "simple-earn/flexible/history/rewardsRecord", 15 },
{ "simple-earn/locked/history/rewardsRecord", 15 },
{ "simple-earn/flexible/history/collateralRecord", 0.1 },
{ "dci/product/list", 0.1 },
{ "dci/product/positions", 0.1 },
{ "dci/product/accounts", 0.1 },
} },
{ "post", new Dictionary<string, object>() {
{ "asset/dust", 0.06667 },
Expand Down Expand Up @@ -561,6 +565,8 @@ public override object describe()
{ "simple-earn/locked/redeem", 0.1 },
{ "simple-earn/flexible/setAutoSubscribe", 15 },
{ "simple-earn/locked/setAutoSubscribe", 15 },
{ "dci/product/subscribe", 0.1 },
{ "dci/product/auto_compound/edit", 0.1 },
} },
{ "put", new Dictionary<string, object>() {
{ "userDataStream", 0.1 },
Expand Down
52 changes: 52 additions & 0 deletions cs/ccxt/exchanges/bl3p.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public override object describe()
{ "cancelOrder", true },
{ "closeAllPositions", false },
{ "closePosition", false },
{ "createDepositAddress", true },
{ "createOrder", true },
{ "createReduceOnlyOrder", false },
{ "createStopLimitOrder", false },
Expand All @@ -36,6 +37,9 @@ public override object describe()
{ "fetchBorrowRateHistory", false },
{ "fetchCrossBorrowRate", false },
{ "fetchCrossBorrowRates", false },
{ "fetchDepositAddress", false },
{ "fetchDepositAddresses", false },
{ "fetchDepositAddressesByNetwork", false },
{ "fetchFundingHistory", false },
{ "fetchFundingRate", false },
{ "fetchFundingRateHistory", false },
Expand Down Expand Up @@ -442,6 +446,54 @@ public async override Task<object> cancelOrder(object id, object symbol = null,
return await this.privatePostMarketMoneyOrderCancel(this.extend(request, parameters));
}

public async override Task<object> createDepositAddress(object code, object parameters = null)
{
/**
* @method
* @name bl3p#createDepositAddress
* @description create a currency deposit address
* @see https://github.com/BitonicNL/bl3p-api/blob/master/docs/authenticated_api/http.md#32---create-a-new-deposit-address
* @param {string} code unified currency code of the currency for the deposit address
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
*/
parameters ??= new Dictionary<string, object>();
await this.loadMarkets();
object currency = this.currency(code);
object request = new Dictionary<string, object>() {
{ "currency", getValue(currency, "id") },
};
object response = await this.privatePostGENMKTMoneyNewDepositAddress(this.extend(request, parameters));
//
// {
// "result": "success",
// "data": {
// "address": "36Udu9zi1uYicpXcJpoKfv3bewZeok5tpk"
// }
// }
//
object data = this.safeDict(response, "data");
return this.parseDepositAddress(data, currency);
}

public override object parseDepositAddress(object depositAddress, object currency = null)
{
//
// {
// "address": "36Udu9zi1uYicpXcJpoKfv3bewZeok5tpk"
// }
//
object address = this.safeString(depositAddress, "address");
this.checkAddress(address);
return new Dictionary<string, object>() {
{ "info", depositAddress },
{ "currency", this.safeString(currency, "code") },
{ "address", address },
{ "tag", null },
{ "network", null },
};
}

public override object sign(object path, object api = null, object method = null, object parameters = null, object headers = null, object body = null)
{
api ??= "public";
Expand Down
3 changes: 2 additions & 1 deletion cs/ccxt/exchanges/mexc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,7 @@ public override object describe()
{ "700006", typeof(BadRequest) },
{ "700007", typeof(AuthenticationError) },
{ "700008", typeof(BadRequest) },
{ "700013", typeof(AuthenticationError) },
{ "730001", typeof(BadRequest) },
{ "730002", typeof(BadRequest) },
{ "730000", typeof(ExchangeError) },
Expand Down Expand Up @@ -5476,7 +5477,7 @@ public override object sign(object path, object api = null, object method = null
{ "source", this.safeString(this.options, "broker", "CCXT") },
};
}
if (isTrue(isEqual(method, "POST")))
if (isTrue(isTrue((isEqual(method, "POST"))) || isTrue((isEqual(method, "PUT")))))
{
((IDictionary<string,object>)headers)["Content-Type"] = "application/json";
}
Expand Down
Loading

0 comments on commit b290f07

Please sign in to comment.