8000 fix(exchange): protect cleanCache and add base unWatchOrders by carlosmiei · Pull Request #26280 · ccxt/ccxt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(exchange): protect cleanCache and add base unWatchOrders #26280

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 23, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
10000
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions ts/src/base/Exchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2475,6 +2475,10 @@ export default class Exchange {
throw new NotSupported (this.id + ' watchTrades() is not supported yet');
}

async unWatchOrders (symbol: Str = undefined, params = {}): Promise<any> {
throw new NotSupported (this.id + ' unWatchOrders() is not supported yet');
}

async unWatchTrades (symbol: string, params = {}): Promise<any> {
throw new NotSupported (this.id + ' unWatchTrades() is not supported yet');
}
Expand Down Expand Up @@ -7835,7 +7839,7 @@ export default class Exchange {
const symbolAndTimeFrame = symbolsAndTimeFrames[i];
const symbol = this.safeString (symbolAndTimeFrame, 0);
const timeframe = this.safeString (symbolAndTimeFrame, 1);
if (symbol in this.ohlcvs) {
if ((this.ohlcvs !== undefined) && (symbol in this.ohlcvs)) {
if (timeframe in this.ohlcvs[symbol]) {
delete this.ohlcvs[symbol][timeframe];
}
Expand All @@ -7859,7 +7863,7 @@ export default class Exchange {
}
}
} else {
if (topic === 'myTrades') {
if (topic === 'myTrades' && (this.myTrades !== undefined)) {
// don't reset this.myTrades directly here
// because in c# we need to use a different object (thread-safe dict)
const keys = Object.keys (this.myTrades);
Expand All @@ -7869,15 +7873,15 @@ export default class Exchange {
delete this.myTrades[key];
}
}
} else if (topic === 'orders') {
} else if (topic === 'orders' && (this.orders !== undefined)) {
const orderSymbols = Object.keys (this.orders);
for (let i = 0; i < orderSymbols.length; i++) {
const orderSymbol = orderSymbols[i];
if (orderSymbol in this.orders) {
delete this.orders[orderSymbol];
}
}
} else if (topic === 'ticker') {
} else if (topic === 'ticker' && (this.tickers !== undefined)) {
const tickerSymbols = Object.keys (this.tickers);
for (let i = 0; i < tickerSymbols.length; i++) {
const tickerSymbol = tickerSymbols[i];
Expand Down
Loading
0