Skip to content

Commit

Permalink
1.36.73
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Oct 21, 2020
1 parent cf1ed9b commit 0092f35
Show file tree
Hide file tree
Showing 16 changed files with 130 additions and 63 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -225,13 +225,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@1.36.72/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@1.36.72/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.36.73/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@1.36.73/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@1.36.72/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.36.73/dist/ccxt.browser.js"></script>
```

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

const version = '1.36.72'
const version = '1.36.73'

Exchange.ccxtVersion = version

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

const version = '1.36.72'
const version = '1.36.73'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -74733,7 +74733,7 @@ module.exports = class ice3x extends Exchange {

const Exchange = require ('./base/Exchange');
const { PAD_WITH_ZERO } = require ('./base/functions/number');
const { InvalidOrder, InsufficientFunds, ExchangeError, ExchangeNotAvailable, DDoSProtection, BadRequest, NotSupported } = require ('./base/errors');
const { InvalidOrder, InsufficientFunds, ExchangeError, ExchangeNotAvailable, DDoSProtection, BadRequest, NotSupported, InvalidAddress, AuthenticationError } = require ('./base/errors');

// ---------------------------------------------------------------------------

Expand Down Expand Up @@ -74831,14 +74831,15 @@ module.exports = class idex extends Exchange {
'options': {
'defaultTimeInForce': 'gtc',
'defaultSelfTradePrevention': 'cn',
'associatedWallets': {},
},
'exceptions': {
'INVALID_ORDER_QUANTITY': InvalidOrder,
'INSUFFICIENT_FUNDS': InsufficientFunds,
'SERVICE_UNAVAILABLE': ExchangeNotAvailable,
'EXCEEDED_RATE_LIMIT': DDoSProtection,
'INVALID_PARAMETER': BadRequest,
'WALLET_NOT_ASSOCIATED': InvalidAddress,
'INVALID_WALLET_SIGNATURE': AuthenticationError,
},
'requiredCredentials': {
'walletAddress': true,
Expand Down Expand Up @@ -75274,7 +75275,6 @@ module.exports = class idex extends Exchange {

async fetchBalance (params = {}) {
await this.loadMarkets ();
await this.associateWallet (this.walletAddress);
const nonce1 = this.uuidv1 ();
const request = {
'nonce': nonce1,
Expand All @@ -75289,7 +75289,19 @@ module.exports = class idex extends Exchange {
// usdValue: null
// }, ...
// ]
const response = await this.privateGetBalances (this.extend (request, params));
const extendedRequest = this.extend (request, params);
let response = undefined;
try {
response = await this.privateGetBalances (extendedRequest);
} catch (e) {
if (e instanceof InvalidAddress) {
const walletAddress = extendedRequest['wallet'];
await this.associateWallet (walletAddress);
response = await this.privateGetBalances (extendedRequest);
} else {
throw e;
}
}
const result = {
'info': response,
};
Expand All @@ -75311,7 +75323,6 @@ module.exports = class idex extends Exchange {

async fetchMyTrades (symbol = undefined, since = undefined, limit = undefined, params = {}) {
await this.loadMarkets ();
await this.associateWallet (this.walletAddress);
let market = undefined;
const request = {
'nonce': this.uuidv1 (),
Expand Down Expand Up @@ -75347,7 +75358,19 @@ module.exports = class idex extends Exchange {
// txStatus: 'mined'
// }
// ]
const response = await this.privateGetFills (this.extend (request, params));
const extendedRequest = this.extend (request, params);
let response = undefined;
try {
response = await this.privateGetFills (extendedRequest);
} catch (e) {
if (e instanceof InvalidAddress) {
const walletAddress = extendedRequest['wallet'];
await this.associateWallet (walletAddress);
response = await this.privateGetFills (extendedRequest);
} else {
throw e;
}
}
return this.parseTrades (response, market, since, limit);
}

Expand Down Expand Up @@ -75557,10 +75580,6 @@ module.exports = class idex extends Exchange {
}

async associateWallet (walletAddress, params = {}) {
const alreadyAssociated = this.safeValue (this.options, 'associatedWallets', {});
if (walletAddress in alreadyAssociated) {
return;
}
const nonce = this.uuidv1 ();
const noPrefix = this.remove0xPrefix (walletAddress);
const byteArray = [
Expand All @@ -75583,8 +75602,6 @@ module.exports = class idex extends Exchange {
'signature': signature,
};
const result = await this.privatePostWallets (request);
alreadyAssociated[walletAddress] = true;
this.options['alreadyAssociated'] = alreadyAssociated;
return result;
}

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
@@ -1,6 +1,6 @@
{
"name": "ccxt",
"version": "1.36.72",
"version": "1.36.73",
"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/base/Exchange.php
Expand Up @@ -36,7 +36,7 @@
use Elliptic\EdDSA;
use BN\BN;

$version = '1.36.72';
$version = '1.36.73';

// rounding mode
const TRUNCATE = 0;
Expand All @@ -55,7 +55,7 @@

class Exchange {

const VERSION = '1.36.72';
const VERSION = '1.36.73';

private static $base58_alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
private static $base58_encoder = null;
Expand Down
40 changes: 29 additions & 11 deletions php/idex.php
Expand Up @@ -8,6 +8,7 @@
use Exception; // a common import
use \ccxt\ExchangeError;
use \ccxt\BadRequest;
use \ccxt\InvalidAddress;
use \ccxt\NotSupported;

class idex extends Exchange {
Expand Down Expand Up @@ -105,14 +106,15 @@ public function describe() {
'options' => array(
'defaultTimeInForce' => 'gtc',
'defaultSelfTradePrevention' => 'cn',
'associatedWallets' => array(),
),
'exceptions' => array(
'INVALID_ORDER_QUANTITY' => '\\ccxt\\InvalidOrder',
'INSUFFICIENT_FUNDS' => '\\ccxt\\InsufficientFunds',
'SERVICE_UNAVAILABLE' => '\\ccxt\\ExchangeNotAvailable',
'EXCEEDED_RATE_LIMIT' => '\\ccxt\\DDoSProtection',
'INVALID_PARAMETER' => '\\ccxt\\BadRequest',
'WALLET_NOT_ASSOCIATED' => '\\ccxt\\InvalidAddress',
'INVALID_WALLET_SIGNATURE' => '\\ccxt\\AuthenticationError',
),
'requiredCredentials' => array(
'walletAddress' => true,
Expand Down Expand Up @@ -548,7 +550,6 @@ public function fetch_currencies($params = array ()) {

public function fetch_balance($params = array ()) {
$this->load_markets();
$this->associate_wallet($this->walletAddress);
$nonce1 = $this->uuidv1();
$request = array(
'nonce' => $nonce1,
Expand All @@ -563,7 +564,19 @@ public function fetch_balance($params = array ()) {
// usdValue => null
// ), ...
// )
$response = $this->privateGetBalances (array_merge($request, $params));
$extendedRequest = array_merge($request, $params);
$response = null;
try {
$response = $this->privateGetBalances ($extendedRequest);
} catch (Exception $e) {
if ($e instanceof InvalidAddress) {
$walletAddress = $extendedRequest['wallet'];
$this->associate_wallet($walletAddress);
$response = $this->privateGetBalances ($extendedRequest);
} else {
throw $e;
}
}
$result = array(
'info' => $response,
);
Expand All @@ -585,7 +598,6 @@ public function fetch_balance($params = array ()) {

public function fetch_my_trades($symbol = null, $since = null, $limit = null, $params = array ()) {
$this->load_markets();
$this->associate_wallet($this->walletAddress);
$market = null;
$request = array(
'nonce' => $this->uuidv1(),
Expand Down Expand Up @@ -621,7 +633,19 @@ public function fetch_my_trades($symbol = null, $since = null, $limit = null, $p
// txStatus => 'mined'
// }
// )
$response = $this->privateGetFills (array_merge($request, $params));
$extendedRequest = array_merge($request, $params);
$response = null;
try {
$response = $this->privateGetFills ($extendedRequest);
} catch (Exception $e) {
if ($e instanceof InvalidAddress) {
$walletAddress = $extendedRequest['wallet'];
$this->associate_wallet($walletAddress);
$response = $this->privateGetFills ($extendedRequest);
} else {
throw $e;
}
}
return $this->parse_trades($response, $market, $since, $limit);
}

Expand Down Expand Up @@ -831,10 +855,6 @@ public function parse_order($order, $market = null) {
}

public function associate_wallet($walletAddress, $params = array ()) {
$alreadyAssociated = $this->safe_value($this->options, 'associatedWallets', array());
if (is_array($alreadyAssociated) && array_key_exists($walletAddress, $alreadyAssociated)) {
return;
}
$nonce = $this->uuidv1();
$noPrefix = $this->remove0x_prefix($walletAddress);
$byteArray = array(
Expand All @@ -857,8 +877,6 @@ public function associate_wallet($walletAddress, $params = array ()) {
'signature' => $signature,
);
$result = $this->privatePostWallets ($request);
$alreadyAssociated[$walletAddress] = true;
$this->options['alreadyAssociated'] = $alreadyAssociated;
return $result;
}

Expand Down
6 changes: 3 additions & 3 deletions python/README.md
Expand Up @@ -225,13 +225,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@1.36.72/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@1.36.72/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/ccxt@1.36.73/dist/ccxt.browser.js
* unpkg: https://unpkg.com/ccxt@1.36.73/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@1.36.72/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/ccxt@1.36.73/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__ = '1.36.72'
__version__ = '1.36.73'

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

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

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

__version__ = '1.36.72'
__version__ = '1.36.73'

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

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

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

__version__ = '1.36.72'
__version__ = '1.36.73'

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

Expand Down

0 comments on commit 0092f35

Please sign in to comment.