ccxt 4.2.47__py2.py3-none-any.whl → 4.2.49__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ccxt/__init__.py +1 -1
- ccxt/abstract/bitstamp.py +8 -0
- ccxt/abstract/indodax.py +9 -8
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +9 -4
- ccxt/async_support/bitmart.py +24 -2
- ccxt/async_support/bitstamp.py +8 -0
- ccxt/async_support/btcalpha.py +4 -0
- ccxt/async_support/btcmarkets.py +4 -0
- ccxt/async_support/btcturk.py +4 -0
- ccxt/async_support/bybit.py +132 -6
- ccxt/async_support/idex.py +48 -1
- ccxt/async_support/independentreserve.py +47 -1
- ccxt/async_support/indodax.py +115 -19
- ccxt/async_support/latoken.py +16 -0
- ccxt/async_support/luno.py +18 -0
- ccxt/async_support/lykke.py +19 -0
- ccxt/async_support/ndax.py +18 -0
- ccxt/async_support/okx.py +32 -5
- ccxt/async_support/upbit.py +92 -17
- ccxt/base/exchange.py +2 -2
- ccxt/binance.py +9 -4
- ccxt/bitmart.py +24 -2
- ccxt/bitstamp.py +8 -0
- ccxt/btcalpha.py +4 -0
- ccxt/btcmarkets.py +4 -0
- ccxt/btcturk.py +4 -0
- ccxt/bybit.py +132 -6
- ccxt/idex.py +48 -1
- ccxt/independentreserve.py +47 -1
- ccxt/indodax.py +115 -19
- ccxt/latoken.py +16 -0
- ccxt/luno.py +18 -0
- ccxt/lykke.py +19 -0
- ccxt/ndax.py +18 -0
- ccxt/okx.py +32 -5
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/ascendex.py +19 -7
- ccxt/pro/bitget.py +24 -7
- ccxt/pro/bitstamp.py +1 -1
- ccxt/pro/hitbtc.py +6 -11
- ccxt/pro/mexc.py +2 -1
- ccxt/test/test_async.py +10 -10
- ccxt/test/test_sync.py +10 -10
- ccxt/upbit.py +92 -17
- {ccxt-4.2.47.dist-info → ccxt-4.2.49.dist-info}/METADATA +4 -4
- {ccxt-4.2.47.dist-info → ccxt-4.2.49.dist-info}/RECORD +50 -50
- {ccxt-4.2.47.dist-info → ccxt-4.2.49.dist-info}/WHEEL +0 -0
- {ccxt-4.2.47.dist-info → ccxt-4.2.49.dist-info}/top_level.txt +0 -0
ccxt/idex.py
CHANGED
@@ -92,8 +92,10 @@ class idex(Exchange, ImplicitAPI):
|
|
92
92
|
'fetchPositions': False,
|
93
93
|
'fetchPositionsRisk': False,
|
94
94
|
'fetchPremiumIndexOHLCV': False,
|
95
|
+
'fetchStatus': True,
|
95
96
|
'fetchTicker': True,
|
96
97
|
'fetchTickers': True,
|
98
|
+
'fetchTime': True,
|
97
99
|
'fetchTrades': True,
|
98
100
|
'fetchTradingFee': False,
|
99
101
|
'fetchTradingFees': True,
|
@@ -205,6 +207,7 @@ class idex(Exchange, ImplicitAPI):
|
|
205
207
|
def fetch_markets(self, params={}):
|
206
208
|
"""
|
207
209
|
retrieves data on all markets for idex
|
210
|
+
:see: https://api-docs-v3.idex.io/#get-markets
|
208
211
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
209
212
|
:returns dict[]: an array of objects representing market data
|
210
213
|
"""
|
@@ -331,6 +334,7 @@ class idex(Exchange, ImplicitAPI):
|
|
331
334
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
332
335
|
"""
|
333
336
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
337
|
+
:see: https://api-docs-v3.idex.io/#get-tickers
|
334
338
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
335
339
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
336
340
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -365,6 +369,7 @@ class idex(Exchange, ImplicitAPI):
|
|
365
369
|
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
366
370
|
"""
|
367
371
|
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
372
|
+
:see: https://api-docs-v3.idex.io/#get-tickers
|
368
373
|
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
369
374
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
370
375
|
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -439,6 +444,7 @@ class idex(Exchange, ImplicitAPI):
|
|
439
444
|
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
440
445
|
"""
|
441
446
|
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
447
|
+
:see: https://api-docs-v3.idex.io/#get-candles
|
442
448
|
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
443
449
|
:param str timeframe: the length of time each candle represents
|
444
450
|
:param int [since]: timestamp in ms of the earliest candle to fetch
|
@@ -495,6 +501,7 @@ class idex(Exchange, ImplicitAPI):
|
|
495
501
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
496
502
|
"""
|
497
503
|
get the list of most recent trades for a particular symbol
|
504
|
+
:see: https://api-docs-v3.idex.io/#get-trades
|
498
505
|
:param str symbol: unified symbol of the market to fetch trades for
|
499
506
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
500
507
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -603,6 +610,7 @@ class idex(Exchange, ImplicitAPI):
|
|
603
610
|
def fetch_trading_fees(self, params={}):
|
604
611
|
"""
|
605
612
|
fetch the trading fees for multiple markets
|
613
|
+
:see: https://api-docs-v3.idex.io/#get-api-account
|
606
614
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
607
615
|
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
|
608
616
|
"""
|
@@ -645,6 +653,7 @@ class idex(Exchange, ImplicitAPI):
|
|
645
653
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
646
654
|
"""
|
647
655
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
656
|
+
:see: https://api-docs-v3.idex.io/#get-order-books
|
648
657
|
:param str symbol: unified symbol of the market to fetch the order book for
|
649
658
|
:param int [limit]: the maximum amount of order book entries to return
|
650
659
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -704,6 +713,7 @@ class idex(Exchange, ImplicitAPI):
|
|
704
713
|
def fetch_currencies(self, params={}):
|
705
714
|
"""
|
706
715
|
fetches all available currencies on an exchange
|
716
|
+
:see: https://api-docs-v3.idex.io/#get-assets
|
707
717
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
708
718
|
:returns dict: an associative dictionary of currencies
|
709
719
|
"""
|
@@ -765,6 +775,7 @@ class idex(Exchange, ImplicitAPI):
|
|
765
775
|
def fetch_balance(self, params={}) -> Balances:
|
766
776
|
"""
|
767
777
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
778
|
+
:see: https://api-docs-v3.idex.io/#get-balances
|
768
779
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
769
780
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
770
781
|
"""
|
@@ -802,6 +813,7 @@ class idex(Exchange, ImplicitAPI):
|
|
802
813
|
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
803
814
|
"""
|
804
815
|
fetch all trades made by the user
|
816
|
+
:see: https://api-docs-v3.idex.io/#get-fills
|
805
817
|
:param str symbol: unified market symbol
|
806
818
|
:param int [since]: the earliest time in ms to fetch trades for
|
807
819
|
:param int [limit]: the maximum number of trades structures to retrieve
|
@@ -860,6 +872,7 @@ class idex(Exchange, ImplicitAPI):
|
|
860
872
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
861
873
|
"""
|
862
874
|
fetches information on an order made by the user
|
875
|
+
:see: https://api-docs-v3.idex.io/#get-orders
|
863
876
|
:param str symbol: unified symbol of the market the order was made in
|
864
877
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
865
878
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -872,6 +885,7 @@ class idex(Exchange, ImplicitAPI):
|
|
872
885
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
873
886
|
"""
|
874
887
|
fetch all unfilled currently open orders
|
888
|
+
:see: https://api-docs-v3.idex.io/#get-orders
|
875
889
|
:param str symbol: unified market symbol
|
876
890
|
:param int [since]: the earliest time in ms to fetch open orders for
|
877
891
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -886,6 +900,7 @@ class idex(Exchange, ImplicitAPI):
|
|
886
900
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
887
901
|
"""
|
888
902
|
fetches information on multiple closed orders made by the user
|
903
|
+
:see: https://api-docs-v3.idex.io/#get-orders
|
889
904
|
:param str symbol: unified market symbol of the market orders were made in
|
890
905
|
:param int [since]: the earliest time in ms to fetch orders for
|
891
906
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -1090,16 +1105,20 @@ class idex(Exchange, ImplicitAPI):
|
|
1090
1105
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
1091
1106
|
"""
|
1092
1107
|
create a trade order, https://docs.idex.io/#create-order
|
1108
|
+
:see: https://api-docs-v3.idex.io/#create-order
|
1093
1109
|
:param str symbol: unified symbol of the market to create an order in
|
1094
1110
|
:param str type: 'market' or 'limit'
|
1095
1111
|
:param str side: 'buy' or 'sell'
|
1096
1112
|
:param float amount: how much of currency you want to trade in units of base currency
|
1097
1113
|
:param float [price]: the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
1098
1114
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1115
|
+
:param bool [params.test]: set to True to test an order, no order will be created but the request will be validated
|
1099
1116
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1100
1117
|
"""
|
1101
1118
|
self.check_required_credentials()
|
1102
1119
|
self.load_markets()
|
1120
|
+
testOrder = self.safe_bool(params, 'test', False)
|
1121
|
+
params = self.omit(params, 'test')
|
1103
1122
|
market = self.market(symbol)
|
1104
1123
|
nonce = self.uuidv1()
|
1105
1124
|
typeEnum = None
|
@@ -1259,12 +1278,17 @@ class idex(Exchange, ImplicitAPI):
|
|
1259
1278
|
# "avgExecutionPrice": "0.09905990"
|
1260
1279
|
# }
|
1261
1280
|
# we don't use self.extend here because it is a signed endpoint
|
1262
|
-
response =
|
1281
|
+
response = None
|
1282
|
+
if testOrder:
|
1283
|
+
response = self.privatePostOrdersTest(request)
|
1284
|
+
else:
|
1285
|
+
response = self.privatePostOrders(request)
|
1263
1286
|
return self.parse_order(response, market)
|
1264
1287
|
|
1265
1288
|
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
1266
1289
|
"""
|
1267
1290
|
make a withdrawal
|
1291
|
+
:see: https://api-docs-v3.idex.io/#withdraw-funds
|
1268
1292
|
:param str code: unified currency code
|
1269
1293
|
:param float amount: the amount to withdraw
|
1270
1294
|
:param str address: the address to withdraw to
|
@@ -1316,6 +1340,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1316
1340
|
def cancel_all_orders(self, symbol: Str = None, params={}):
|
1317
1341
|
"""
|
1318
1342
|
cancel all open orders
|
1343
|
+
:see: https://api-docs-v3.idex.io/#cancel-order
|
1319
1344
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
1320
1345
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1321
1346
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -1351,6 +1376,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1351
1376
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
1352
1377
|
"""
|
1353
1378
|
cancels an open order
|
1379
|
+
:see: https://api-docs-v3.idex.io/#cancel-order
|
1354
1380
|
:param str id: order id
|
1355
1381
|
:param str symbol: unified symbol of the market the order was made in
|
1356
1382
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1397,6 +1423,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1397
1423
|
def fetch_deposit(self, id: str, code: Str = None, params={}):
|
1398
1424
|
"""
|
1399
1425
|
fetch information on a deposit
|
1426
|
+
:see: https://api-docs-v3.idex.io/#get-deposits
|
1400
1427
|
:param str id: deposit id
|
1401
1428
|
:param str code: not used by idex fetchDeposit()
|
1402
1429
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1415,6 +1442,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1415
1442
|
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1416
1443
|
"""
|
1417
1444
|
fetch all deposits made to an account
|
1445
|
+
:see: https://api-docs-v3.idex.io/#get-deposits
|
1418
1446
|
:param str code: unified currency code
|
1419
1447
|
:param int [since]: the earliest time in ms to fetch deposits for
|
1420
1448
|
:param int [limit]: the maximum number of deposits structures to retrieve
|
@@ -1426,9 +1454,26 @@ class idex(Exchange, ImplicitAPI):
|
|
1426
1454
|
}, params)
|
1427
1455
|
return self.fetch_transactions_helper(code, since, limit, params)
|
1428
1456
|
|
1457
|
+
def fetch_status(self, params={}):
|
1458
|
+
"""
|
1459
|
+
the latest known information on the availability of the exchange API
|
1460
|
+
:see: https://api-docs-v3.idex.io/#get-ping
|
1461
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1462
|
+
:returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
|
1463
|
+
"""
|
1464
|
+
response = self.publicGetPing(params)
|
1465
|
+
return {
|
1466
|
+
'status': 'ok', # if there's no Errors, status = 'ok'
|
1467
|
+
'updated': None,
|
1468
|
+
'eta': None,
|
1469
|
+
'url': None,
|
1470
|
+
'info': response,
|
1471
|
+
}
|
1472
|
+
|
1429
1473
|
def fetch_time(self, params={}):
|
1430
1474
|
"""
|
1431
1475
|
fetches the current integer timestamp in milliseconds from the exchange server
|
1476
|
+
:see: https://api-docs-v3.idex.io/#get-time
|
1432
1477
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1433
1478
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
1434
1479
|
"""
|
@@ -1441,6 +1486,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1441
1486
|
def fetch_withdrawal(self, id: str, code: Str = None, params={}):
|
1442
1487
|
"""
|
1443
1488
|
fetch data on a currency withdrawal via the withdrawal id
|
1489
|
+
:see: https://api-docs-v3.idex.io/#get-withdrawals
|
1444
1490
|
:param str id: withdrawal id
|
1445
1491
|
:param str code: not used by idex.fetchWithdrawal
|
1446
1492
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -1459,6 +1505,7 @@ class idex(Exchange, ImplicitAPI):
|
|
1459
1505
|
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
1460
1506
|
"""
|
1461
1507
|
fetch all withdrawals made from an account
|
1508
|
+
:see: https://api-docs-v3.idex.io/#get-withdrawals
|
1462
1509
|
:param str code: unified currency code
|
1463
1510
|
:param int [since]: the earliest time in ms to fetch withdrawals for
|
1464
1511
|
:param int [limit]: the maximum number of withdrawals structures to retrieve
|
ccxt/independentreserve.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.independentreserve import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
12
12
|
from ccxt.base.precise import Precise
|
@@ -43,6 +43,9 @@ class independentreserve(Exchange, ImplicitAPI):
|
|
43
43
|
'fetchClosedOrders': True,
|
44
44
|
'fetchCrossBorrowRate': False,
|
45
45
|
'fetchCrossBorrowRates': False,
|
46
|
+
'fetchDepositAddress': True,
|
47
|
+
'fetchDepositAddresses': False,
|
48
|
+
'fetchDepositAddressesByNetwork': False,
|
46
49
|
'fetchFundingHistory': False,
|
47
50
|
'fetchFundingRate': False,
|
48
51
|
'fetchFundingRateHistory': False,
|
@@ -671,6 +674,49 @@ class independentreserve(Exchange, ImplicitAPI):
|
|
671
674
|
}
|
672
675
|
return self.privatePostCancelOrder(self.extend(request, params))
|
673
676
|
|
677
|
+
def fetch_deposit_address(self, code: str, params={}):
|
678
|
+
"""
|
679
|
+
fetch the deposit address for a currency associated with self account
|
680
|
+
:see: https://www.independentreserve.com/features/api#GetDigitalCurrencyDepositAddress
|
681
|
+
:param str code: unified currency code
|
682
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
683
|
+
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
684
|
+
"""
|
685
|
+
self.load_markets()
|
686
|
+
currency = self.currency(code)
|
687
|
+
request = {
|
688
|
+
'primaryCurrencyCode': currency['id'],
|
689
|
+
}
|
690
|
+
response = self.privatePostGetDigitalCurrencyDepositAddress(self.extend(request, params))
|
691
|
+
#
|
692
|
+
# {
|
693
|
+
# Tag: '3307446684',
|
694
|
+
# DepositAddress: 'GCCQH4HACMRAD56EZZZ4TOIDQQRVNADMJ35QOFWF4B2VQGODMA2WVQ22',
|
695
|
+
# LastCheckedTimestampUtc: '2024-02-20T11:13:35.6912985Z',
|
696
|
+
# NextUpdateTimestampUtc: '2024-02-20T11:14:56.5112394Z'
|
697
|
+
# }
|
698
|
+
#
|
699
|
+
return self.parse_deposit_address(response)
|
700
|
+
|
701
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
702
|
+
#
|
703
|
+
# {
|
704
|
+
# Tag: '3307446684',
|
705
|
+
# DepositAddress: 'GCCQH4HACMRAD56EZZZ4TOIDQQRVNADMJ35QOFWF4B2VQGODMA2WVQ22',
|
706
|
+
# LastCheckedTimestampUtc: '2024-02-20T11:13:35.6912985Z',
|
707
|
+
# NextUpdateTimestampUtc: '2024-02-20T11:14:56.5112394Z'
|
708
|
+
# }
|
709
|
+
#
|
710
|
+
address = self.safe_string(depositAddress, 'DepositAddress')
|
711
|
+
self.check_address(address)
|
712
|
+
return {
|
713
|
+
'info': depositAddress,
|
714
|
+
'currency': self.safe_string(currency, 'code'),
|
715
|
+
'address': address,
|
716
|
+
'tag': self.safe_string(depositAddress, 'Tag'),
|
717
|
+
'network': None,
|
718
|
+
}
|
719
|
+
|
674
720
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
675
721
|
url = self.urls['api'][api] + '/' + path
|
676
722
|
if api == 'public':
|
ccxt/indodax.py
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.indodax import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
+
import math
|
9
10
|
from ccxt.base.types import Balances, Currency, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
11
|
from typing import List
|
11
12
|
from ccxt.base.errors import ExchangeError
|
@@ -105,7 +106,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
105
106
|
'urls': {
|
106
107
|
'logo': 'https://user-images.githubusercontent.com/51840849/87070508-9358c880-c221-11ea-8dc5-5391afbbb422.jpg',
|
107
108
|
'api': {
|
108
|
-
'public': 'https://indodax.com
|
109
|
+
'public': 'https://indodax.com',
|
109
110
|
'private': 'https://indodax.com/tapi',
|
110
111
|
},
|
111
112
|
'www': 'https://www.indodax.com',
|
@@ -115,14 +116,15 @@ class indodax(Exchange, ImplicitAPI):
|
|
115
116
|
'api': {
|
116
117
|
'public': {
|
117
118
|
'get': {
|
118
|
-
'server_time': 5,
|
119
|
-
'pairs': 5,
|
120
|
-
'price_increments': 5,
|
121
|
-
'summaries': 5,
|
122
|
-
'
|
123
|
-
'
|
124
|
-
'{pair}
|
125
|
-
'{pair}
|
119
|
+
'api/server_time': 5,
|
120
|
+
'api/pairs': 5,
|
121
|
+
'api/price_increments': 5,
|
122
|
+
'api/summaries': 5,
|
123
|
+
'api/ticker/{pair}': 5,
|
124
|
+
'api/ticker_all': 5,
|
125
|
+
'api/trades/{pair}': 5,
|
126
|
+
'api/depth/{pair}': 5,
|
127
|
+
'tradingview/history_v2': 5,
|
126
128
|
},
|
127
129
|
},
|
128
130
|
'private': {
|
@@ -187,6 +189,16 @@ class indodax(Exchange, ImplicitAPI):
|
|
187
189
|
# 'ETH': 'eth'
|
188
190
|
# 'BASE': 'base'
|
189
191
|
},
|
192
|
+
'timeframes': {
|
193
|
+
'1m': '1',
|
194
|
+
'15m': '15',
|
195
|
+
'30m': '30',
|
196
|
+
'1h': '60',
|
197
|
+
'4h': '240',
|
198
|
+
'1d': '1D',
|
199
|
+
'3d': '3D',
|
200
|
+
'1w': '1W',
|
201
|
+
},
|
190
202
|
},
|
191
203
|
'commonCurrencies': {
|
192
204
|
'STR': 'XLM',
|
@@ -204,10 +216,11 @@ class indodax(Exchange, ImplicitAPI):
|
|
204
216
|
def fetch_time(self, params={}):
|
205
217
|
"""
|
206
218
|
fetches the current integer timestamp in milliseconds from the exchange server
|
219
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md#server-time
|
207
220
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
208
221
|
:returns int: the current integer timestamp in milliseconds from the exchange server
|
209
222
|
"""
|
210
|
-
response = self.
|
223
|
+
response = self.publicGetApiServerTime(params)
|
211
224
|
#
|
212
225
|
# {
|
213
226
|
# "timezone": "UTC",
|
@@ -219,10 +232,11 @@ class indodax(Exchange, ImplicitAPI):
|
|
219
232
|
def fetch_markets(self, params={}):
|
220
233
|
"""
|
221
234
|
retrieves data on all markets for indodax
|
235
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md#pairs
|
222
236
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
223
237
|
:returns dict[]: an array of objects representing market data
|
224
238
|
"""
|
225
|
-
response = self.
|
239
|
+
response = self.publicGetApiPairs(params)
|
226
240
|
#
|
227
241
|
# [
|
228
242
|
# {
|
@@ -335,6 +349,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
335
349
|
def fetch_balance(self, params={}) -> Balances:
|
336
350
|
"""
|
337
351
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
352
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#get-info-endpoint
|
338
353
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
339
354
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
340
355
|
"""
|
@@ -375,6 +390,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
375
390
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
376
391
|
"""
|
377
392
|
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
393
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md#depth
|
378
394
|
:param str symbol: unified symbol of the market to fetch the order book for
|
379
395
|
:param int [limit]: the maximum amount of order book entries to return
|
380
396
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -383,9 +399,9 @@ class indodax(Exchange, ImplicitAPI):
|
|
383
399
|
self.load_markets()
|
384
400
|
market = self.market(symbol)
|
385
401
|
request = {
|
386
|
-
'pair': market['
|
402
|
+
'pair': market['base'] + market['quote'],
|
387
403
|
}
|
388
|
-
orderbook = self.
|
404
|
+
orderbook = self.publicGetApiDepthPair(self.extend(request, params))
|
389
405
|
return self.parse_order_book(orderbook, market['symbol'], None, 'buy', 'sell')
|
390
406
|
|
391
407
|
def parse_ticker(self, ticker, market: Market = None) -> Ticker:
|
@@ -432,6 +448,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
432
448
|
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
433
449
|
"""
|
434
450
|
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
451
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md#ticker
|
435
452
|
:param str symbol: unified symbol of the market to fetch the ticker for
|
436
453
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
437
454
|
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
@@ -439,9 +456,9 @@ class indodax(Exchange, ImplicitAPI):
|
|
439
456
|
self.load_markets()
|
440
457
|
market = self.market(symbol)
|
441
458
|
request = {
|
442
|
-
'pair': market['
|
459
|
+
'pair': market['base'] + market['quote'],
|
443
460
|
}
|
444
|
-
response = self.
|
461
|
+
response = self.publicGetApiTickerPair(self.extend(request, params))
|
445
462
|
#
|
446
463
|
# {
|
447
464
|
# "ticker": {
|
@@ -484,7 +501,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
484
501
|
# }
|
485
502
|
# }
|
486
503
|
#
|
487
|
-
response = self.
|
504
|
+
response = self.publicGetApiTickerAll(params)
|
488
505
|
tickers = self.safe_value(response, 'tickers')
|
489
506
|
return self.parse_tickers(tickers, symbols)
|
490
507
|
|
@@ -509,6 +526,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
509
526
|
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
510
527
|
"""
|
511
528
|
get the list of most recent trades for a particular symbol
|
529
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md#trades
|
512
530
|
:param str symbol: unified symbol of the market to fetch trades for
|
513
531
|
:param int [since]: timestamp in ms of the earliest trade to fetch
|
514
532
|
:param int [limit]: the maximum amount of trades to fetch
|
@@ -518,11 +536,76 @@ class indodax(Exchange, ImplicitAPI):
|
|
518
536
|
self.load_markets()
|
519
537
|
market = self.market(symbol)
|
520
538
|
request = {
|
521
|
-
'pair': market['
|
539
|
+
'pair': market['base'] + market['quote'],
|
522
540
|
}
|
523
|
-
response = self.
|
541
|
+
response = self.publicGetApiTradesPair(self.extend(request, params))
|
524
542
|
return self.parse_trades(response, market, since, limit)
|
525
543
|
|
544
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
545
|
+
#
|
546
|
+
# {
|
547
|
+
# "Time": 1708416900,
|
548
|
+
# "Open": 51707.52,
|
549
|
+
# "High": 51707.52,
|
550
|
+
# "Low": 51707.52,
|
551
|
+
# "Close": 51707.52,
|
552
|
+
# "Volume": "0"
|
553
|
+
# }
|
554
|
+
#
|
555
|
+
return [
|
556
|
+
self.safe_timestamp(ohlcv, 'Time'),
|
557
|
+
self.safe_number(ohlcv, 'Open'),
|
558
|
+
self.safe_number(ohlcv, 'High'),
|
559
|
+
self.safe_number(ohlcv, 'Low'),
|
560
|
+
self.safe_number(ohlcv, 'Close'),
|
561
|
+
self.safe_number(ohlcv, 'Volume'),
|
562
|
+
]
|
563
|
+
|
564
|
+
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
565
|
+
"""
|
566
|
+
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
567
|
+
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
568
|
+
:param str timeframe: the length of time each candle represents
|
569
|
+
:param int [since]: timestamp in ms of the earliest candle to fetch
|
570
|
+
:param int [limit]: the maximum amount of candles to fetch
|
571
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
572
|
+
:param int [params.until]: timestamp in ms of the latest candle to fetch
|
573
|
+
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
574
|
+
"""
|
575
|
+
self.load_markets()
|
576
|
+
market = self.market(symbol)
|
577
|
+
timeframes = self.options['timeframes']
|
578
|
+
selectedTimeframe = self.safe_string(timeframes, timeframe, timeframe)
|
579
|
+
now = self.seconds()
|
580
|
+
until = self.safe_integer_2(params, 'until', 'till', now)
|
581
|
+
params = self.omit(params, ['until', 'till'])
|
582
|
+
request = {
|
583
|
+
'to': until,
|
584
|
+
'tf': selectedTimeframe,
|
585
|
+
'symbol': market['base'] + market['quote'],
|
586
|
+
}
|
587
|
+
if limit is None:
|
588
|
+
limit = 1000
|
589
|
+
if since is not None:
|
590
|
+
request['from'] = int(math.floor(since / 1000))
|
591
|
+
else:
|
592
|
+
duration = self.parse_timeframe(timeframe)
|
593
|
+
request['from'] = now - limit * duration - 1
|
594
|
+
response = self.publicGetTradingviewHistoryV2(self.extend(request, params))
|
595
|
+
#
|
596
|
+
# [
|
597
|
+
# {
|
598
|
+
# "Time": 1708416900,
|
599
|
+
# "Open": 51707.52,
|
600
|
+
# "High": 51707.52,
|
601
|
+
# "Low": 51707.52,
|
602
|
+
# "Close": 51707.52,
|
603
|
+
# "Volume": "0"
|
604
|
+
# }
|
605
|
+
# ]
|
606
|
+
#
|
607
|
+
return self.parse_ohlcvs(response, market, timeframe, since, limit)
|
608
|
+
|
526
609
|
def parse_order_status(self, status):
|
527
610
|
statuses = {
|
528
611
|
'open': 'open',
|
@@ -607,6 +690,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
607
690
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
608
691
|
"""
|
609
692
|
fetches information on an order made by the user
|
693
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#get-order-endpoints
|
610
694
|
:param str symbol: unified symbol of the market the order was made in
|
611
695
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
612
696
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -628,6 +712,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
628
712
|
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
629
713
|
"""
|
630
714
|
fetch all unfilled currently open orders
|
715
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#open-orders-endpoints
|
631
716
|
:param str symbol: unified market symbol
|
632
717
|
:param int [since]: the earliest time in ms to fetch open orders for
|
633
718
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
@@ -662,6 +747,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
662
747
|
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
663
748
|
"""
|
664
749
|
fetches information on multiple closed orders made by the user
|
750
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#order-history
|
665
751
|
:param str symbol: unified market symbol of the market orders were made in
|
666
752
|
:param int [since]: the earliest time in ms to fetch orders for
|
667
753
|
:param int [limit]: the maximum number of order structures to retrieve
|
@@ -683,6 +769,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
683
769
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: float = None, params={}):
|
684
770
|
"""
|
685
771
|
create a trade order
|
772
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#trade-endpoints
|
686
773
|
:param str symbol: unified symbol of the market to create an order in
|
687
774
|
:param str type: 'market' or 'limit'
|
688
775
|
:param str side: 'buy' or 'sell'
|
@@ -717,6 +804,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
717
804
|
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
718
805
|
"""
|
719
806
|
cancels an open order
|
807
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#cancel-order-endpoints
|
720
808
|
:param str id: order id
|
721
809
|
:param str symbol: unified symbol of the market the order was made in
|
722
810
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
@@ -739,6 +827,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
739
827
|
def fetch_transaction_fee(self, code: str, params={}):
|
740
828
|
"""
|
741
829
|
fetch the fee for a transaction
|
830
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#withdraw-fee-endpoints
|
742
831
|
:param str code: unified currency code
|
743
832
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
744
833
|
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
@@ -770,6 +859,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
770
859
|
def fetch_deposits_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
771
860
|
"""
|
772
861
|
fetch history of deposits and withdrawals
|
862
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#transaction-history-endpoints
|
773
863
|
:param str [code]: unified currency code for the currency of the deposit/withdrawals, default is None
|
774
864
|
:param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
|
775
865
|
:param int [limit]: max number of deposit/withdrawals to return, default is None
|
@@ -864,6 +954,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
864
954
|
def withdraw(self, code: str, amount: float, address, tag=None, params={}):
|
865
955
|
"""
|
866
956
|
make a withdrawal
|
957
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#withdraw-coin-endpoints
|
867
958
|
:param str code: unified currency code
|
868
959
|
:param float amount: the amount to withdraw
|
869
960
|
:param str address: the address to withdraw to
|
@@ -993,6 +1084,7 @@ class indodax(Exchange, ImplicitAPI):
|
|
993
1084
|
def fetch_deposit_addresses(self, codes: List[str] = None, params={}):
|
994
1085
|
"""
|
995
1086
|
fetch deposit addresses for multiple currencies and chain types
|
1087
|
+
:see: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md#general-information-on-endpoints
|
996
1088
|
:param str[] [codes]: list of unified currency codes, default is None
|
997
1089
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
998
1090
|
:returns dict: a list of `address structures <https://docs.ccxt.com/#/?id=address-structure>`
|
@@ -1069,7 +1161,11 @@ class indodax(Exchange, ImplicitAPI):
|
|
1069
1161
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
1070
1162
|
url = self.urls['api'][api]
|
1071
1163
|
if api == 'public':
|
1072
|
-
|
1164
|
+
query = self.omit(params, self.extract_params(path))
|
1165
|
+
requestPath = '/' + self.implode_params(path, params)
|
1166
|
+
url = url + requestPath
|
1167
|
+
if query:
|
1168
|
+
url += '?' + self.urlencode_with_array_repeat(query)
|
1073
1169
|
else:
|
1074
1170
|
self.check_required_credentials()
|
1075
1171
|
body = self.urlencode(self.extend({
|