Skip to content

Commit

Permalink
2.5.26
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Jan 4, 2023
1 parent 32f2c80 commit 8b98963
Show file tree
Hide file tree
Showing 20 changed files with 145 additions and 308 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -208,13 +208,13 @@ console.log (ccxt.exchanges) // print all available exchanges

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

* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@2.5.25/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@2.5.25/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@2.5.26/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@2.5.26/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/ccxt@2.5.25/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@2.5.26/dist/ccxt.browser.js"></script>
```

Creates a global `ccxt` object:
Expand Down
2 changes: 1 addition & 1 deletion ccxt.js
Expand Up @@ -37,7 +37,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '2.5.25'
const version = '2.5.26'

Exchange.ccxtVersion = version

Expand Down
81 changes: 23 additions & 58 deletions dist/ccxt.browser.js
Expand Up @@ -47,7 +47,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '2.5.24'
const version = '2.5.25'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -236326,84 +236326,49 @@ module.exports = class therock extends Exchange {
// "position_id": null,
// "trades": [
// {
// "id":237338,
// "fund_id":"BTCEUR",
// "amount":50,
// "price":0.0102,
// "side":"buy",
// "dark":false,
// "date":"2015-06-03T00:49:49.000Z"
// "id": 237338,
// "fund_id": "BTCEUR",
// "amount": 50,
// "price": 0.0102,
// "side": "buy",
// "dark": false,
// "date": "2015-06-03T00:49:49.000Z"
// }
// ]
// }
//
const id = this.safeString (order, 'id');
const marketId = this.safeString (order, 'fund_id');
const symbol = this.safeSymbol (marketId, market);
const status = this.parseOrderStatus (this.safeString (order, 'status'));
const timestamp = this.parse8601 (this.safeString (order, 'date'));
const type = this.safeString (order, 'type');
const side = this.safeString (order, 'side');
const amount = this.safeNumber (order, 'amount');
const remaining = this.safeNumber (order, 'amount_unfilled');
let filled = undefined;
if (amount !== undefined) {
if (remaining !== undefined) {
filled = amount - remaining;
}
}
const price = this.safeNumber (order, 'price');
let trades = this.safeValue (order, 'trades');
let cost = undefined;
let average = undefined;
let lastTradeTimestamp = undefined;
if (trades !== undefined) {
const numTrades = trades.length;
if (numTrades > 0) {
trades = this.parseTrades (trades, market, undefined, undefined, {
'orderId': id,
});
// todo: determine the cost and the average price from trades
cost = 0;
filled = 0;
for (let i = 0; i < numTrades; i++) {
const trade = trades[i];
cost = this.sum (cost, trade['cost']);
filled = this.sum (filled, trade['amount']);
}
if (filled > 0) {
average = cost / filled;
}
lastTradeTimestamp = trades[numTrades - 1]['timestamp'];
} else {
cost = 0;
}
}
const stopPrice = this.safeNumber (order, 'conditional_price');
return {
const amount = this.safeString (order, 'amount');
const remaining = this.safeString (order, 'amount_unfilled');
const price = this.safeString (order, 'price');
const trades = this.safeValue (order, 'trades');
const stopPrice = this.safeString (order, 'conditional_price');
return this.safeOrder ({
'id': id,
'clientOrderId': undefined,
'info': order,
'timestamp': timestamp,
'datetime': this.iso8601 (timestamp),
'lastTradeTimestamp': lastTradeTimestamp,
'status': status,
'symbol': symbol,
'type': type,
'lastTradeTimestamp': undefined,
'status': this.parseOrderStatus (this.safeString (order, 'status')),
'symbol': this.safeSymbol (marketId, market),
'type': this.safeString (order, 'type'),
'timeInForce': undefined,
'postOnly': undefined,
'side': side,
'side': this.safeString (order, 'side'),
'price': price,
'stopPrice': stopPrice,
'triggerPrice': stopPrice,
'cost': cost,
'cost': undefined,
'amount': amount,
'filled': filled,
'average': average,
'filled': undefined,
'average': undefined,
'remaining': remaining,
'fee': undefined,
'trades': trades,
};
}, market);
}

async fetchOpenOrders (symbol = undefined, since = undefined, limit = undefined, params = {}) {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "2.5.25",
"version": "2.5.26",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges",
"main": "./ccxt.js",
"unpkg": "dist/ccxt.browser.js",
Expand Down Expand Up @@ -244,7 +244,7 @@
"ccex",
"C-CEX",
"cex",
"CEX.IO",
"cex.io",
"CHBTC",
"ChileBit",
"chilebit.net",
Expand Down Expand Up @@ -414,7 +414,7 @@
"fybse.se",
"fybsg.com",
"gatecoin.com",
"gate.io",
"Gate.io",
"gdax.com",
"gemini.com",
"getbtc.org",
Expand Down Expand Up @@ -531,8 +531,8 @@
"dsxglobal.com",
"bitvavo.com",
"Bitvavo",
"currency.com",
"waves.exchange",
"Currency.com",
"Waves.Exchange",
"phemex.com",
"Phemex",
"huobi.co.jp",
Expand Down Expand Up @@ -581,7 +581,7 @@
"Binance USDⓈ-M",
"eqonex.com",
"EQONEX",
"fmfw.io",
"FMFW.io",
"mexc.com",
"MEXC Global",
"bitrue.com",
Expand All @@ -595,8 +595,8 @@
"Zonda",
"futures.kucoin.com",
"KuCoin Futures",
"blockchain.com",
"crypto.com",
"Blockchain.com",
"Crypto.com",
"wazirx.com",
"WazirX",
"woo.org",
Expand Down
4 changes: 2 additions & 2 deletions php/Exchange.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions php/async/Exchange.php
Expand Up @@ -34,11 +34,11 @@

include 'Throttle.php';

$version = '2.5.25';
$version = '2.5.26';

class Exchange extends \ccxt\Exchange {

const VERSION = '2.5.25';
const VERSION = '2.5.26';

public $browser;
public $marketsLoading = null;
Expand Down
77 changes: 21 additions & 56 deletions php/async/therock.php
Expand Up @@ -1109,84 +1109,49 @@ public function parse_order($order, $market = null) {
// "position_id" => null,
// "trades" => array(
// {
// "id":237338,
// "fund_id":"BTCEUR",
// "amount":50,
// "price":0.0102,
// "side":"buy",
// "dark":false,
// "date":"2015-06-03T00:49:49.000Z"
// "id" => 237338,
// "fund_id" => "BTCEUR",
// "amount" => 50,
// "price" => 0.0102,
// "side" => "buy",
// "dark" => false,
// "date" => "2015-06-03T00:49:49.000Z"
// }
// )
// }
//
$id = $this->safe_string($order, 'id');
$marketId = $this->safe_string($order, 'fund_id');
$symbol = $this->safe_symbol($marketId, $market);
$status = $this->parse_order_status($this->safe_string($order, 'status'));
$timestamp = $this->parse8601($this->safe_string($order, 'date'));
$type = $this->safe_string($order, 'type');
$side = $this->safe_string($order, 'side');
$amount = $this->safe_number($order, 'amount');
$remaining = $this->safe_number($order, 'amount_unfilled');
$filled = null;
if ($amount !== null) {
if ($remaining !== null) {
$filled = $amount - $remaining;
}
}
$price = $this->safe_number($order, 'price');
$amount = $this->safe_string($order, 'amount');
$remaining = $this->safe_string($order, 'amount_unfilled');
$price = $this->safe_string($order, 'price');
$trades = $this->safe_value($order, 'trades');
$cost = null;
$average = null;
$lastTradeTimestamp = null;
if ($trades !== null) {
$numTrades = count($trades);
if ($numTrades > 0) {
$trades = $this->parse_trades($trades, $market, null, null, array(
'orderId' => $id,
));
// todo => determine the $cost and the $average $price from $trades
$cost = 0;
$filled = 0;
for ($i = 0; $i < $numTrades; $i++) {
$trade = $trades[$i];
$cost = $this->sum($cost, $trade['cost']);
$filled = $this->sum($filled, $trade['amount']);
}
if ($filled > 0) {
$average = $cost / $filled;
}
$lastTradeTimestamp = $trades[$numTrades - 1]['timestamp'];
} else {
$cost = 0;
}
}
$stopPrice = $this->safe_number($order, 'conditional_price');
return array(
$stopPrice = $this->safe_string($order, 'conditional_price');
return $this->safe_order(array(
'id' => $id,
'clientOrderId' => null,
'info' => $order,
'timestamp' => $timestamp,
'datetime' => $this->iso8601($timestamp),
'lastTradeTimestamp' => $lastTradeTimestamp,
'status' => $status,
'symbol' => $symbol,
'type' => $type,
'lastTradeTimestamp' => null,
'status' => $this->parse_order_status($this->safe_string($order, 'status')),
'symbol' => $this->safe_symbol($marketId, $market),
'type' => $this->safe_string($order, 'type'),
'timeInForce' => null,
'postOnly' => null,
'side' => $side,
'side' => $this->safe_string($order, 'side'),
'price' => $price,
'stopPrice' => $stopPrice,
'triggerPrice' => $stopPrice,
'cost' => $cost,
'cost' => null,
'amount' => $amount,
'filled' => $filled,
'average' => $average,
'filled' => null,
'average' => null,
'remaining' => $remaining,
'fee' => null,
'trades' => $trades,
);
), $market);
}

public function fetch_open_orders($symbol = null, $since = null, $limit = null, $params = array ()) {
Expand Down

0 comments on commit 8b98963

Please sign in to comment.