Skip to content

Commit

Permalink
1.10.307
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Travis CI committed Dec 6, 2017
1 parent e8ee6c8 commit 4da6519
Show file tree
Hide file tree
Showing 11 changed files with 209 additions and 9 deletions.
65 changes: 63 additions & 2 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 errors = require ('./js/base/errors')
//-----------------------------------------------------------------------------
// this is updated by vss.js when building

const version = '1.10.306'
const version = '1.10.307'

Exchange.ccxtVersion = version

Expand Down
2 changes: 1 addition & 1 deletion ccxt.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace ccxt;

$version = '1.10.306';
$version = '1.10.307';

const CLASSES_DIR = __DIR__ . DIRECTORY_SEPARATOR . 'php' . DIRECTORY_SEPARATOR;

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.10.306",
"version": "1.10.307",
"description": "A JavaScript / Python / PHP cryptocurrency trading library with support for 90+ exchanges",
"main": "./ccxt.js",
"unpkg": "build/ccxt.browser.js",
Expand Down
49 changes: 49 additions & 0 deletions php/kraken.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,55 @@ public function fetch_closed_orders ($symbol = null, $since = null, $limit = nul
return $this->filter_orders_by_symbol($orders, $symbol);
}

public function fetch_deposit_methods ($code = null, $params = array ()) {
$this->load_markets();
$request = array ();
if ($code) {
$currency = $this->currency ($code);
$request['asset'] = $currency['id'];
}
$response = $this->privatePostDepositMethods (array_merge ($request, $params));
return $response['result'];
}

public function create_deposit_address ($currency, $params = array ()) {
$request = array (
'new' => 'true',
);
$response = $this->fetch_deposit_address ($currency, array_merge ($request, $params));
return array (
'currency' => $currency,
'address' => $response['address'],
'status' => 'ok',
'info' => $response,
);
}

public function fetch_deposit_address ($code, $params = array ()) {
$method = $this->safe_value($params, 'method');
if (!$method)
throw new ExchangeError ($this->id . ' fetchDepositAddress() requires an extra `$method` parameter');
$this->loadMarkets();
$currency = $this->currency ($code);
$request = array (
'asset' => $currency['id'],
'method' => $method,
'new' => 'false',
);
$response = $this->privatePostDepositAddresses (array_merge ($request, $params));
$result = $response['result'];
$numResults = count ($result);
if ($numResults < 1)
throw new ExchangeError ($this->id . ' privatePostDepositAddresses() returned no addresses');
$address = $this->safe_string($result[0], 'address');
return array (
'currency' => $code,
'address' => $address,
'status' => 'ok',
'info' => $response,
);
}

public function withdraw ($currency, $amount, $address, $params = array ()) {
if (array_key_exists ('key', $params)) {
$this->load_markets();
Expand Down
2 changes: 1 addition & 1 deletion python/ccxt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

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

__version__ = '1.10.306'
__version__ = '1.10.307'

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

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.10.306'
__version__ = '1.10.307'

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

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.10.306'
__version__ = '1.10.307'

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

Expand Down
45 changes: 45 additions & 0 deletions python/ccxt/async/kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,51 @@ async def fetch_closed_orders(self, symbol=None, since=None, limit=None, params=
orders = self.parse_orders(response['result']['closed'])
return self.filter_orders_by_symbol(orders, symbol)

async def fetch_deposit_methods(self, code=None, params={}):
await self.load_markets()
request = {}
if code:
currency = self.currency(code)
request['asset'] = currency['id']
response = await self.privatePostDepositMethods(self.extend(request, params))
return response['result']

async def create_deposit_address(self, currency, params={}):
request = {
'new': 'true',
}
response = await self.fetch_deposit_address(currency, self.extend(request, params))
return {
'currency': currency,
'address': response['address'],
'status': 'ok',
'info': response,
}

async def fetch_deposit_address(self, code, params={}):
method = self.safe_value(params, 'method')
if not method:
raise ExchangeError(self.id + ' fetchDepositAddress() requires an extra `method` parameter')
await self.loadMarkets()
currency = self.currency(code)
request = {
'asset': currency['id'],
'method': method,
'new': 'false',
}
response = await self.privatePostDepositAddresses(self.extend(request, params))
result = response['result']
numResults = len(result)
if numResults < 1:
raise ExchangeError(self.id + ' privatePostDepositAddresses() returned no addresses')
address = self.safe_string(result[0], 'address')
return {
'currency': code,
'address': address,
'status': 'ok',
'info': response,
}

async def withdraw(self, currency, amount, address, params={}):
if 'key' in params:
await self.load_markets()
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.10.306'
__version__ = '1.10.307'

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

Expand Down
45 changes: 45 additions & 0 deletions python/ccxt/kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,51 @@ def fetch_closed_orders(self, symbol=None, since=None, limit=None, params={}):
orders = self.parse_orders(response['result']['closed'])
return self.filter_orders_by_symbol(orders, symbol)

def fetch_deposit_methods(self, code=None, params={}):
self.load_markets()
request = {}
if code:
currency = self.currency(code)
request['asset'] = currency['id']
response = self.privatePostDepositMethods(self.extend(request, params))
return response['result']

def create_deposit_address(self, currency, params={}):
request = {
'new': 'true',
}
response = self.fetch_deposit_address(currency, self.extend(request, params))
return {
'currency': currency,
'address': response['address'],
'status': 'ok',
'info': response,
}

def fetch_deposit_address(self, code, params={}):
method = self.safe_value(params, 'method')
if not method:
raise ExchangeError(self.id + ' fetchDepositAddress() requires an extra `method` parameter')
self.loadMarkets()
currency = self.currency(code)
request = {
'asset': currency['id'],
'method': method,
'new': 'false',
}
response = self.privatePostDepositAddresses(self.extend(request, params))
result = response['result']
numResults = len(result)
if numResults < 1:
raise ExchangeError(self.id + ' privatePostDepositAddresses() returned no addresses')
address = self.safe_string(result[0], 'address')
return {
'currency': code,
'address': address,
'status': 'ok',
'info': response,
}

def withdraw(self, currency, amount, address, params={}):
if 'key' in params:
self.load_markets()
Expand Down

0 comments on commit 4da6519

Please sign in to comment.