Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ccxt-dev/ccxt
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Jul 2, 2018
2 parents c68a246 + ab6b32e commit 9ec4307
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 10 deletions.
23 changes: 20 additions & 3 deletions build/ccxt.browser.js

Large diffs are not rendered by default.

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

const version = '1.15.3'
const version = '1.15.4'

Exchange.ccxtVersion = version

Expand Down
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.15.3",
"version": "1.15.4",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 100+ exchanges",
"main": "./ccxt.js",
"unpkg": "build/ccxt.browser.js",
Expand Down
2 changes: 1 addition & 1 deletion php/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace ccxt;

$version = '1.15.3';
$version = '1.15.4';

// rounding mode
const TRUNCATE = 0;
Expand Down
16 changes: 16 additions & 0 deletions php/coinex.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,22 @@ public function describe () {
));
}

public function cost_to_precision ($symbol, $cost) {
return $this->decimal_to_precision($cost, ROUND, $this->markets[$symbol]['precision']['price']);
}

public function price_to_precision ($symbol, $price) {
return $this->decimal_to_precision($price, ROUND, $this->markets[$symbol]['precision']['price']);
}

public function amount_to_precision ($symbol, $amount) {
return $this->decimal_to_precision($amount, TRUNCATE, $this->markets[$symbol]['precision']['amount']);
}

public function fee_to_precision ($currency, $fee) {
return $this->decimal_to_precision($fee, ROUND, $this->currencies[$currency]['precision']);
}

public function fetch_markets () {
$response = $this->webGetResMarket ();
$markets = $response['data']['market_info'];
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.15.3'
__version__ = '1.15.4'

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

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

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

__version__ = '1.15.3'
__version__ = '1.15.4'

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

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

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

__version__ = '1.15.3'
__version__ = '1.15.4'

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

Expand Down
14 changes: 14 additions & 0 deletions python/ccxt/async/coinex.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors import OrderNotFound
from ccxt.base.decimal_to_precision import ROUND
from ccxt.base.decimal_to_precision import TRUNCATE


class coinex (Exchange):
Expand Down Expand Up @@ -117,6 +119,18 @@ def describe(self):
},
})

def cost_to_precision(self, symbol, cost):
return self.decimal_to_precision(cost, ROUND, self.markets[symbol]['precision']['price'])

def price_to_precision(self, symbol, price):
return self.decimal_to_precision(price, ROUND, self.markets[symbol]['precision']['price'])

def amount_to_precision(self, symbol, amount):
return self.decimal_to_precision(amount, TRUNCATE, self.markets[symbol]['precision']['amount'])

def fee_to_precision(self, currency, fee):
return self.decimal_to_precision(fee, ROUND, self.currencies[currency]['precision'])

async def fetch_markets(self):
response = await self.webGetResMarket()
markets = response['data']['market_info']
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.15.3'
__version__ = '1.15.4'

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

Expand Down
14 changes: 14 additions & 0 deletions python/ccxt/coinex.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
from ccxt.base.errors import InsufficientFunds
from ccxt.base.errors import InvalidOrder
from ccxt.base.errors import OrderNotFound
from ccxt.base.decimal_to_precision import ROUND
from ccxt.base.decimal_to_precision import TRUNCATE


class coinex (Exchange):
Expand Down Expand Up @@ -117,6 +119,18 @@ def describe(self):
},
})

def cost_to_precision(self, symbol, cost):
return self.decimal_to_precision(cost, ROUND, self.markets[symbol]['precision']['price'])

def price_to_precision(self, symbol, price):
return self.decimal_to_precision(price, ROUND, self.markets[symbol]['precision']['price'])

def amount_to_precision(self, symbol, amount):
return self.decimal_to_precision(amount, TRUNCATE, self.markets[symbol]['precision']['amount'])

def fee_to_precision(self, currency, fee):
return self.decimal_to_precision(fee, ROUND, self.currencies[currency]['precision'])

def fetch_markets(self):
response = self.webGetResMarket()
markets = response['data']['market_info']
Expand Down

0 comments on commit 9ec4307

Please sign in to comment.