Skip to content

Commit

Permalink
4.2.35
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Feb 4, 2024
1 parent 75c0ab9 commit 4ed68ef
Show file tree
Hide file tree
Showing 68 changed files with 968 additions and 237 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,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].34/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].34/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].35/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].35/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].34/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].35/dist/ccxt.browser.js"></script>
```

Creates a global `ccxt` object:
Expand Down
14 changes: 12 additions & 2 deletions cs/ccxt/base/Exchange.BaseMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public virtual object safeDictN(object dictionaryOrList, object keys, object def
* @returns {object | undefined}
*/
object value = this.safeValueN(dictionaryOrList, keys, defaultValue);
if (isTrue(isEqual(value, null)))
{
return defaultValue;
}
if (isTrue((value is IDictionary<string, object>)))
{
return value;
Expand Down Expand Up @@ -91,6 +95,10 @@ public virtual object safeListN(object dictionaryOrList, object keys, object def
* @returns {Array | undefined}
*/
object value = this.safeValueN(dictionaryOrList, keys, defaultValue);
if (isTrue(isEqual(value, null)))
{
return defaultValue;
}
if (isTrue(((value is IList<object>) || (value.GetType().IsGenericType && value.GetType().GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>))))))
{
return value;
Expand Down Expand Up @@ -5193,7 +5201,8 @@ public async virtual Task<object> fetchPaginatedCallCursor(object method, object
object responseLength = getArrayLength(response);
if (isTrue(this.verbose))
{
object cursorMessage = add(add(add(add(add(add(add(add("Cursor pagination call ", i), 1), " method "), method), " response length "), responseLength), " cursor "), cursorValue);
object iteration = ((object)(add(i, 1))).ToString();
object cursorMessage = add(add(add(add(add(add(add("Cursor pagination call ", iteration), " method "), method), " response length "), ((object)responseLength).ToString()), " cursor "), cursorValue);
this.log(cursorMessage);
}
if (isTrue(isEqual(responseLength, 0)))
Expand Down Expand Up @@ -5254,7 +5263,8 @@ public async virtual Task<object> fetchPaginatedCallIncremental(object method, o
object responseLength = getArrayLength(response);
if (isTrue(this.verbose))
{
object incrementalMessage = add(add(add(add(add(add("Incremental pagination call ", i), 1), " method "), method), " response length "), responseLength);
object iteration = ((object)(add(i, 1))).ToString();
object incrementalMessage = add(add(add(add(add("Incremental pagination call ", iteration), " method "), method), " response length "), ((object)responseLength).ToString());
this.log(incrementalMessage);
}
if (isTrue(isEqual(responseLength, 0)))
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.34";
public static string ccxtVersion = "4.2.35";

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", "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.34</PackageVersion>
<AssemblyVersion>4.2.34</AssemblyVersion>
<FileVersion>4.2.34</FileVersion>
<PackageVersion>4.2.35</PackageVersion>
<AssemblyVersion>4.2.35</AssemblyVersion>
<FileVersion>4.2.35</FileVersion>
<PackageReadmeFile>README.md</PackageReadmeFile>
<Description>Cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges</Description>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
Expand Down
68 changes: 57 additions & 11 deletions cs/ccxt/exchanges/binance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3201,10 +3201,26 @@ public virtual object parseBalanceCustom(object response, object type = null, ob
object timestamp = null;
object isolated = isEqual(marginMode, "isolated");
object cross = isTrue((isEqual(type, "margin"))) || isTrue((isEqual(marginMode, "cross")));
if (isTrue(!isTrue(isolated) && isTrue((isTrue((isEqual(type, "spot"))) || isTrue(cross)))))
if (isTrue(isEqual(type, "papi")))
{
for (object i = 0; isLessThan(i, getArrayLength(response)); postFixIncrement(ref i))
{
object entry = getValue(response, i);
object account = this.account();
object currencyId = this.safeString(entry, "asset");
object code = this.safeCurrencyCode(currencyId);
object borrowed = this.safeString(entry, "crossMarginBorrowed");
object interest = this.safeString(entry, "crossMarginInterest");
((IDictionary<string,object>)account)["free"] = this.safeString(entry, "crossMarginFree");
((IDictionary<string,object>)account)["used"] = this.safeString(entry, "crossMarginLocked");
((IDictionary<string,object>)account)["total"] = this.safeString(entry, "crossMarginAsset");
((IDictionary<string,object>)account)["debt"] = Precise.stringAdd(borrowed, interest);
((IDictionary<string,object>)result)[(string)code] = account;
}
} else if (isTrue(!isTrue(isolated) && isTrue((isTrue((isEqual(type, "spot"))) || isTrue(cross)))))
{
timestamp = this.safeInteger(response, "updateTime");
object balances = this.safeValue2(response, "balances", "userAssets", new List<object>() {});
object balances = this.safeList2(response, "balances", "userAssets", new List<object>() {});
for (object i = 0; isLessThan(i, getArrayLength(balances)); postFixIncrement(ref i))
{
object balance = getValue(balances, i);
Expand All @@ -3223,14 +3239,14 @@ public virtual object parseBalanceCustom(object response, object type = null, ob
}
} else if (isTrue(isolated))
{
object assets = this.safeValue(response, "assets");
object assets = this.safeList(response, "assets");
for (object i = 0; isLessThan(i, getArrayLength(assets)); postFixIncrement(ref i))
{
object asset = getValue(assets, i);
object marketId = this.safeValue(asset, "symbol");
object marketId = this.safeString(asset, "symbol");
object symbol = this.safeSymbol(marketId, null, null, "spot");
object bs = this.safeValue(asset, "baseAsset", new Dictionary<string, object>() {});
object quote = this.safeValue(asset, "quoteAsset", new Dictionary<string, object>() {});
object bs = this.safeDict(asset, "baseAsset", new Dictionary<string, object>() {});
object quote = this.safeDict(asset, "quoteAsset", new Dictionary<string, object>() {});
object baseCode = this.safeCurrencyCode(this.safeString(bs, "asset"));
object quoteCode = this.safeCurrencyCode(this.safeString(quote, "asset"));
object subResult = new Dictionary<string, object>() {};
Expand All @@ -3240,7 +3256,7 @@ public virtual object parseBalanceCustom(object response, object type = null, ob
}
} else if (isTrue(isEqual(type, "savings")))
{
object positionAmountVos = this.safeValue(response, "positionAmountVos", new List<object>() {});
object positionAmountVos = this.safeList(response, "positionAmountVos", new List<object>() {});
for (object i = 0; isLessThan(i, getArrayLength(positionAmountVos)); postFixIncrement(ref i))
{
object entry = getValue(positionAmountVos, i);
Expand Down Expand Up @@ -3272,7 +3288,7 @@ public virtual object parseBalanceCustom(object response, object type = null, ob
object balances = response;
if (!isTrue(((response is IList<object>) || (response.GetType().IsGenericType && response.GetType().GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>))))))
{
balances = this.safeValue(response, "assets", new List<object>() {});
balances = this.safeList(response, "assets", new List<object>() {});
}
for (object i = 0; isLessThan(i, getArrayLength(balances)); postFixIncrement(ref i))
{
Expand Down Expand Up @@ -3305,10 +3321,12 @@ public async override Task<object> fetchBalance(object parameters = null)
* @see https://binance-docs.github.io/apidocs/futures/en/#account-information-v2-user_data // swap
* @see https://binance-docs.github.io/apidocs/delivery/en/#account-information-user_data // future
* @see https://binance-docs.github.io/apidocs/voptions/en/#option-account-information-trade // option
* @see https://binance-docs.github.io/apidocs/pm/en/#account-balance-user_data // portfolio margin
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot'
* @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi'
* @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
* @param {string[]|undefined} [params.symbols] unified market symbols, only used in isolated margin mode
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the balance for a portfolio margin account
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
*/
parameters ??= new Dictionary<string, object>();
Expand All @@ -3319,6 +3337,10 @@ public async override Task<object> fetchBalance(object parameters = null)
var subTypeparametersVariable = this.handleSubTypeAndParams("fetchBalance", null, parameters);
subType = ((IList<object>)subTypeparametersVariable)[0];
parameters = ((IList<object>)subTypeparametersVariable)[1];
object isPortfolioMargin = null;
var isPortfolioMarginparametersVariable = this.handleOptionAndParams2(parameters, "fetchBalance", "papi", "portfolioMargin", false);
isPortfolioMargin = ((IList<object>)isPortfolioMarginparametersVariable)[0];
parameters = ((IList<object>)isPortfolioMarginparametersVariable)[1];
object marginMode = null;
object query = null;
var marginModequeryVariable = this.handleMarginModeAndParams("fetchBalance", parameters);
Expand All @@ -3327,7 +3349,11 @@ public async override Task<object> fetchBalance(object parameters = null)
query = this.omit(query, "type");
object response = null;
object request = new Dictionary<string, object>() {};
if (isTrue(this.isLinear(type, subType)))
if (isTrue(isTrue(isPortfolioMargin) || isTrue((isEqual(type, "papi")))))
{
type = "papi";
response = await this.papiGetBalance(this.extend(request, query));
} else if (isTrue(this.isLinear(type, subType)))
{
type = "linear";
response = await this.fapiPrivateV2GetAccount(this.extend(request, query));
Expand All @@ -3337,7 +3363,7 @@ public async override Task<object> fetchBalance(object parameters = null)
response = await this.dapiPrivateGetAccount(this.extend(request, query));
} else if (isTrue(isEqual(marginMode, "isolated")))
{
object paramSymbols = this.safeValue(parameters, "symbols");
object paramSymbols = this.safeList(parameters, "symbols");
query = this.omit(query, "symbols");
if (isTrue(!isEqual(paramSymbols, null)))
{
Expand Down Expand Up @@ -3556,6 +3582,26 @@ public async override Task<object> fetchBalance(object parameters = null)
// }
// ]
//
// portfolio margin
//
// [
// {
// "asset": "USDT",
// "totalWalletBalance": "66.9923261",
// "crossMarginAsset": "35.9697141",
// "crossMarginBorrowed": "0.0",
// "crossMarginFree": "35.9697141",
// "crossMarginInterest": "0.0",
// "crossMarginLocked": "0.0",
// "umWalletBalance": "31.022612",
// "umUnrealizedPNL": "0.0",
// "cmWalletBalance": "0.0",
// "cmUnrealizedPNL": "0.0",
// "updateTime": 0,
// "negativeBalance": "0.0"
// },
// ]
//
return this.parseBalanceCustom(response, type, marginMode);
}

Expand Down
13 changes: 12 additions & 1 deletion cs/ccxt/exchanges/bitfinex2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ public override object describe()
{ "has", new Dictionary<string, object>() {
{ "CORS", null },
{ "spot", true },
{ "margin", null },
{ "margin", true },
{ "swap", true },
{ "future", null },
{ "option", null },
{ "addMargin", false },
{ "borrowCrossMargin", false },
{ "borrowIsolatedMargin", false },
{ "cancelAllOrders", true },
{ "cancelOrder", true },
{ "cancelOrders", true },
Expand All @@ -38,8 +40,13 @@ public override object describe()
{ "createTriggerOrder", true },
{ "editOrder", true },
{ "fetchBalance", true },
{ "fetchBorrowInterest", false },
{ "fetchBorrowRateHistories", false },
{ "fetchBorrowRateHistory", false },
{ "fetchClosedOrder", true },
{ "fetchClosedOrders", true },
{ "fetchCrossBorrowRate", false },
{ "fetchCrossBorrowRates", false },
{ "fetchCurrencies", true },
{ "fetchDepositAddress", true },
{ "fetchDepositsWithdrawals", true },
Expand All @@ -48,6 +55,8 @@ public override object describe()
{ "fetchFundingRateHistory", true },
{ "fetchFundingRates", true },
{ "fetchIndexOHLCV", false },
{ "fetchIsolatedBorrowRate", false },
{ "fetchIsolatedBorrowRates", false },
{ "fetchLedger", true },
{ "fetchLeverage", false },
{ "fetchLeverageTiers", false },
Expand Down Expand Up @@ -75,6 +84,8 @@ public override object describe()
{ "fetchTransactionFees", null },
{ "fetchTransactions", "emulated" },
{ "reduceMargin", false },
{ "repayCrossMargin", false },
{ "repayIsolatedMargin", false },
{ "setLeverage", false },
{ "setMargin", true },
{ "setMarginMode", false },
Expand Down
10 changes: 7 additions & 3 deletions cs/ccxt/exchanges/krakenfutures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,14 @@ public override object describe()
} },
{ "fees", new Dictionary<string, object>() {
{ "trading", new Dictionary<string, object>() {
{ "tierBased", false },
{ "tierBased", true },
{ "percentage", true },
{ "maker", this.parseNumber("-0.0002") },
{ "taker", this.parseNumber("0.00075") },
{ "taker", this.parseNumber("0.0005") },
{ "maker", this.parseNumber("0.0002") },
{ "tiers", new Dictionary<string, object>() {
{ "taker", new List<object>() {new List<object> {this.parseNumber("0"), this.parseNumber("0.0005")}, new List<object> {this.parseNumber("100000"), this.parseNumber("0.0004")}, new List<object> {this.parseNumber("1000000"), this.parseNumber("0.0003")}, new List<object> {this.parseNumber("5000000"), this.parseNumber("0.00025")}, new List<object> {this.parseNumber("10000000"), this.parseNumber("0.0002")}, new List<object> {this.parseNumber("20000000"), this.parseNumber("0.00015")}, new List<object> {this.parseNumber("50000000"), this.parseNumber("0.000125")}, new List<object> {this.parseNumber("100000000"), this.parseNumber("0.0001")}} },
{ "maker", new List<object>() {new List<object> {this.parseNumber("0"), this.parseNumber("0.0002")}, new List<object> {this.parseNumber("100000"), this.parseNumber("0.0015")}, new List<object> {this.parseNumber("1000000"), this.parseNumber("0.000125")}, new List<object> {this.parseNumber("5000000"), this.parseNumber("0.0001")}, new List<object> {this.parseNumber("10000000"), this.parseNumber("0.000075")}, new List<object> {this.parseNumber("20000000"), this.parseNumber("0.00005")}, new List<object> {this.parseNumber("50000000"), this.parseNumber("0.000025")}, new List<object> {this.parseNumber("100000000"), this.parseNumber("0")}} },
} },
} },
} },
{ "exceptions", new Dictionary<string, object>() {
Expand Down
Loading

0 comments on commit 4ed68ef

Please sign in to comment.