ccxt 4.4.38__py2.py3-none-any.whl → 4.4.39__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/digifinex.py +1 -0
- ccxt/abstract/mexc.py +1 -0
- ccxt/abstract/woo.py +2 -2
- ccxt/alpaca.py +74 -3
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/alpaca.py +74 -3
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/digifinex.py +57 -18
- ccxt/async_support/htx.py +154 -32
- ccxt/async_support/kucoin.py +1 -0
- ccxt/async_support/mexc.py +36 -25
- ccxt/async_support/okx.py +1 -0
- ccxt/async_support/woo.py +6 -6
- ccxt/base/exchange.py +20 -10
- ccxt/digifinex.py +57 -18
- ccxt/htx.py +154 -32
- ccxt/kucoin.py +1 -0
- ccxt/mexc.py +36 -25
- ccxt/okx.py +1 -0
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/woo.py +1 -1
- ccxt/woo.py +6 -6
- {ccxt-4.4.38.dist-info → ccxt-4.4.39.dist-info}/METADATA +4 -4
- {ccxt-4.4.38.dist-info → ccxt-4.4.39.dist-info}/RECORD +28 -28
- {ccxt-4.4.38.dist-info → ccxt-4.4.39.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.38.dist-info → ccxt-4.4.39.dist-info}/WHEEL +0 -0
- {ccxt-4.4.38.dist-info → ccxt-4.4.39.dist-info}/top_level.txt +0 -0
ccxt/__init__.py
CHANGED
ccxt/abstract/digifinex.py
CHANGED
@@ -71,6 +71,7 @@ class ImplicitAPI:
|
|
71
71
|
private_swap_get_trade_history_trades = privateSwapGetTradeHistoryTrades = Entry('trade/history_trades', ['private', 'swap'], 'GET', {})
|
72
72
|
private_swap_get_trade_open_orders = privateSwapGetTradeOpenOrders = Entry('trade/open_orders', ['private', 'swap'], 'GET', {})
|
73
73
|
private_swap_get_trade_order_info = privateSwapGetTradeOrderInfo = Entry('trade/order_info', ['private', 'swap'], 'GET', {})
|
74
|
+
private_swap_post_account_transfer = privateSwapPostAccountTransfer = Entry('account/transfer', ['private', 'swap'], 'POST', {})
|
74
75
|
private_swap_post_account_leverage = privateSwapPostAccountLeverage = Entry('account/leverage', ['private', 'swap'], 'POST', {})
|
75
76
|
private_swap_post_account_position_mode = privateSwapPostAccountPositionMode = Entry('account/position_mode', ['private', 'swap'], 'POST', {})
|
76
77
|
private_swap_post_account_position_margin = privateSwapPostAccountPositionMargin = Entry('account/position_margin', ['private', 'swap'], 'POST', {})
|
ccxt/abstract/mexc.py
CHANGED
@@ -20,6 +20,7 @@ class ImplicitAPI:
|
|
20
20
|
spot_private_get_allorders = spotPrivateGetAllOrders = Entry('allOrders', ['spot', 'private'], 'GET', {'cost': 10})
|
21
21
|
spot_private_get_account = spotPrivateGetAccount = Entry('account', ['spot', 'private'], 'GET', {'cost': 10})
|
22
22
|
spot_private_get_mytrades = spotPrivateGetMyTrades = Entry('myTrades', ['spot', 'private'], 'GET', {'cost': 10})
|
23
|
+
spot_private_get_tradefee = spotPrivateGetTradeFee = Entry('tradeFee', ['spot', 'private'], 'GET', {'cost': 10})
|
23
24
|
spot_private_get_sub_account_list = spotPrivateGetSubAccountList = Entry('sub-account/list', ['spot', 'private'], 'GET', {'cost': 1})
|
24
25
|
spot_private_get_sub_account_apikey = spotPrivateGetSubAccountApiKey = Entry('sub-account/apiKey', ['spot', 'private'], 'GET', {'cost': 1})
|
25
26
|
spot_private_get_capital_config_getall = spotPrivateGetCapitalConfigGetall = Entry('capital/config/getall', ['spot', 'private'], 'GET', {'cost': 10})
|
ccxt/abstract/woo.py
CHANGED
@@ -3,7 +3,7 @@ from ccxt.base.types import Entry
|
|
3
3
|
|
4
4
|
class ImplicitAPI:
|
5
5
|
v1_pub_get_hist_kline = v1PubGetHistKline = Entry('hist/kline', ['v1', 'pub'], 'GET', {'cost': 10})
|
6
|
-
v1_pub_get_hist_trades = v1PubGetHistTrades = Entry('hist/trades', ['v1', 'pub'], 'GET', {'cost':
|
6
|
+
v1_pub_get_hist_trades = v1PubGetHistTrades = Entry('hist/trades', ['v1', 'pub'], 'GET', {'cost': 10})
|
7
7
|
v1_public_get_info = v1PublicGetInfo = Entry('info', ['v1', 'public'], 'GET', {'cost': 1})
|
8
8
|
v1_public_get_info_symbol = v1PublicGetInfoSymbol = Entry('info/{symbol}', ['v1', 'public'], 'GET', {'cost': 1})
|
9
9
|
v1_public_get_system_info = v1PublicGetSystemInfo = Entry('system_info', ['v1', 'public'], 'GET', {'cost': 1})
|
@@ -43,7 +43,7 @@ class ImplicitAPI:
|
|
43
43
|
v1_private_get_position_symbol = v1PrivateGetPositionSymbol = Entry('position/{symbol}', ['v1', 'private'], 'GET', {'cost': 3.33})
|
44
44
|
v1_private_get_client_transaction_history = v1PrivateGetClientTransactionHistory = Entry('client/transaction_history', ['v1', 'private'], 'GET', {'cost': 60})
|
45
45
|
v1_private_get_client_futures_leverage = v1PrivateGetClientFuturesLeverage = Entry('client/futures_leverage', ['v1', 'private'], 'GET', {'cost': 60})
|
46
|
-
v1_private_post_order = v1PrivatePostOrder = Entry('order', ['v1', 'private'], 'POST', {'cost':
|
46
|
+
v1_private_post_order = v1PrivatePostOrder = Entry('order', ['v1', 'private'], 'POST', {'cost': 1})
|
47
47
|
v1_private_post_order_cancel_all_after = v1PrivatePostOrderCancelAllAfter = Entry('order/cancel_all_after', ['v1', 'private'], 'POST', {'cost': 1})
|
48
48
|
v1_private_post_asset_main_sub_transfer = v1PrivatePostAssetMainSubTransfer = Entry('asset/main_sub_transfer', ['v1', 'private'], 'POST', {'cost': 30})
|
49
49
|
v1_private_post_asset_ltv = v1PrivatePostAssetLtv = Entry('asset/ltv', ['v1', 'private'], 'POST', {'cost': 30})
|
ccxt/alpaca.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.alpaca import ImplicitAPI
|
8
|
-
from ccxt.base.types import Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
8
|
+
from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import PermissionDenied
|
@@ -44,7 +44,7 @@ class alpaca(Exchange, ImplicitAPI):
|
|
44
44
|
'test': {
|
45
45
|
'broker': 'https://broker-api.sandbox.{hostname}',
|
46
46
|
'trader': 'https://paper-api.{hostname}',
|
47
|
-
'market': 'https://data.
|
47
|
+
'market': 'https://data.{hostname}',
|
48
48
|
},
|
49
49
|
'doc': 'https://alpaca.markets/docs/',
|
50
50
|
'fees': 'https://docs.alpaca.markets/docs/crypto-fees',
|
@@ -64,7 +64,7 @@ class alpaca(Exchange, ImplicitAPI):
|
|
64
64
|
'createStopOrder': True,
|
65
65
|
'createTriggerOrder': True,
|
66
66
|
'editOrder': True,
|
67
|
-
'fetchBalance':
|
67
|
+
'fetchBalance': True,
|
68
68
|
'fetchBidsAsks': False,
|
69
69
|
'fetchClosedOrders': True,
|
70
70
|
'fetchCurrencies': False,
|
@@ -1553,6 +1553,77 @@ class alpaca(Exchange, ImplicitAPI):
|
|
1553
1553
|
}
|
1554
1554
|
return self.safe_string(types, type, type)
|
1555
1555
|
|
1556
|
+
def fetch_balance(self, params={}) -> Balances:
|
1557
|
+
"""
|
1558
|
+
query for balance and get the amount of funds available for trading or funds locked in orders
|
1559
|
+
|
1560
|
+
https://docs.alpaca.markets/reference/getaccount-1
|
1561
|
+
|
1562
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1563
|
+
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
1564
|
+
"""
|
1565
|
+
self.load_markets()
|
1566
|
+
response = self.traderPrivateGetV2Account(params)
|
1567
|
+
#
|
1568
|
+
# {
|
1569
|
+
# "id": "43a01bde-4eb1-64fssc26adb5",
|
1570
|
+
# "admin_configurations": {
|
1571
|
+
# "allow_instant_ach": True,
|
1572
|
+
# "max_margin_multiplier": "4"
|
1573
|
+
# },
|
1574
|
+
# "user_configurations": {
|
1575
|
+
# "fractional_trading": True,
|
1576
|
+
# "max_margin_multiplier": "4"
|
1577
|
+
# },
|
1578
|
+
# "account_number": "744873727",
|
1579
|
+
# "status": "ACTIVE",
|
1580
|
+
# "crypto_status": "ACTIVE",
|
1581
|
+
# "currency": "USD",
|
1582
|
+
# "buying_power": "5.92",
|
1583
|
+
# "regt_buying_power": "5.92",
|
1584
|
+
# "daytrading_buying_power": "0",
|
1585
|
+
# "effective_buying_power": "5.92",
|
1586
|
+
# "non_marginable_buying_power": "5.92",
|
1587
|
+
# "bod_dtbp": "0",
|
1588
|
+
# "cash": "5.92",
|
1589
|
+
# "accrued_fees": "0",
|
1590
|
+
# "portfolio_value": "48.6",
|
1591
|
+
# "pattern_day_trader": False,
|
1592
|
+
# "trading_blocked": False,
|
1593
|
+
# "transfers_blocked": False,
|
1594
|
+
# "account_blocked": False,
|
1595
|
+
# "created_at": "2022-06-13T14:59:18.318096Z",
|
1596
|
+
# "trade_suspended_by_user": False,
|
1597
|
+
# "multiplier": "1",
|
1598
|
+
# "shorting_enabled": False,
|
1599
|
+
# "equity": "48.6",
|
1600
|
+
# "last_equity": "48.8014266",
|
1601
|
+
# "long_market_value": "42.68",
|
1602
|
+
# "short_market_value": "0",
|
1603
|
+
# "position_market_value": "42.68",
|
1604
|
+
# "initial_margin": "0",
|
1605
|
+
# "maintenance_margin": "0",
|
1606
|
+
# "last_maintenance_margin": "0",
|
1607
|
+
# "sma": "5.92",
|
1608
|
+
# "daytrade_count": 0,
|
1609
|
+
# "balance_asof": "2024-12-10",
|
1610
|
+
# "crypto_tier": 1,
|
1611
|
+
# "intraday_adjustments": "0",
|
1612
|
+
# "pending_reg_taf_fees": "0"
|
1613
|
+
# }
|
1614
|
+
#
|
1615
|
+
return self.parse_balance(response)
|
1616
|
+
|
1617
|
+
def parse_balance(self, response) -> Balances:
|
1618
|
+
result: dict = {'info': response}
|
1619
|
+
account = self.account()
|
1620
|
+
currencyId = self.safe_string(response, 'currency')
|
1621
|
+
code = self.safe_currency_code(currencyId)
|
1622
|
+
account['free'] = self.safe_string(response, 'cash')
|
1623
|
+
account['total'] = self.safe_string(response, 'equity')
|
1624
|
+
result[code] = account
|
1625
|
+
return self.safe_balance(result)
|
1626
|
+
|
1556
1627
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
1557
1628
|
endpoint = '/' + self.implode_params(path, params)
|
1558
1629
|
url = self.implode_hostname(self.urls['api'][api[0]])
|
ccxt/async_support/__init__.py
CHANGED
ccxt/async_support/alpaca.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.alpaca import ImplicitAPI
|
8
|
-
from ccxt.base.types import Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
8
|
+
from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import PermissionDenied
|
@@ -44,7 +44,7 @@ class alpaca(Exchange, ImplicitAPI):
|
|
44
44
|
'test': {
|
45
45
|
'broker': 'https://broker-api.sandbox.{hostname}',
|
46
46
|
'trader': 'https://paper-api.{hostname}',
|
47
|
-
'market': 'https://data.
|
47
|
+
'market': 'https://data.{hostname}',
|
48
48
|
},
|
49
49
|
'doc': 'https://alpaca.markets/docs/',
|
50
50
|
'fees': 'https://docs.alpaca.markets/docs/crypto-fees',
|
@@ -64,7 +64,7 @@ class alpaca(Exchange, ImplicitAPI):
|
|
64
64
|
'createStopOrder': True,
|
65
65
|
'createTriggerOrder': True,
|
66
66
|
'editOrder': True,
|
67
|
-
'fetchBalance':
|
67
|
+
'fetchBalance': True,
|
68
68
|
'fetchBidsAsks': False,
|
69
69
|
'fetchClosedOrders': True,
|
70
70
|
'fetchCurrencies': False,
|
@@ -1553,6 +1553,77 @@ class alpaca(Exchange, ImplicitAPI):
|
|
1553
1553
|
}
|
1554
1554
|
return self.safe_string(types, type, type)
|
1555
1555
|
|
1556
|
+
async def fetch_balance(self, params={}) -> Balances:
|
1557
|
+
"""
|
1558
|
+
query for balance and get the amount of funds available for trading or funds locked in orders
|
1559
|
+
|
1560
|
+
https://docs.alpaca.markets/reference/getaccount-1
|
1561
|
+
|
1562
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1563
|
+
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
1564
|
+
"""
|
1565
|
+
await self.load_markets()
|
1566
|
+
response = await self.traderPrivateGetV2Account(params)
|
1567
|
+
#
|
1568
|
+
# {
|
1569
|
+
# "id": "43a01bde-4eb1-64fssc26adb5",
|
1570
|
+
# "admin_configurations": {
|
1571
|
+
# "allow_instant_ach": True,
|
1572
|
+
# "max_margin_multiplier": "4"
|
1573
|
+
# },
|
1574
|
+
# "user_configurations": {
|
1575
|
+
# "fractional_trading": True,
|
1576
|
+
# "max_margin_multiplier": "4"
|
1577
|
+
# },
|
1578
|
+
# "account_number": "744873727",
|
1579
|
+
# "status": "ACTIVE",
|
1580
|
+
# "crypto_status": "ACTIVE",
|
1581
|
+
# "currency": "USD",
|
1582
|
+
# "buying_power": "5.92",
|
1583
|
+
# "regt_buying_power": "5.92",
|
1584
|
+
# "daytrading_buying_power": "0",
|
1585
|
+
# "effective_buying_power": "5.92",
|
1586
|
+
# "non_marginable_buying_power": "5.92",
|
1587
|
+
# "bod_dtbp": "0",
|
1588
|
+
# "cash": "5.92",
|
1589
|
+
# "accrued_fees": "0",
|
1590
|
+
# "portfolio_value": "48.6",
|
1591
|
+
# "pattern_day_trader": False,
|
1592
|
+
# "trading_blocked": False,
|
1593
|
+
# "transfers_blocked": False,
|
1594
|
+
# "account_blocked": False,
|
1595
|
+
# "created_at": "2022-06-13T14:59:18.318096Z",
|
1596
|
+
# "trade_suspended_by_user": False,
|
1597
|
+
# "multiplier": "1",
|
1598
|
+
# "shorting_enabled": False,
|
1599
|
+
# "equity": "48.6",
|
1600
|
+
# "last_equity": "48.8014266",
|
1601
|
+
# "long_market_value": "42.68",
|
1602
|
+
# "short_market_value": "0",
|
1603
|
+
# "position_market_value": "42.68",
|
1604
|
+
# "initial_margin": "0",
|
1605
|
+
# "maintenance_margin": "0",
|
1606
|
+
# "last_maintenance_margin": "0",
|
1607
|
+
# "sma": "5.92",
|
1608
|
+
# "daytrade_count": 0,
|
1609
|
+
# "balance_asof": "2024-12-10",
|
1610
|
+
# "crypto_tier": 1,
|
1611
|
+
# "intraday_adjustments": "0",
|
1612
|
+
# "pending_reg_taf_fees": "0"
|
1613
|
+
# }
|
1614
|
+
#
|
1615
|
+
return self.parse_balance(response)
|
1616
|
+
|
1617
|
+
def parse_balance(self, response) -> Balances:
|
1618
|
+
result: dict = {'info': response}
|
1619
|
+
account = self.account()
|
1620
|
+
currencyId = self.safe_string(response, 'currency')
|
1621
|
+
code = self.safe_currency_code(currencyId)
|
1622
|
+
account['free'] = self.safe_string(response, 'cash')
|
1623
|
+
account['total'] = self.safe_string(response, 'equity')
|
1624
|
+
result[code] = account
|
1625
|
+
return self.safe_balance(result)
|
1626
|
+
|
1556
1627
|
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
1557
1628
|
endpoint = '/' + self.implode_params(path, params)
|
1558
1629
|
url = self.implode_hostname(self.urls['api'][api[0]])
|
ccxt/async_support/digifinex.py
CHANGED
@@ -231,6 +231,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
231
231
|
'trade/order_info',
|
232
232
|
],
|
233
233
|
'post': [
|
234
|
+
'account/transfer',
|
234
235
|
'account/leverage',
|
235
236
|
'account/position_mode',
|
236
237
|
'account/position_margin',
|
@@ -2749,12 +2750,23 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2749
2750
|
|
2750
2751
|
def parse_transfer(self, transfer: dict, currency: Currency = None) -> TransferEntry:
|
2751
2752
|
#
|
2752
|
-
# transfer
|
2753
|
+
# transfer between spot, margin and OTC
|
2753
2754
|
#
|
2754
2755
|
# {
|
2755
2756
|
# "code": 0
|
2756
2757
|
# }
|
2757
2758
|
#
|
2759
|
+
# transfer between spot and swap
|
2760
|
+
#
|
2761
|
+
# {
|
2762
|
+
# "code": 0,
|
2763
|
+
# "data": {
|
2764
|
+
# "type": 2,
|
2765
|
+
# "currency": "USDT",
|
2766
|
+
# "transfer_amount": "5"
|
2767
|
+
# }
|
2768
|
+
# }
|
2769
|
+
#
|
2758
2770
|
# fetchTransfers
|
2759
2771
|
#
|
2760
2772
|
# {
|
@@ -2767,7 +2779,8 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2767
2779
|
#
|
2768
2780
|
fromAccount = None
|
2769
2781
|
toAccount = None
|
2770
|
-
|
2782
|
+
data = self.safe_dict(transfer, 'data', transfer)
|
2783
|
+
type = self.safe_integer(data, 'type')
|
2771
2784
|
if type == 1:
|
2772
2785
|
fromAccount = 'spot'
|
2773
2786
|
toAccount = 'swap'
|
@@ -2780,8 +2793,8 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2780
2793
|
'id': self.safe_string(transfer, 'transfer_id'),
|
2781
2794
|
'timestamp': timestamp,
|
2782
2795
|
'datetime': self.iso8601(timestamp),
|
2783
|
-
'currency': self.safe_currency_code(self.safe_string(
|
2784
|
-
'amount': self.
|
2796
|
+
'currency': self.safe_currency_code(self.safe_string(data, 'currency'), currency),
|
2797
|
+
'amount': self.safe_number_2(data, 'amount', 'transfer_amount'),
|
2785
2798
|
'fromAccount': fromAccount,
|
2786
2799
|
'toAccount': toAccount,
|
2787
2800
|
'status': self.parse_transfer_status(self.safe_string(transfer, 'code')),
|
@@ -2790,30 +2803,56 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2790
2803
|
async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
|
2791
2804
|
"""
|
2792
2805
|
transfer currency internally between wallets on the same account
|
2806
|
+
|
2807
|
+
https://docs.digifinex.com/en-ww/spot/v3/rest.html#transfer-assets-among-accounts
|
2808
|
+
https://docs.digifinex.com/en-ww/swap/v2/rest.html#accounttransfer
|
2809
|
+
|
2793
2810
|
:param str code: unified currency code
|
2794
2811
|
:param float amount: amount to transfer
|
2795
|
-
:param str fromAccount: account to transfer from
|
2796
|
-
:param str toAccount: account to transfer to
|
2812
|
+
:param str fromAccount: 'spot', 'swap', 'margin', 'OTC' - account to transfer from
|
2813
|
+
:param str toAccount: 'spot', 'swap', 'margin', 'OTC' - account to transfer to
|
2797
2814
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2798
2815
|
:returns dict: a `transfer structure <https://docs.ccxt.com/#/?id=transfer-structure>`
|
2799
2816
|
"""
|
2800
2817
|
await self.load_markets()
|
2801
2818
|
currency = self.currency(code)
|
2819
|
+
currencyId = currency['id']
|
2802
2820
|
accountsByType = self.safe_value(self.options, 'accountsByType', {})
|
2803
2821
|
fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
|
2804
2822
|
toId = self.safe_string(accountsByType, toAccount, toAccount)
|
2805
|
-
request
|
2806
|
-
|
2807
|
-
|
2808
|
-
|
2809
|
-
|
2810
|
-
|
2811
|
-
|
2812
|
-
|
2813
|
-
|
2814
|
-
|
2815
|
-
|
2816
|
-
|
2823
|
+
request = {}
|
2824
|
+
fromSwap = (fromAccount == 'swap')
|
2825
|
+
toSwap = (toAccount == 'swap')
|
2826
|
+
response = None
|
2827
|
+
amountString = self.currency_to_precision(code, amount)
|
2828
|
+
if fromSwap or toSwap:
|
2829
|
+
if (fromId != '1') and (toId != '1'):
|
2830
|
+
raise ExchangeError(self.id + ' transfer() supports transferring between spot and swap, spot and margin, spot and OTC only')
|
2831
|
+
request['type'] = 1 if toSwap else 2 # 1 = spot to swap, 2 = swap to spot
|
2832
|
+
request['currency'] = currencyId
|
2833
|
+
request['transfer_amount'] = amountString
|
2834
|
+
#
|
2835
|
+
# {
|
2836
|
+
# "code": 0,
|
2837
|
+
# "data": {
|
2838
|
+
# "type": 2,
|
2839
|
+
# "currency": "USDT",
|
2840
|
+
# "transfer_amount": "5"
|
2841
|
+
# }
|
2842
|
+
# }
|
2843
|
+
#
|
2844
|
+
response = await self.privateSwapPostAccountTransfer(self.extend(request, params))
|
2845
|
+
else:
|
2846
|
+
request['currency_mark'] = currencyId
|
2847
|
+
request['num'] = amountString
|
2848
|
+
request['from'] = fromId # 1 = SPOT, 2 = MARGIN, 3 = OTC
|
2849
|
+
request['to'] = toId # 1 = SPOT, 2 = MARGIN, 3 = OTC
|
2850
|
+
#
|
2851
|
+
# {
|
2852
|
+
# "code": 0
|
2853
|
+
# }
|
2854
|
+
#
|
2855
|
+
response = await self.privateSpotPostTransfer(self.extend(request, params))
|
2817
2856
|
return self.parse_transfer(response, currency)
|
2818
2857
|
|
2819
2858
|
async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
|