diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-02-19 14:04:13 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-02-19 14:04:13 +0100 |
commit | 9f1408a3c5d6f42ae709ca16fa27e01db192fd05 (patch) | |
tree | 32363ac6b78692e092d1605f9ac0a1057b5c4fc6 | |
parent | 97922ff1826cc6b9c0329cc30e8d4621bb2644ee (diff) | |
download | Trader-9f1408a3c5d6f42ae709ca16fa27e01db192fd05.tar.gz Trader-9f1408a3c5d6f42ae709ca16fa27e01db192fd05.tar.zst Trader-9f1408a3c5d6f42ae709ca16fa27e01db192fd05.zip |
Make nonce in nanoseconds
-rw-r--r-- | ccxt_wrapper.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ccxt_wrapper.py b/ccxt_wrapper.py index 4ed2116..b79cd37 100644 --- a/ccxt_wrapper.py +++ b/ccxt_wrapper.py | |||
@@ -1,11 +1,19 @@ | |||
1 | from ccxt import * | 1 | from ccxt import * |
2 | import decimal | 2 | import decimal |
3 | import time | ||
3 | 4 | ||
4 | def _cw_exchange_sum(self, *args): | 5 | def _cw_exchange_sum(self, *args): |
5 | return sum([arg for arg in args if isinstance(arg, (float, int, decimal.Decimal))]) | 6 | return sum([arg for arg in args if isinstance(arg, (float, int, decimal.Decimal))]) |
6 | Exchange.sum = _cw_exchange_sum | 7 | Exchange.sum = _cw_exchange_sum |
7 | 8 | ||
8 | class poloniexE(poloniex): | 9 | class poloniexE(poloniex): |
10 | @staticmethod | ||
11 | def nanoseconds(): | ||
12 | return int(time.time() * 1000000000) | ||
13 | |||
14 | def nonce(self): | ||
15 | return self.nanoseconds() | ||
16 | |||
9 | def fetch_balance(self, params={}): | 17 | def fetch_balance(self, params={}): |
10 | self.load_markets() | 18 | self.load_markets() |
11 | balances = self.privatePostReturnCompleteBalances(self.extend({ | 19 | balances = self.privatePostReturnCompleteBalances(self.extend({ |