Skip to content

Commit

Permalink
1.38.71
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Dec 2, 2020
1 parent 3c539b8 commit d97f4f1
Show file tree
Hide file tree
Showing 19 changed files with 264 additions and 47 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ The CCXT library currently supports the following 123 cryptocurrency exchange ma
| [![crex24](https://user-images.githubusercontent.com/1294454/47813922-6f12cc00-dd5d-11e8-97c6-70f957712d47.jpg)](https://crex24.com/?refid=slxsjsjtil8xexl9hksr) | crex24 | [CREX24](https://crex24.com/?refid=slxsjsjtil8xexl9hksr) | 2 | [API](https://docs.crex24.com/trade-api/v2) | | |
| [![currencycom](https://user-images.githubusercontent.com/1294454/83718672-36745c00-a63e-11ea-81a9-677b1f789a4d.jpg)](https://currency.com/trading/signup?c=362jaimv&pid=referral) | currencycom | [Currency.com](https://currency.com/trading/signup?c=362jaimv&pid=referral) | 1 | [API](https://currency.com/api) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | [![CCXT Pro](https://img.shields.io/badge/CCXT-Pro-black)](https://ccxt.pro) |
| [![deribit](https://user-images.githubusercontent.com/1294454/41933112-9e2dd65a-798b-11e8-8440-5bab2959fcb8.jpg)](https://www.deribit.com/reg-1189.4038) | deribit | [Deribit](https://www.deribit.com/reg-1189.4038) | 2 | [API](https://docs.deribit.com/v2) | | |
| [![digifinex](https://user-images.githubusercontent.com/51840849/87443315-01283a00-c5fe-11ea-8628-c2a0feaf07ac.jpg)](https://www.digifinex.com/en-ww/from/DhOzBg/3798****5114) | digifinex | [DigiFinex](https://www.digifinex.com/en-ww/from/DhOzBg/3798****5114) | 3 | [API](https://docs.digifinex.com) | | |
| [![digifinex](https://user-images.githubusercontent.com/51840849/87443315-01283a00-c5fe-11ea-8628-c2a0feaf07ac.jpg)](https://www.digifinex.com/en-ww/from/DhOzBg?channelCode=ljaUPp) | digifinex | [DigiFinex](https://www.digifinex.com/en-ww/from/DhOzBg?channelCode=ljaUPp) | 3 | [API](https://docs.digifinex.com) | | |
| [![dsx](https://user-images.githubusercontent.com/51840849/76909626-cb2bb100-68bc-11ea-99e0-28ba54f04792.jpg)](https://dsxglobal.com) | dsx | [DSX](https://dsxglobal.com) | 3 | [API](https://dsxglobal.com/developers/publicApi) | | |
| [![eterbase](https://user-images.githubusercontent.com/1294454/82067900-faeb0f80-96d9-11ea-9f22-0071cfcb9871.jpg)](https://eterbase.exchange/invite/1wjjh4Pe) | eterbase | [Eterbase](https://eterbase.exchange/invite/1wjjh4Pe) | 1 | [API](https://developers.eterbase.exchange) | [![CCXT Certified](https://img.shields.io/badge/CCXT-Certified-green.svg)](https://github.com/ccxt/ccxt/wiki/Certification) | |
| [![exmo](https://user-images.githubusercontent.com/1294454/27766491-1b0ea956-5eda-11e7-9225-40d67b481b8d.jpg)](https://exmo.me/?ref=131685) | exmo | [EXMO](https://exmo.me/?ref=131685) | 1.1 | [API](https://exmo.me/en/api_doc?ref=131685) | | |
Expand Down Expand Up @@ -224,13 +224,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].70/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].70/dist/ccxt.browser.js
* jsDelivr: https://cdn.jsdelivr.net/npm/[email protected].71/dist/ccxt.browser.js
* unpkg: https://unpkg.com/[email protected].71/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].70/dist/ccxt.browser.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/[email protected].71/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 @@ -35,7 +35,7 @@ const Exchange = require ('./js/base/Exchange')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.38.70'
const version = '1.38.71'

Exchange.ccxtVersion = version

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

const version = '1.38.70'
const version = '1.38.71'

Exchange.ccxtVersion = version

Expand Down Expand Up @@ -58117,6 +58117,7 @@ module.exports = class digifinex extends Exchange {
'createOrder': true,
'fetchBalance': true,
'fetchCurrencies': true,
'fetchDepositAddress': true,
'fetchLedger': true,
'fetchMarkets': true,
'fetchMyTrades': true,
Expand Down Expand Up @@ -58150,7 +58151,7 @@ module.exports = class digifinex extends Exchange {
'https://docs.digifinex.com',
],
'fees': 'https://digifinex.zendesk.com/hc/en-us/articles/360000328422-Fee-Structure-on-DigiFinex',
'referral': 'https://www.digifinex.com/en-ww/from/DhOzBg/3798****5114',
'referral': 'https://www.digifinex.com/en-ww/from/DhOzBg?channelCode=ljaUPp',
},
'api': {
'v2': {
Expand Down Expand Up @@ -59354,6 +59355,66 @@ module.exports = class digifinex extends Exchange {
return this.parseLedger (items, currency, since, limit);
}

parseDepositAddresses (addresses) {
const result = {};
for (let i = 0; i < addresses.length; i++) {
const address = this.parseDepositAddress (addresses[i]);
const code = address['currency'];
result[code] = address;
}
return result;
}

parseDepositAddress (depositAddress, currency = undefined) {
//
// {
// "addressTag":"",
// "address":"0xf1104d9f8624f89775a3e9d480fc0e75a8ef4373",
// "currency":"USDT",
// "chain":"ERC20"
// }
//
const address = this.safeString (depositAddress, 'address');
const tag = this.safeString (depositAddress, 'addressTag');
const currencyId = this.safeString (depositAddress, 'currency');
const code = this.safeCurrencCode (currencyId);
return {
'info': depositAddress,
'code': code,
'address': address,
'tag': tag,
};
}

async fetchDepositAddress (code, params = {}) {
await this.loadMarkets ();
const currency = this.currency (code);
const request = {
'currency': currency['id'],
};
const response = await this.privateGetDepositAddress (this.extend (request, params));
//
// {
// "data":[
// {
// "addressTag":"",
// "address":"0xf1104d9f8624f89775a3e9d480fc0e75a8ef4373",
// "currency":"USDT",
// "chain":"ERC20"
// }
// ],
// "code":200
// }
//
const data = this.safeValue (response, 'data', []);
const addresses = this.parseDepositAddresses (data);
const address = this.safeValue (addresses, code);
if (address === undefined) {
throw new InvalidAddress (this.id + ' fetchDepositAddress did not return an address for ' + code + ' - create the deposit address in the user settings on the exchange website first.');
}
return address;
}

sign (path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
const version = (api === 'v2') ? api : this.version;
let url = this.urls['api'] + '/' + version + '/' + this.implodeParams (path, params);
Expand Down Expand Up @@ -59389,11 +59450,6 @@ module.exports = class digifinex extends Exchange {
return { 'url': url, 'method': method, 'body': body, 'headers': headers };
}

dateUTC8 (timestampMS) {
const timedelta = this.safeValue (this.options, 'timedelta', 8 * 60 * 60 * 1000); // eight hours
return this.ymd (timestampMS + timedelta);
}

handleErrors (statusCode, statusText, url, method, responseHeaders, responseBody, response, requestHeaders, requestBody) {
if (!response) {
return; // fall back to default error handler
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.38.70",
"version": "1.38.71",
"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
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
use Elliptic\EdDSA;
use BN\BN;

$version = '1.38.70';
$version = '1.38.71';

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

class Exchange {

const VERSION = '1.38.70';
const VERSION = '1.38.71';

private static $base58_alphabet = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
private static $base58_encoder = null;
Expand Down
69 changes: 63 additions & 6 deletions php/digifinex.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Exception; // a common import
use \ccxt\ArgumentsRequired;
use \ccxt\BadResponse;
use \ccxt\InvalidAddress;
use \ccxt\OrderNotFound;

class digifinex extends Exchange {
Expand All @@ -25,6 +26,7 @@ public function describe() {
'createOrder' => true,
'fetchBalance' => true,
'fetchCurrencies' => true,
'fetchDepositAddress' => true,
'fetchLedger' => true,
'fetchMarkets' => true,
'fetchMyTrades' => true,
Expand Down Expand Up @@ -58,7 +60,7 @@ public function describe() {
'https://docs.digifinex.com',
),
'fees' => 'https://digifinex.zendesk.com/hc/en-us/articles/360000328422-Fee-Structure-on-DigiFinex',
'referral' => 'https://www.digifinex.com/en-ww/from/DhOzBg/3798****5114',
'referral' => 'https://www.digifinex.com/en-ww/from/DhOzBg?channelCode=ljaUPp',
),
'api' => array(
'v2' => array(
Expand Down Expand Up @@ -1262,6 +1264,66 @@ public function fetch_ledger($code = null, $since = null, $limit = null, $params
return $this->parse_ledger($items, $currency, $since, $limit);
}

public function parse_deposit_addresses($addresses) {
$result = array();
for ($i = 0; $i < count($addresses); $i++) {
$address = $this->parse_deposit_address($addresses[$i]);
$code = $address['currency'];
$result[$code] = $address;
}
return $result;
}

public function parse_deposit_address($depositAddress, $currency = null) {
//
// {
// "addressTag":"",
// "$address":"0xf1104d9f8624f89775a3e9d480fc0e75a8ef4373",
// "$currency":"USDT",
// "chain":"ERC20"
// }
//
$address = $this->safe_string($depositAddress, 'address');
$tag = $this->safe_string($depositAddress, 'addressTag');
$currencyId = $this->safe_string($depositAddress, 'currency');
$code = $this->safeCurrencCode ($currencyId);
return array(
'info' => $depositAddress,
'code' => $code,
'address' => $address,
'tag' => $tag,
);
}

public function fetch_deposit_address($code, $params = array ()) {
$this->load_markets();
$currency = $this->currency($code);
$request = array(
'currency' => $currency['id'],
);
$response = $this->privateGetDepositAddress (array_merge($request, $params));
//
// {
// "$data":array(
// {
// "addressTag":"",
// "$address":"0xf1104d9f8624f89775a3e9d480fc0e75a8ef4373",
// "$currency":"USDT",
// "chain":"ERC20"
// }
// ),
// "$code":200
// }
//
$data = $this->safe_value($response, 'data', array());
$addresses = $this->parse_deposit_addresses($data);
$address = $this->safe_value($addresses, $code);
if ($address === null) {
throw new InvalidAddress($this->id . ' fetchDepositAddress did not return an $address for ' . $code . ' - create the deposit $address in the user settings on the exchange website first.');
}
return $address;
}

public function sign($path, $api = 'public', $method = 'GET', $params = array (), $headers = null, $body = null) {
$version = ($api === 'v2') ? $api : $this->version;
$url = $this->urls['api'] . '/' . $version . '/' . $this->implode_params($path, $params);
Expand Down Expand Up @@ -1297,11 +1359,6 @@ public function sign($path, $api = 'public', $method = 'GET', $params = array ()
return array( 'url' => $url, 'method' => $method, 'body' => $body, 'headers' => $headers );
}

public function date_utc8($timestampMS) {
$timedelta = $this->safe_value($this->options, 'timedelta', 8 * 60 * 60 * 1000); // eight hours
return $this->ymd($timestampMS . $timedelta);
}

public function handle_errors($statusCode, $statusText, $url, $method, $responseHeaders, $responseBody, $response, $requestHeaders, $requestBody) {
if (!$response) {
return; // fall back to default error handler
Expand Down
Loading

0 comments on commit d97f4f1

Please sign in to comment.