Skip to content

Commit

Permalink
1.57.38
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Oct 3, 2021
1 parent 5d2d881 commit 49bf76b
Show file tree
Hide file tree
Showing 19 changed files with 116 additions and 99 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,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/[email protected].37/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].37/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].38/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].38/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].37/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].38/dist/ccxt.browser.js"></script>
```

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

const version = '1.57.37'
const version = '1.57.38'

Exchange.ccxtVersion = version

Expand Down
37 changes: 20 additions & 17 deletions dist/ccxt.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.57.37'
const version = '1.57.38'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -80247,11 +80247,15 @@ module.exports = class kraken extends Exchange {
'REP': 'REPV1',
},
'options': {
'cacheDepositMethodsOnFetchDepositAddress': true, // will issue up to two calls in fetchDepositAddress
'depositMethods': {},
'delistedMarketsById': {},
// cannot withdraw/deposit these
'inactiveCurrencies': [ 'CAD', 'USD', 'JPY', 'GBP' ],
'networks': {
'ETH': 'Tether USD (ERC20)',
'ERC20': 'Tether USD (ERC20)',
'TRX': 'Tether USD (TRC20)',
'TRC20': 'Tether USD (TRC20)',
},
},
'exceptions': {
'EQuery:Invalid asset pair': BadSymbol, // {"error":["EQuery:Invalid asset pair"]}
Expand Down Expand Up @@ -81715,6 +81719,12 @@ module.exports = class kraken extends Exchange {
const request = {
'new': 'true',
};
if ((code === 'USDT') && ('network' in params)) {
const networks = this.safeValue (this.options, 'networks', {});
const network = this.safeStringUpper (params, 'network');
request['method'] = this.safeString (networks, network, network);
params = this.omit (params, 'network');
}
const response = await this.fetchDepositAddress (code, this.extend (request, params));
const address = this.safeString (response, 'address');
this.checkAddress (address);
Expand All @@ -81728,23 +81738,16 @@ module.exports = class kraken extends Exchange {
async fetchDepositAddress (code, params = {}) {
await this.loadMarkets ();
const currency = this.currency (code);
// eslint-disable-next-line quotes
let method = this.safeString (params, 'method');
if (method === undefined) {
if (this.options['cacheDepositMethodsOnFetchDepositAddress']) {
// cache depositMethods
if (!(code in this.options['depositMethods'])) {
this.options['depositMethods'][code] = await this.fetchDepositMethods (code);
}
method = this.options['depositMethods'][code][0]['method'];
} else {
throw new ArgumentsRequired (this.id + ' fetchDepositAddress() requires an extra `method` parameter. Use fetchDepositMethods ("' + code + '") to get a list of available deposit methods or enable the exchange property .options["cacheDepositMethodsOnFetchDepositAddress"] = true');
}
}
const request = {
'asset': currency['id'],
'method': method,
};
// USDT is the only currency with multiple networks on kraken, you may check
if ((code === 'USDT') && ('network' in params)) {
const networks = this.safeValue (this.options, 'networks', {});
const network = this.safeStringUpper (params, 'network');
request['method'] = this.safeString (networks, network, network);
params = this.omit (params, 'network');
}
const response = await this.privatePostDepositAddresses (this.extend (request, params)); // overwrite methods
const result = response['result'];
const numResults = result.length;
Expand Down
6 changes: 3 additions & 3 deletions doc/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1928,14 +1928,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/[email protected].37/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].37/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].38/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].38/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/[email protected].37/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].38/dist/ccxt.browser.js"></script>

Creates a global ``ccxt`` object:

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.57.37",
"version": "1.57.38",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 130+ exchanges",
"main": "./ccxt.js",
"unpkg": "dist/ccxt.browser.js",
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
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@

include 'Throttle.php';

$version = '1.57.37';
$version = '1.57.38';

class Exchange extends \ccxt\Exchange {

const VERSION = '1.57.37';
const VERSION = '1.57.38';

public static $loop;
public static $kernel;
Expand Down
35 changes: 19 additions & 16 deletions php/async/kraken.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,15 @@ public function describe() {
'REP' => 'REPV1',
),
'options' => array(
'cacheDepositMethodsOnFetchDepositAddress' => true, // will issue up to two calls in fetchDepositAddress
'depositMethods' => array(),
'delistedMarketsById' => array(),
// cannot withdraw/deposit these
'inactiveCurrencies' => array( 'CAD', 'USD', 'JPY', 'GBP' ),
'networks' => array(
'ETH' => 'Tether USD (ERC20)',
'ERC20' => 'Tether USD (ERC20)',
'TRX' => 'Tether USD (TRC20)',
'TRC20' => 'Tether USD (TRC20)',
),
),
'exceptions' => array(
'EQuery:Invalid asset pair' => '\\ccxt\\BadSymbol', // array("error":["EQuery:Invalid asset pair"])
Expand Down Expand Up @@ -1693,6 +1697,12 @@ public function create_deposit_address($code, $params = array ()) {
$request = array(
'new' => 'true',
);
if (($code === 'USDT') && (is_array($params) && array_key_exists('network', $params))) {
$networks = $this->safe_value($this->options, 'networks', array());
$network = $this->safe_string_upper($params, 'network');
$request['method'] = $this->safe_string($networks, $network, $network);
$params = $this->omit($params, 'network');
}
$response = yield $this->fetch_deposit_address($code, array_merge($request, $params));
$address = $this->safe_string($response, 'address');
$this->check_address($address);
Expand All @@ -1706,23 +1716,16 @@ public function create_deposit_address($code, $params = array ()) {
public function fetch_deposit_address($code, $params = array ()) {
yield $this->load_markets();
$currency = $this->currency($code);
// eslint-disable-next-line quotes
$method = $this->safe_string($params, 'method');
if ($method === null) {
if ($this->options['cacheDepositMethodsOnFetchDepositAddress']) {
// cache depositMethods
if (!(is_array($this->options['depositMethods']) && array_key_exists($code, $this->options['depositMethods']))) {
$this->options['depositMethods'][$code] = yield $this->fetch_deposit_methods($code);
}
$method = $this->options['depositMethods'][$code][0]['method'];
} else {
throw new ArgumentsRequired($this->id . ' fetchDepositAddress() requires an extra `$method` parameter. Use fetchDepositMethods ("' . $code . '") to get a list of available deposit methods or enable the exchange property .options["cacheDepositMethodsOnFetchDepositAddress"] = true');
}
}
$request = array(
'asset' => $currency['id'],
'method' => $method,
);
// USDT is the only $currency with multiple $networks on kraken, you may check
if (($code === 'USDT') && (is_array($params) && array_key_exists('network', $params))) {
$networks = $this->safe_value($this->options, 'networks', array());
$network = $this->safe_string_upper($params, 'network');
$request['method'] = $this->safe_string($networks, $network, $network);
$params = $this->omit($params, 'network');
}
$response = yield $this->privatePostDepositAddresses (array_merge($request, $params)); // overwrite methods
$result = $response['result'];
$numResults = is_array($result) ? count($result) : 0;
Expand Down
35 changes: 19 additions & 16 deletions php/kraken.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
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,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/[email protected].37/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].37/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].38/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].38/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].37/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].38/dist/ccxt.browser.js"></script>
```

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

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

