Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
ea9a131
fix(bybit): fetchMarginMode - symbol added to the response (#27722)
yzh-pelle Jan 22, 2026
e0017cd
[Automated changes] Python files
github-actions[bot] Jan 22, 2026
fc4cc01
[Automated changes] JS files
github-actions[bot] Jan 22, 2026
a6fa263
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 22, 2026
8055ea8
[Automated changes] PHP files
github-actions[bot] Jan 22, 2026
0fcca2e
[Automated changes] C# files
github-actions[bot] Jan 22, 2026
4f8319c
[Automated changes] GO files
github-actions[bot] Jan 22, 2026
fd889e7
feat(okx): update ws to use instidcode (#27729)
pcriadoperez Jan 22, 2026
9384588
[Automated changes] Python files
github-actions[bot] Jan 22, 2026
06b12bb
[Automated changes] PHP files
github-actions[bot] Jan 22, 2026
31aa6d1
[Automated changes] C# files
github-actions[bot] Jan 22, 2026
6971895
[Automated changes] GO files
github-actions[bot] Jan 22, 2026
6078631
perf(base): safeBool, safeList, safeDict optimization (~70% reduction…
ttodua Jan 23, 2026
0f79e39
[Automated changes] Python files
github-actions[bot] Jan 23, 2026
02d3c35
[Automated changes] JS files
github-actions[bot] Jan 23, 2026
5fe8d0a
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 23, 2026
2f21cf4
[Automated changes] PHP files
github-actions[bot] Jan 23, 2026
d89bdda
[Automated changes] C# files
github-actions[bot] Jan 23, 2026
c2c1d5d
build(deps-dev): bump lodash from 4.17.21 to 4.17.23 (#27728)
dependabot[bot] Jan 23, 2026
2bba6c2
[Automated changes] GO files
github-actions[bot] Jan 23, 2026
a17847b
fix(go): getArrayLength and isArray (#27734)
carlosmiei Jan 23, 2026
186262a
[Automated changes] Python files
github-actions[bot] Jan 23, 2026
6e69e4d
[Automated changes] JS files
github-actions[bot] Jan 23, 2026
8c6dac3
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 23, 2026
7b1c586
[Automated changes] PHP files
github-actions[bot] Jan 23, 2026
83e1be4
[Automated changes] C# files
github-actions[bot] Jan 23, 2026
91ade92
[Automated changes] GO files
github-actions[bot] Jan 23, 2026
9b165fd
fix: ensure python asyncio_loop fix #27727
kroitor Jan 23, 2026
2fae2da
feat: add fetchFundingHistory for BingX (#27735)
slavivanov Jan 24, 2026
3115c53
[Automated changes] GO files
github-actions[bot] Jan 24, 2026
a82962d
fix(go): mathPow (#27739)
carlosmiei Jan 24, 2026
bf29071
[Automated changes] Python files
github-actions[bot] Jan 24, 2026
d12bb0e
[Automated changes] JS files
github-actions[bot] Jan 24, 2026
e63d68c
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 24, 2026
0c83e96
[Automated changes] PHP files
github-actions[bot] Jan 24, 2026
54aa7e5
[Automated changes] C# files
github-actions[bot] Jan 24, 2026
3a99b34
fix(binance): default type inside fetchPositionsWs (#27748)
carlosmiei Jan 26, 2026
4d77acf
[Automated changes] JS files
github-actions[bot] Jan 26, 2026
0980cc4
[Automated changes] Python files
github-actions[bot] Jan 26, 2026
dfd576b
[Automated changes] PHP files
github-actions[bot] Jan 26, 2026
04685f5
[Automated changes] GO files
github-actions[bot] Jan 26, 2026
468f830
fix(krakenfutures): orderIds encoding in python (#27751)
carlosmiei Jan 26, 2026
d802fce
[Automated changes] Python files
github-actions[bot] Jan 26, 2026
76ec6fd
[Automated changes] JS files
github-actions[bot] Jan 26, 2026
895d884
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 26, 2026
43c6e7b
[Automated changes] PHP files
github-actions[bot] Jan 26, 2026
307ccb3
[Automated changes] C# files
github-actions[bot] Jan 26, 2026
eac6fcc
[Automated changes] GO files
github-actions[bot] Jan 26, 2026
0a01b60
fix(xt): baseVolume and quoteVolume in ticker (#27753)
carlosmiei Jan 26, 2026
0544a50
[Automated changes] Python files
github-actions[bot] Jan 26, 2026
591bdf2
[Automated changes] JS files
github-actions[bot] Jan 26, 2026
c841043
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 26, 2026
a9980e6
[Automated changes] PHP files
github-actions[bot] Jan 26, 2026
75e9f95
[Automated changes] C# files
github-actions[bot] Jan 26, 2026
19688b3
[Automated changes] GO files
github-actions[bot] Jan 26, 2026
91c49bb
chore(skips): bigone, bitrue retrigger tests ^ (#27754)
ttodua Jan 26, 2026
0ff38f5
[Automated changes] Python files
github-actions[bot] Jan 26, 2026
ebb1ef2
[Automated changes] JS files
github-actions[bot] Jan 26, 2026
7f6b3a1
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 26, 2026
9fb45af
[Automated changes] PHP files
github-actions[bot] Jan 26, 2026
a3ca440
[Automated changes] C# files
github-actions[bot] Jan 26, 2026
3205a78
[Automated changes] GO files
github-actions[bot] Jan 26, 2026
e4f03ad
fix(htx): use .vn hostname instead (#27762)
carlosmiei Jan 27, 2026
aa4db6b
chore(cryptomus): skip & trigger spread tests on build ^ (#27757)
ttodua Jan 27, 2026
47021be
[Automated changes] Python files
github-actions[bot] Jan 27, 2026
6eba644
[Automated changes] JS files
github-actions[bot] Jan 27, 2026
984bc28
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 27, 2026
bdf20a6
[Automated changes] PHP files
github-actions[bot] Jan 27, 2026
f3fd5c4
[Automated changes] Python files
github-actions[bot] Jan 27, 2026
69e2b7e
[Automated changes] C# files
github-actions[bot] Jan 27, 2026
970c583
[Automated changes] JS files
github-actions[bot] Jan 27, 2026
66891e3
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 27, 2026
253ab8d
[Automated changes] PHP files
github-actions[bot] Jan 27, 2026
9cdc130
[Automated changes] C# files
github-actions[bot] Jan 27, 2026
3bcd819
[Automated changes] GO files
github-actions[bot] Jan 27, 2026
1f5501d
[Automated changes] GO files
github-actions[bot] Jan 27, 2026
2e73e45
test(deepExtend): base tests (#27750)
ttodua Jan 27, 2026
c0a781e
[Automated changes] JS files
github-actions[bot] Jan 27, 2026
4cbaea8
[Automated changes] Python files
github-actions[bot] Jan 27, 2026
d3ab527
[Automated changes] PHP files
github-actions[bot] Jan 27, 2026
8ac65ce
[Automated changes] C# files
github-actions[bot] Jan 27, 2026
886a55f
[Automated changes] GO files
github-actions[bot] Jan 27, 2026
98c531c
fix(lbank): ws sorted trades ^ (#27755)
ttodua Jan 27, 2026
e4f90f8
bybit error mapping (#27765)
ndubel Jan 27, 2026
a52d26e
kucoin error mapping (#27768)
ndubel Jan 27, 2026
98ff388
[Automated changes] Python files
github-actions[bot] Jan 27, 2026
f617ad0
[Automated changes] JS files
github-actions[bot] Jan 27, 2026
8e8e9ad
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 27, 2026
82ad41f
[Automated changes] Python files
github-actions[bot] Jan 27, 2026
133886f
[Automated changes] PHP files
github-actions[bot] Jan 27, 2026
5a54d48
[Automated changes] PHP files
github-actions[bot] Jan 27, 2026
ccc3095
[Automated changes] C# files
github-actions[bot] Jan 27, 2026
96197bf
[Automated changes] GO files
github-actions[bot] Jan 27, 2026
9fa245f
[Automated changes] GO files
github-actions[bot] Jan 27, 2026
0acbea3
[Automated changes] GO files
github-actions[bot] Jan 27, 2026
d9e62f6
fix(bitget): ticker percentage bug (#27764)
ttodua Jan 28, 2026
2a86e6c
[Automated changes] JS files
github-actions[bot] Jan 28, 2026
868edf7
[Automated changes] Python files
github-actions[bot] Jan 28, 2026
f63b694
[Automated changes] PHP files
github-actions[bot] Jan 28, 2026
79cd048
[Automated changes] C# files
github-actions[bot] Jan 28, 2026
b89b6bb
[Automated changes] GO files
github-actions[bot] Jan 28, 2026
2d6fdb2
test(currency): allow numeric id too (#27769)
ttodua Jan 28, 2026
c2aeebe
fix(toobit): ws listen key (#27771)
ttodua Jan 28, 2026
c2c4f7c
fix(go): add FeatureValue method (#27775)
ttodua Jan 28, 2026
635656a
chore(dydx): retest & skip spread (#27770)
ttodua Jan 28, 2026
b02a7c4
chore(xt): skip qv/bv comparison (#27767)
ttodua Jan 28, 2026
3a1dc83
[Automated changes] Python files
github-actions[bot] Jan 28, 2026
1f0053e
[Automated changes] JS files
github-actions[bot] Jan 28, 2026
9b24c26
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 28, 2026
90ecb8a
[Automated changes] Python files
github-actions[bot] Jan 28, 2026
5e4f74f
[Automated changes] JS files
github-actions[bot] Jan 28, 2026
9e7f30b
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 28, 2026
5a87c3b
[Automated changes] PHP files
github-actions[bot] Jan 28, 2026
bcb6c60
[Automated changes] PHP files
github-actions[bot] Jan 28, 2026
93dcf67
[Automated changes] C# files
github-actions[bot] Jan 28, 2026
8c37a6a
chore(test): watchOb spread (#27756)
ttodua Jan 28, 2026
84fb03f
feat(hyperliquid): add allMids support to watchTickers (#27776)
carlosmiei Jan 28, 2026
06e57df
[Automated changes] GO files
github-actions[bot] Jan 28, 2026
736b154
[Automated changes] Python files
github-actions[bot] Jan 28, 2026
b2afcda
[Automated changes] JS files
github-actions[bot] Jan 28, 2026
8d99c9e
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 28, 2026
5089fb0
[Automated changes] JS files
github-actions[bot] Jan 28, 2026
8b97f3f
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 28, 2026
18eb87d
[Automated changes] GO files
github-actions[bot] Jan 28, 2026
a4acbb3
[Automated changes] PHP files
github-actions[bot] Jan 28, 2026
4540508
[Automated changes] PHP files
github-actions[bot] Jan 28, 2026
51fb014
[Automated changes] C# files
github-actions[bot] Jan 28, 2026
1df6d52
[Automated changes] C# files
github-actions[bot] Jan 28, 2026
160dc55
[Automated changes] GO files
github-actions[bot] Jan 28, 2026
4aab49b
chore(deps): bump next from 15.4.10 to 16.1.5 in /examples/ts/nextjs-…
dependabot[bot] Jan 29, 2026
d93d035
feat(krakenfutures): trigger orders inside fetchClosedOrders/fetchCan…
carlosmiei Jan 29, 2026
d3deffc
feat(coinbase): withdraw, documentation link, network param descripti…
Dan-krm Jan 29, 2026
74c7057
fix(python): add NumType (#27785)
carlosmiei Jan 29, 2026
dac4c23
cryptocom error mapping (#27766)
ndubel Jan 29, 2026
7f1e960
[Automated changes] Python files
github-actions[bot] Jan 29, 2026
1bc1fb5
[Automated changes] JS files
github-actions[bot] Jan 29, 2026
dcdab8b
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 29, 2026
4d50f37
[Automated changes] Python files
github-actions[bot] Jan 29, 2026
13e4a56
[Automated changes] Python files
github-actions[bot] Jan 29, 2026
b8af880
[Automated changes] JS files
github-actions[bot] Jan 29, 2026
ea48591
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 29, 2026
1a08c90
[Automated changes] PHP files
github-actions[bot] Jan 29, 2026
956428d
[Automated changes] PHP files
github-actions[bot] Jan 29, 2026
08e27e6
[Automated changes] C# files
github-actions[bot] Jan 29, 2026
fefae92
[Automated changes] C# files
github-actions[bot] Jan 29, 2026
5dfad7a
[Automated changes] GO files
github-actions[bot] Jan 29, 2026
adbd93c
[Automated changes] GO files
github-actions[bot] Jan 29, 2026
d67efd3
[Automated changes] GO files
github-actions[bot] Jan 29, 2026
a4e38a7
go: update ToFloat64 (#27789)
sc0Vu Jan 29, 2026
fc52daa
fix(php): exception_message (#27774)
ttodua Jan 29, 2026
810442d
test: add capitalize base test (#27783)
ttodua Jan 29, 2026
97f369d
[Automated changes] JS files
github-actions[bot] Jan 29, 2026
f63cd85
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 29, 2026
1cde753
[Automated changes] Python files
github-actions[bot] Jan 29, 2026
cb8fc23
[Automated changes] JS files
github-actions[bot] Jan 29, 2026
ce77be0
Merge branch 'master' of https://github.com/ccxt/ccxt
github-actions[bot] Jan 29, 2026
d9ec565
[Automated changes] PHP files
github-actions[bot] Jan 29, 2026
145b6a4
[Automated changes] C# files
github-actions[bot] Jan 29, 2026
8151f94
[Automated changes] PHP files
github-actions[bot] Jan 29, 2026
ddb3441
fix(bybit): use dynamic funding interval for fetchFundingRateHistory …
danyalzaki000 Jan 29, 2026
d91a28d
[Automated changes] Python files
github-actions[bot] Jan 29, 2026
628a71c
[Automated changes] PHP files
github-actions[bot] Jan 29, 2026
3cd2d48
[Automated changes] C# files
github-actions[bot] Jan 29, 2026
f758e6d
[Automated changes] GO files
github-actions[bot] Jan 29, 2026
dc08415
perf(python): deep_extend (#27736)
ttodua Jan 29, 2026
c3fa6ed
[Automated changes] JS files
github-actions[bot] Jan 29, 2026
0b822a5
Merge branch 'master' into HEAD
sc0Vu Jan 29, 2026
969004b
exchange: fix typedata encoding
sc0Vu Jan 29, 2026
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
2 changes: 2 additions & 0 deletions build/csharpTranspiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,8 @@ class NewTranspiler {
[/testSharedMethods\.assertTimestampAndDatetime\(exchange, skippedProperties, method, orderbook\)/, '// testSharedMethods.assertTimestampAndDatetime (exchange, skippedProperties, method, orderbook)'], // tmp disabling timestamp check on the orderbook
[ /void function/g, 'void'],
[/(\w+)\.spawn\(([^,]+),(.+)\)/gm, '$1.spawn($2, new object[] {$3})'],
// apply 'getPreTranspilationRegexes' here, bcz in CS we don't have pre-transpilation regexes
[/exchange.jsonStringifyWithNull/g, 'json'],
];

if (isWs) {
Expand Down
4 changes: 3 additions & 1 deletion build/goTranspiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2551,7 +2551,9 @@ func (this *${className}) Init(userConfig map[string]interface{}) {
[/(interface{}\sfunc\sEquals.+\n.*\n.+\n.+|func Equals\(.+\n.*\n.*\n.*\})/gm, ''], // remove equals
// Fix infinite loop bug in WebSocket tests - move now = exchange.Milliseconds() outside success check
[/(\s+)(if IsTrue\(IsEqual\(success, true\)\) \{\s*\n[\s\S]*?)(\s+now = exchange\.Milliseconds\(\)\s*\n\s*\})/gm, '$1$2$1now = exchange.Milliseconds()$3'],

// apply 'getPreTranspilationRegexes' here, bcz in GO we don't have pre-transpilation regexes
[/exchange.JsonStringifyWithNull/g, 'JsonStringify'],



// [ /object exchange(?=[,)])/g, 'Exchange exchange' ],
Expand Down
11 changes: 11 additions & 0 deletions build/transpile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ class Transpiler {
return uncameled;
}

getPreTranspilationRegexes () {
// here are regexes for common language functions, which might have uniform behavior across all other langs, except JS. so, we apply JS-specific modification, during pre-transpilation process
// by this way (to edit JS only behavior), we avoid the necessity of language-specific placeholder methods across different langs' base classes
return [
[ /exchange.jsonStringifyWithNull/g, 'JSON.stringify' ],
];
}

getCommonRegexes (): any[] {

return [
Expand All @@ -119,6 +127,7 @@ class Transpiler {
[ /\.safeList2/g, '.safe_list_2'],
[ /\.safeIntegerProduct2/g, '.safe_integer_product_2'],
[ /\.safeNumberOmitZero/g, '.safe_number_omit_zero'],
[ /\.exceptionMessage/g, '.exception_message'],
[ /\.fetchOHLCVS/g, '.fetch_ohlcvs'],
[ /\.fetchOHLCVWs/g, '.fetch_ohlcvws'],
[ /\.parseOHLCVS/g, '.parse_ohlcvs'],
Expand Down Expand Up @@ -2431,6 +2440,8 @@ class Transpiler {
[ /function equals \([\S\s]+?return true;?\n}\n/g, '' ],
]));

allFiles = allFiles.map( file => this.regexAll(file, this.getPreTranspilationRegexes()));

const flatResult = await this.webworkerTranspile (allFiles, fileConfig, parserConfig);

const exchangeCamelCaseProps = (str: string) => {
Expand Down
66 changes: 62 additions & 4 deletions cs/ccxt/base/Exchange.BaseMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,12 @@ public virtual object safeBool(object dictionary, object key, object defaultValu
* @description safely extract boolean value from dictionary or list
* @returns {bool | undefined}
*/
return this.safeBoolN(dictionary, new List<object>() {key}, defaultValue);
object value = this.safeValue(dictionary, key, defaultValue);
if (isTrue((value is bool)))
{
return value;
}
return defaultValue;
}

public virtual object safeDictN(object dictionaryOrList, object keys, object defaultValue = null)
Expand Down Expand Up @@ -422,7 +427,16 @@ public virtual object safeDict(object dictionary, object key, object defaultValu
* @description safely extract a dictionary from dictionary or list
* @returns {object | undefined}
*/
return this.safeDictN(dictionary, new List<object>() {key}, defaultValue);
object value = this.safeValue(dictionary, key, defaultValue);
if (isTrue(isEqual(value, null)))
{
return defaultValue;
}
if (isTrue(isTrue(((value is IDictionary<string, object>))) && !isTrue(((value is IList<object>) || (value.GetType().IsGenericType && value.GetType().GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>)))))))
{
return value;
}
return defaultValue;
}

public virtual object safeDict2(object dictionary, object key1, object key2, object defaultValue = null)
Expand Down Expand Up @@ -475,7 +489,16 @@ public virtual object safeList(object dictionaryOrList, object key, object defau
* @description safely extract an Array from dictionary or list
* @returns {Array | undefined}
*/
return this.safeListN(dictionaryOrList, new List<object>() {key}, defaultValue);
object value = this.safeValue(dictionaryOrList, key, 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;
}
return defaultValue;
}

public virtual void handleDeltas(object orderbook, object deltas)
Expand Down Expand Up @@ -7473,7 +7496,8 @@ public async virtual Task<object> fetchPaginatedCallDynamic(object method, objec
uniqueResults = this.removeRepeatedElementsFromArray(result);
}
object key = ((bool) isTrue((isEqual(method, "fetchOHLCV")))) ? 0 : "timestamp";
return this.filterBySinceLimit(uniqueResults, since, limit, key);
object sortedRes = this.sortBy(uniqueResults, key);
return this.filterBySinceLimit(sortedRes, since, limit, key);
}

public async virtual Task<object> safeDeterministicCall(object method, object symbol = null, object since = null, object limit = null, object timeframe = null, object parameters = null)
Expand Down Expand Up @@ -8352,5 +8376,39 @@ public virtual void cleanCache(object subscription)
}
}
}

public virtual object timeframeFromMilliseconds(object ms)
{
if (isTrue(isLessThanOrEqual(ms, 0)))
{
return "";
}
object second = 1000;
object minute = multiply(60, second);
object hour = multiply(60, minute);
object day = multiply(24, hour);
object week = multiply(7, day);
if (isTrue(isEqual(mod(ms, week), 0)))
{
return add((divide(ms, week)), "w");
}
if (isTrue(isEqual(mod(ms, day), 0)))
{
return add((divide(ms, day)), "d");
}
if (isTrue(isEqual(mod(ms, hour), 0)))
{
return add((divide(ms, hour)), "h");
}
if (isTrue(isEqual(mod(ms, minute), 0)))
{
return add((divide(ms, minute)), "m");
}
if (isTrue(isEqual(mod(ms, second), 0)))
{
return add((divide(ms, second)), "s");
}
return "";
}
}

4 changes: 2 additions & 2 deletions cs/ccxt/base/Exchange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ public void setProperty(object obj, object property, object defaultValue = null)
}
}

public string exceptionMessage(object exc)
public string exceptionMessage(object exc, bool includeStack = true)
{
var e = exc as Exception;
if (e != null && e is System.AggregateException)
Expand All @@ -1037,7 +1037,7 @@ public string exceptionMessage(object exc)
e = inner;
}
}
var message = e != null ? e.ToString() : "Exception occurred, but no message available.";
var message = e != null ? (includeStack ? e.ToString() : e.Message) : "Exception occurred, but no message available.";
return message.Substring(0, Math.Min(100000, message.Length));
}

Expand Down
2 changes: 1 addition & 1 deletion cs/ccxt/exchanges/bigone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ public override object parseOrder(object order, object market = null)
{
//
// {
// "id": "42154072251",
// "id": "42154072252",
// "asset_pair_name": "SOL-USDT",
// "price": "20",
// "amount": "0.5",
Expand Down
96 changes: 96 additions & 0 deletions cs/ccxt/exchanges/bingx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public override object describe()
{ "fetchDeposits", true },
{ "fetchDepositWithdrawFee", "emulated" },
{ "fetchDepositWithdrawFees", true },
{ "fetchFundingHistory", true },
{ "fetchFundingRate", true },
{ "fetchFundingRateHistory", true },
{ "fetchFundingRates", true },
Expand Down Expand Up @@ -1882,6 +1883,101 @@ public override object parseFundingRateHistory(object contract, object market =
};
}

/**
* @method
* @name bingx#fetchFundingHistory
* @description fetches historical funding received
* @see https://bingx-api.github.io/docs-v3/#/en/Swap/Account%20Endpoints/Get%20Account%20Profit%20and%20Loss%20Fund%20Flow
* @param {string} symbol unified symbol of the market to fetch the funding history for
* @param {int} [since] timestamp in ms of the earliest funding to fetch
* @param {int} [limit] the maximum amount of [funding history structures]{@link https://docs.ccxt.com/?id=funding-history-structure} to fetch
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @param {int} [params.until] timestamp in ms of the latest funding to fetch
* @returns {object[]} a list of [funding history structures]{@link https://docs.ccxt.com/?id=funding-history-structure}
*/
public async override Task<object> fetchFundingHistory(object symbol = null, object since = null, object limit = null, object parameters = null)
{
parameters ??= new Dictionary<string, object>();
await this.loadMarkets();
object paginate = false;
var paginateparametersVariable = this.handleOptionAndParams(parameters, "fetchFundingHistory", "paginate");
paginate = ((IList<object>)paginateparametersVariable)[0];
parameters = ((IList<object>)paginateparametersVariable)[1];
if (isTrue(paginate))
{
return await this.fetchPaginatedCallDeterministic("fetchFundingHistory", symbol, since, limit, "24h", parameters);
}
object request = new Dictionary<string, object>() {
{ "incomeType", "FUNDING_FEE" },
};
object market = null;
if (isTrue(!isEqual(symbol, null)))
{
market = this.market(symbol);
((IDictionary<string,object>)request)["symbol"] = getValue(market, "id");
}
if (isTrue(!isEqual(since, null)))
{
((IDictionary<string,object>)request)["startTime"] = since;
}
if (isTrue(!isEqual(limit, null)))
{
((IDictionary<string,object>)request)["limit"] = limit;
}
object until = this.safeInteger2(parameters, "until", "endTime");
if (isTrue(!isEqual(until, null)))
{
parameters = this.omit(parameters, new List<object>() {"until"});
((IDictionary<string,object>)request)["endTime"] = until;
}
object response = await this.swapV2PrivateGetUserIncome(this.extend(request, parameters));
// {
// "code": 0,
// "msg": "",
// "data": [
// {
// "symbol": "LDO-USDT",
// "incomeType": "FUNDING_FEE",
// "income": "-0.0292",
// "asset": "USDT",
// "info": "Funding Fee",
// "time": 1702713615000,
// "tranId": "170***6*2_3*9_20***97",
// "tradeId": "170***6*2_3*9_20***97"
// }
// ]
// }
object data = this.safeList(response, "data", new List<object>() {});
return this.parseIncomes(data, market, since, limit);
}

public override object parseIncome(object income, object market = null)
{
// {
// "symbol": "LDO-USDT",
// "incomeType": "FUNDING_FEE",
// "income": "-0.0292",
// "asset": "USDT",
// "info": "Funding Fee",
// "time": 1702713615000,
// "tranId": "170***6*2_3*9_20***97",
// "tradeId": "170***6*2_3*9_20***97"
// }
object marketId = this.safeString(income, "symbol");
object currencyId = this.safeString(income, "asset");
object timestamp = this.safeInteger(income, "time");
return new Dictionary<string, object>() {
{ "info", income },
{ "symbol", this.safeSymbol(marketId, market, null, "swap") },
{ "code", this.safeCurrencyCode(currencyId) },
{ "timestamp", timestamp },
{ "datetime", this.iso8601(timestamp) },
{ "id", this.safeString(income, "tranId") },
{ "amount", this.safeNumber(income, "income") },
{ "type", "funding" },
};
}

/**
* @method
* @name bingx#fetchOpenInterest
Expand Down
6 changes: 3 additions & 3 deletions cs/ccxt/exchanges/bitget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3351,7 +3351,6 @@ public override object parseTicker(object ticker, object market = null)
object marketId = this.safeString(ticker, "symbol");
object close = this.safeString2(ticker, "lastPr", "lastPrice");
object timestamp = this.safeIntegerOmitZero(ticker, "ts"); // exchange bitget provided 0
object change = this.safeString(ticker, "change24h");
object category = this.safeString(ticker, "category");
object markPrice = this.safeString(ticker, "markPrice");
object marketType = null;
Expand All @@ -3365,7 +3364,8 @@ public override object parseTicker(object ticker, object market = null)
object percentage = this.safeString(ticker, "price24hPcnt");
if (isTrue(isEqual(percentage, null)))
{
percentage = Precise.stringMul(change, "100");
object change24h = this.safeString(ticker, "change24h");
percentage = Precise.stringMul(change24h, "100");
}
return this.safeTicker(new Dictionary<string, object>() {
{ "symbol", this.safeSymbol(marketId, market, null, marketType) },
Expand All @@ -3382,7 +3382,7 @@ public override object parseTicker(object ticker, object market = null)
{ "close", close },
{ "last", close },
{ "previousClose", null },
{ "change", change },
{ "change", null },
{ "percentage", percentage },
{ "average", null },
{ "baseVolume", this.safeString2(ticker, "baseVolume", "volume24h") },
Expand Down
2 changes: 1 addition & 1 deletion cs/ccxt/exchanges/bitrue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2459,7 +2459,7 @@ public async override Task<object> cancelOrder(object id, object symbol = null,
// "code": "0",
// "msg": "Success",
// "data": {
// "orderId": 1690615847831143159
// "orderId": 1690615847831143154
// }
// }
//
Expand Down
15 changes: 11 additions & 4 deletions cs/ccxt/exchanges/bybit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ public override object describe()
{ "170203", typeof(InvalidOrder) },
{ "170204", typeof(InvalidOrder) },
{ "170206", typeof(InvalidOrder) },
{ "170209", typeof(RestrictedLocation) },
{ "170210", typeof(InvalidOrder) },
{ "170213", typeof(OrderNotFound) },
{ "170217", typeof(InvalidOrder) },
Expand Down Expand Up @@ -2968,7 +2969,7 @@ public async override Task<object> fetchFundingRateHistory(object symbol = null,
parameters = ((IList<object>)paginateparametersVariable)[1];
if (isTrue(paginate))
{
return await this.fetchPaginatedCallDeterministic("fetchFundingRateHistory", symbol, since, limit, "8h", parameters, 200);
return await this.fetchPaginatedCallDynamic("fetchFundingRateHistory", symbol, since, limit, parameters, 200);
}
if (isTrue(isEqual(limit, null)))
{
Expand All @@ -2978,6 +2979,7 @@ public async override Task<object> fetchFundingRateHistory(object symbol = null,
{ "limit", limit },
};
object market = this.market(symbol);
object fundingTimeFrameMins = this.safeInteger(getValue(market, "info"), "fundingInterval");
symbol = getValue(market, "symbol");
((IDictionary<string,object>)request)["symbol"] = getValue(market, "id");
object type = null;
Expand Down Expand Up @@ -3005,7 +3007,11 @@ public async override Task<object> fetchFundingRateHistory(object symbol = null,
{
// end time is required when since is not empty
object fundingInterval = multiply(multiply(multiply(60, 60), 8), 1000);
((IDictionary<string,object>)request)["endTime"] = add(since, multiply(limit, fundingInterval));
if (isTrue(!isEqual(fundingTimeFrameMins, null)))
{
fundingInterval = multiply(multiply(fundingTimeFrameMins, 60), 1000);
}
((IDictionary<string,object>)request)["endTime"] = this.sum(since, multiply(limit, fundingInterval));
}
}
object response = await this.publicGetV5MarketFundingHistory(this.extend(request, parameters));
Expand Down Expand Up @@ -10163,14 +10169,15 @@ public override object parseLongShortRatio(object info, object market = null)
* @name bybit#fetchMarginMode
* @description fetches the margin mode of the trading pair
* @see https://bybit-exchange.github.io/docs/v5/account/account-info
* @param {string} [symbol] unified symbol of the market to fetch the margin mode for (not used by bybit)
* @param {string} [symbol] unified symbol of the market to fetch the margin mode for
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @returns {object} a [margin mode structure]{@link https://docs.ccxt.com/?id=margin-mode-structure}
*/
public async override Task<object> fetchMarginMode(object symbol, object parameters = null)
{
parameters ??= new Dictionary<string, object>();
await this.loadMarkets();
object market = this.market(symbol);
object response = await this.privateGetV5AccountInfo(parameters);
//
// {
Expand All @@ -10189,7 +10196,7 @@ public async override Task<object> fetchMarginMode(object symbol, object paramet
// }
//
object result = this.safeDict(response, "result", new Dictionary<string, object>() {});
return this.parseMarginMode(result);
return this.parseMarginMode(result, market);
}

public override object parseMarginMode(object marginMode, object market = null)
Expand Down
Loading