Skip to content

Commit

Permalink
2.4.36
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Dec 20, 2022
1 parent 69e27c4 commit 84f3c02
Show file tree
Hide file tree
Showing 21 changed files with 191 additions and 57 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.4.35/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@2.4.35/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@2.4.36/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@2.4.36/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.4.35/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@2.4.36/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.4.35'
const version = '2.4.36'

Exchange.ccxtVersion = version

Expand Down
36 changes: 32 additions & 4 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.4.35'
const version = '2.4.36'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -112068,6 +112068,8 @@ module.exports = class huobi extends Exchange {
'invalid-address': BadRequest, // {"status":"error","err-code":"invalid-address","err-msg":"Invalid address.","data":null},
'base-currency-chain-error': BadRequest, // {"status":"error","err-code":"base-currency-chain-error","err-msg":"The current currency chain does not exist","data":null},
'dw-insufficient-balance': InsufficientFunds, // {"status":"error","err-code":"dw-insufficient-balance","err-msg":"Insufficient balance. You can only transfer `12.3456` at most.","data":null}
'base-withdraw-fee-error': BadRequest, // {"status":"error","err-code":"base-withdraw-fee-error","err-msg":"withdrawal fee is not within limits","data":null}
'dw-withdraw-min-limit': BadRequest, // {"status":"error","err-code":"dw-withdraw-min-limit","err-msg":"The withdrawal amount is less than the minimum limit.","data":null}
},
},
'precisionMode': TICK_SIZE,
Expand All @@ -112085,6 +112087,9 @@ module.exports = class huobi extends Exchange {
},
},
},
'withdraw': {
'includeFee': false,
},
'defaultType': 'spot', // spot, future, swap
'defaultSubType': 'linear', // inverse, linear
'defaultNetwork': 'ERC20',
Expand Down Expand Up @@ -116205,17 +116210,40 @@ module.exports = class huobi extends Exchange {
const currency = this.currency (code);
const request = {
'address': address, // only supports existing addresses in your withdraw address list
'amount': amount,
'currency': currency['id'].toLowerCase (),
};
if (tag !== undefined) {
request['addr-tag'] = tag; // only for XRP?
}
const [ networkCode, paramsOmited ] = this.handleNetworkCodeAndParams (params);
let networkCode = undefined;
[ networkCode, params ] = this.handleNetworkCodeAndParams (params);
if (networkCode !== undefined) {
request['chain'] = this.networkCodeToId (networkCode, code);
}
const response = await this.spotPrivatePostV1DwWithdrawApiCreate (this.extend (request, paramsOmited));
amount = parseFloat (this.currencyToPrecision (code, amount, networkCode));
const withdrawOptions = this.safeValue (this.options, 'withdraw', {});
if (this.safeValue (withdrawOptions, 'includeFee', false)) {
let fee = this.safeNumber (params, 'fee');
if (fee === undefined) {
const currencies = await this.fetchCurrencies ();
this.currencies = this.deepExtend (this.currencies, currencies);
const targetNetwork = this.safeValue (currency['networks'], networkCode, {});
fee = this.safeNumber (targetNetwork, 'fee');
if (fee === undefined) {
throw new ArgumentsRequired (this.id + ' withdraw() function can not find withdraw fee for chosen network. You need to re-load markets with "exchange.loadMarkets(true)", or provide the "fee" parameter');
}
}
// fee needs to be deducted from whole amount
const feeString = this.currencyToPrecision (code, fee, networkCode);
params = this.omit (params, 'fee');
const amountString = this.numberToString (amount);
const amountSubtractedString = Precise.stringSub (amountString, feeString);
const amountSubtracted = parseFloat (amountSubtractedString);
request['fee'] = parseFloat (feeString);
amount = parseFloat (this.currencyToPrecision (code, amountSubtracted, networkCode));
}
request['amount'] = amount;
const response = await this.spotPrivatePostV1DwWithdrawApiCreate (this.extend (request, params));
//
// {
// "status": "ok",
Expand Down
6 changes: 3 additions & 3 deletions doc/readme.rst
Expand Up @@ -1864,14 +1864,14 @@ JavaScript (for use with the ``<script>`` tag):
All-in-one browser bundle (dependencies included), served from a CDN of your choice:


* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@2.4.35/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@2.4.35/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@2.4.36/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@2.4.36/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.

.. code-block:: HTML

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@2.4.35/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@2.4.36/dist/ccxt.browser.js"></script>

Creates a global ``ccxt`` object:

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.4.35",
"version": "2.4.36",
"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.4.35';
$version = '2.4.36';

class Exchange extends \ccxt\Exchange {

const VERSION = '2.4.35';
const VERSION = '2.4.36';

public $browser;
public $marketsLoading = null;
Expand Down
34 changes: 31 additions & 3 deletions php/async/huobi.php
Expand Up @@ -898,6 +898,8 @@ public function describe() {
'invalid-address' => '\\ccxt\\BadRequest', // array("status":"error","err-code":"invalid-address","err-msg":"Invalid address.","data":null),
'base-currency-chain-error' => '\\ccxt\\BadRequest', // array("status":"error","err-code":"base-currency-chain-error","err-msg":"The current currency chain does not exist","data":null),
'dw-insufficient-balance' => '\\ccxt\\InsufficientFunds', // array("status":"error","err-code":"dw-insufficient-balance","err-msg":"Insufficient balance. You can only transfer `12.3456` at most.","data":null)
'base-withdraw-fee-error' => '\\ccxt\\BadRequest', // array("status":"error","err-code":"base-withdraw-fee-error","err-msg":"withdrawal fee is not within limits","data":null)
'dw-withdraw-min-limit' => '\\ccxt\\BadRequest', // array("status":"error","err-code":"dw-withdraw-min-limit","err-msg":"The withdrawal amount is less than the minimum limit.","data":null)
),
),
'precisionMode' => TICK_SIZE,
Expand All @@ -915,6 +917,9 @@ public function describe() {
),
),
),
'withdraw' => array(
'includeFee' => false,
),
'defaultType' => 'spot', // spot, future, swap
'defaultSubType' => 'linear', // inverse, linear
'defaultNetwork' => 'ERC20',
Expand Down Expand Up @@ -5062,17 +5067,40 @@ public function withdraw($code, $amount, $address, $tag = null, $params = array
$currency = $this->currency($code);
$request = array(
'address' => $address, // only supports existing addresses in your withdraw $address list
'amount' => $amount,
'currency' => strtolower($currency['id']),
);
if ($tag !== null) {
$request['addr-tag'] = $tag; // only for XRP?
}
list($networkCode, $paramsOmited) = $this->handle_network_code_and_params($params);
$networkCode = null;
list($networkCode, $params) = $this->handle_network_code_and_params($params);
if ($networkCode !== null) {
$request['chain'] = $this->network_code_to_id($networkCode, $code);
}
$response = Async\await($this->spotPrivatePostV1DwWithdrawApiCreate (array_merge($request, $paramsOmited)));
$amount = floatval($this->currency_to_precision($code, $amount, $networkCode));
$withdrawOptions = $this->safe_value($this->options, 'withdraw', array());
if ($this->safe_value($withdrawOptions, 'includeFee', false)) {
$fee = $this->safe_number($params, 'fee');
if ($fee === null) {
$currencies = Async\await($this->fetch_currencies());
$this->currencies = $this->deep_extend($this->currencies, $currencies);
$targetNetwork = $this->safe_value($currency['networks'], $networkCode, array());
$fee = $this->safe_number($targetNetwork, 'fee');
if ($fee === null) {
throw new ArgumentsRequired($this->id . ' withdraw() function can not find withdraw $fee for chosen network. You need to re-load markets with "exchange.loadMarkets(true)", or provide the "fee" parameter');
}
}
// $fee needs to be deducted from whole $amount
$feeString = $this->currency_to_precision($code, $fee, $networkCode);
$params = $this->omit($params, 'fee');
$amountString = $this->number_to_string($amount);
$amountSubtractedString = Precise::string_sub($amountString, $feeString);
$amountSubtracted = floatval($amountSubtractedString);
$request['fee'] = floatval($feeString);
$amount = floatval($this->currency_to_precision($code, $amountSubtracted, $networkCode));
}
$request['amount'] = $amount;
$response = Async\await($this->spotPrivatePostV1DwWithdrawApiCreate (array_merge($request, $params)));
//
// {
// "status" => "ok",
Expand Down
34 changes: 31 additions & 3 deletions php/huobi.php

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

6 changes: 3 additions & 3 deletions python/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.4.35/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@2.4.35/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@2.4.36/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@2.4.36/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.4.35/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@2.4.36/dist/ccxt.browser.js"></script>
```

Creates a global `ccxt` object:
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/__init__.py
Expand Up @@ -22,7 +22,7 @@

# ----------------------------------------------------------------------------

__version__ = '2.4.35'
__version__ = '2.4.36'

# ----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async_support/__init__.py
Expand Up @@ -4,7 +4,7 @@

# -----------------------------------------------------------------------------

__version__ = '2.4.35'
__version__ = '2.4.36'

# -----------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async_support/base/exchange.py
Expand Up @@ -2,7 +2,7 @@

# -----------------------------------------------------------------------------

__version__ = '2.4.35'
__version__ = '2.4.36'

# -----------------------------------------------------------------------------

Expand Down

0 comments on commit 84f3c02

Please sign in to comment.