__version__ = '1.57.37'
__version__ = '1.57.38'

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

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async_support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

__version__ = '1.57.37'
__version__ = '1.57.38'

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

Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/async_support/base/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

__version__ = '1.57.37'
__version__ = '1.57.38'

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

Expand Down
30 changes: 17 additions & 13 deletions python/ccxt/async_support/kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,11 +240,15 @@ def describe(self):
'REP': 'REPV1',
},
'options': {
'cacheDepositMethodsOnFetchDepositAddress': True, # will issue up to two calls in fetchDepositAddress
'depositMethods': {},
'delistedMarketsById': {},
# cannot withdraw/deposit these
'inactiveCurrencies': ['CAD', 'USD', 'JPY', 'GBP'],
'networks': {
'ETH': 'Tether USD(ERC20)',
'ERC20': 'Tether USD(ERC20)',
'TRX': 'Tether USD(TRC20)',
'TRC20': 'Tether USD(TRC20)',
},
},
'exceptions': {
'EQuery:Invalid asset pair': BadSymbol, # {"error":["EQuery:Invalid asset pair"]}
Expand Down Expand Up @@ -1581,6 +1585,11 @@ async def create_deposit_address(self, code, params={}):
request = {
'new': 'true',
}
if (code == 'USDT') and ('network' in params):
networks = self.safe_value(self.options, 'networks', {})
network = self.safe_string_upper(params, 'network')
request['method'] = self.safe_string(networks, network, network)
params = self.omit(params, 'network')
response = await self.fetch_deposit_address(code, self.extend(request, params))
address = self.safe_string(response, 'address')
self.check_address(address)
Expand All @@ -1593,20 +1602,15 @@ async def create_deposit_address(self, code, params={}):
async def fetch_deposit_address(self, code, params={}):
await self.load_markets()
currency = self.currency(code)
# eslint-disable-next-line quotes
method = self.safe_string(params, 'method')
if method is None:
if self.options['cacheDepositMethodsOnFetchDepositAddress']:
# cache depositMethods
if not (code in self.options['depositMethods']):
self.options['depositMethods'][code] = await self.fetch_deposit_methods(code)
method = self.options['depositMethods'][code][0]['method']
else:
raise ArgumentsRequired(self.id + ' fetchDepositAddress() requires an extra `method` parameter. Use fetchDepositMethods("' + code + '") to get a list of available deposit methods or enable the exchange property .options["cacheDepositMethodsOnFetchDepositAddress"] = True')
request = {
'asset': currency['id'],
'method': method,
}
# USDT is the only currency with multiple networks on kraken, you may check
if (code == 'USDT') and ('network' in params):
networks = self.safe_value(self.options, 'networks', {})
network = self.safe_string_upper(params, 'network')
request['method'] = self.safe_string(networks, network, network)
params = self.omit(params, 'network')
response = await self.privatePostDepositAddresses(self.extend(request, params)) # overwrite methods
result = response['result']
numResults = len(result)
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/base/exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

__version__ = '1.57.37'
__version__ = '1.57.38'

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

Expand Down
Loading

0 comments on commit 49bf76b

Please sign in to comment.