天择加密量化开放框架下载
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1777 lines
88 KiB

1 year ago
  1. # coding: utf-8
  2. """
  3. Gate API v4
  4. Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
  5. Contact: support@mail.gate.io
  6. Generated by: https://openapi-generator.tech
  7. """
  8. from __future__ import absolute_import
  9. import re # noqa: F401
  10. # python 2 and python 3 compatibility library
  11. import six
  12. from gate_api.api_client import ApiClient
  13. from gate_api.exceptions import ApiTypeError, ApiValueError # noqa: F401
  14. class WalletApi(object):
  15. """NOTE: This class is auto generated by OpenAPI Generator
  16. Ref: https://openapi-generator.tech
  17. Do not edit the class manually.
  18. """
  19. def __init__(self, api_client=None):
  20. if api_client is None:
  21. api_client = ApiClient()
  22. self.api_client = api_client
  23. def list_currency_chains(self, currency, **kwargs): # noqa: E501
  24. """List chains supported for specified currency # noqa: E501
  25. This method makes a synchronous HTTP request by default. To make an
  26. asynchronous HTTP request, please pass async_req=True
  27. >>> thread = api.list_currency_chains(currency, async_req=True)
  28. >>> result = thread.get()
  29. :param bool async_req: execute request asynchronously
  30. :param str currency: Currency name (required)
  31. :param _preload_content: if False, the urllib3.HTTPResponse object will
  32. be returned without reading/decoding response
  33. data. Default is True.
  34. :param _request_timeout: timeout setting for this request. If one
  35. number provided, it will be total request
  36. timeout. It can also be a pair (tuple) of
  37. (connection, read) timeouts.
  38. :rtype: list[gate_api.CurrencyChain]
  39. :return: If the method is called asynchronously,
  40. returns the request thread.
  41. """
  42. kwargs['_return_http_data_only'] = True
  43. return self.list_currency_chains_with_http_info(currency, **kwargs) # noqa: E501
  44. def list_currency_chains_with_http_info(self, currency, **kwargs): # noqa: E501
  45. """List chains supported for specified currency # noqa: E501
  46. This method makes a synchronous HTTP request by default. To make an
  47. asynchronous HTTP request, please pass async_req=True
  48. >>> thread = api.list_currency_chains_with_http_info(currency, async_req=True)
  49. >>> result = thread.get()
  50. :param bool async_req: execute request asynchronously
  51. :param str currency: Currency name (required)
  52. :param _return_http_data_only: response data without head status code
  53. and headers
  54. :param _preload_content: if False, the urllib3.HTTPResponse object will
  55. be returned without reading/decoding response
  56. data. Default is True.
  57. :param _request_timeout: timeout setting for this request. If one
  58. number provided, it will be total request
  59. timeout. It can also be a pair (tuple) of
  60. (connection, read) timeouts.
  61. :rtype: tuple(list[gate_api.CurrencyChain], status_code(int), headers(HTTPHeaderDict))
  62. :return: If the method is called asynchronously,
  63. returns the request thread.
  64. """
  65. local_var_params = locals()
  66. all_params = ['currency']
  67. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  68. for k, v in six.iteritems(local_var_params['kwargs']):
  69. if k not in all_params:
  70. raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_currency_chains" % k)
  71. local_var_params[k] = v
  72. del local_var_params['kwargs']
  73. # verify the required parameter 'currency' is set
  74. if self.api_client.client_side_validation and (
  75. 'currency' not in local_var_params or local_var_params['currency'] is None # noqa: E501
  76. ): # noqa: E501
  77. raise ApiValueError(
  78. "Missing the required parameter `currency` when calling `list_currency_chains`"
  79. ) # noqa: E501
  80. collection_formats = {}
  81. path_params = {}
  82. query_params = []
  83. if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501
  84. query_params.append(('currency', local_var_params['currency'])) # noqa: E501
  85. header_params = {}
  86. form_params = []
  87. local_var_files = {}
  88. body_params = None
  89. # HTTP header `Accept`
  90. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  91. # Authentication setting
  92. auth_settings = [] # noqa: E501
  93. return self.api_client.call_api(
  94. '/wallet/currency_chains',
  95. 'GET',
  96. path_params,
  97. query_params,
  98. header_params,
  99. body=body_params,
  100. post_params=form_params,
  101. files=local_var_files,
  102. response_type='list[CurrencyChain]', # noqa: E501
  103. auth_settings=auth_settings,
  104. async_req=local_var_params.get('async_req'),
  105. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  106. _preload_content=local_var_params.get('_preload_content', True),
  107. _request_timeout=local_var_params.get('_request_timeout'),
  108. collection_formats=collection_formats,
  109. )
  110. def get_deposit_address(self, currency, **kwargs): # noqa: E501
  111. """Generate currency deposit address # noqa: E501
  112. This method makes a synchronous HTTP request by default. To make an
  113. asynchronous HTTP request, please pass async_req=True
  114. >>> thread = api.get_deposit_address(currency, async_req=True)
  115. >>> result = thread.get()
  116. :param bool async_req: execute request asynchronously
  117. :param str currency: Currency name (required)
  118. :param _preload_content: if False, the urllib3.HTTPResponse object will
  119. be returned without reading/decoding response
  120. data. Default is True.
  121. :param _request_timeout: timeout setting for this request. If one
  122. number provided, it will be total request
  123. timeout. It can also be a pair (tuple) of
  124. (connection, read) timeouts.
  125. :rtype: gate_api.DepositAddress
  126. :return: If the method is called asynchronously,
  127. returns the request thread.
  128. """
  129. kwargs['_return_http_data_only'] = True
  130. return self.get_deposit_address_with_http_info(currency, **kwargs) # noqa: E501
  131. def get_deposit_address_with_http_info(self, currency, **kwargs): # noqa: E501
  132. """Generate currency deposit address # noqa: E501
  133. This method makes a synchronous HTTP request by default. To make an
  134. asynchronous HTTP request, please pass async_req=True
  135. >>> thread = api.get_deposit_address_with_http_info(currency, async_req=True)
  136. >>> result = thread.get()
  137. :param bool async_req: execute request asynchronously
  138. :param str currency: Currency name (required)
  139. :param _return_http_data_only: response data without head status code
  140. and headers
  141. :param _preload_content: if False, the urllib3.HTTPResponse object will
  142. be returned without reading/decoding response
  143. data. Default is True.
  144. :param _request_timeout: timeout setting for this request. If one
  145. number provided, it will be total request
  146. timeout. It can also be a pair (tuple) of
  147. (connection, read) timeouts.
  148. :rtype: tuple(gate_api.DepositAddress, status_code(int), headers(HTTPHeaderDict))
  149. :return: If the method is called asynchronously,
  150. returns the request thread.
  151. """
  152. local_var_params = locals()
  153. all_params = ['currency']
  154. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  155. for k, v in six.iteritems(local_var_params['kwargs']):
  156. if k not in all_params:
  157. raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_deposit_address" % k)
  158. local_var_params[k] = v
  159. del local_var_params['kwargs']
  160. # verify the required parameter 'currency' is set
  161. if self.api_client.client_side_validation and (
  162. 'currency' not in local_var_params or local_var_params['currency'] is None # noqa: E501
  163. ): # noqa: E501
  164. raise ApiValueError(
  165. "Missing the required parameter `currency` when calling `get_deposit_address`"
  166. ) # noqa: E501
  167. collection_formats = {}
  168. path_params = {}
  169. query_params = []
  170. if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501
  171. query_params.append(('currency', local_var_params['currency'])) # noqa: E501
  172. header_params = {}
  173. form_params = []
  174. local_var_files = {}
  175. body_params = None
  176. # HTTP header `Accept`
  177. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  178. # Authentication setting
  179. auth_settings = ['apiv4'] # noqa: E501
  180. return self.api_client.call_api(
  181. '/wallet/deposit_address',
  182. 'GET',
  183. path_params,
  184. query_params,
  185. header_params,
  186. body=body_params,
  187. post_params=form_params,
  188. files=local_var_files,
  189. response_type='DepositAddress', # noqa: E501
  190. auth_settings=auth_settings,
  191. async_req=local_var_params.get('async_req'),
  192. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  193. _preload_content=local_var_params.get('_preload_content', True),
  194. _request_timeout=local_var_params.get('_request_timeout'),
  195. collection_formats=collection_formats,
  196. )
  197. def list_withdrawals(self, **kwargs): # noqa: E501
  198. """Retrieve withdrawal records # noqa: E501
  199. Record time range cannot exceed 30 days # noqa: E501
  200. This method makes a synchronous HTTP request by default. To make an
  201. asynchronous HTTP request, please pass async_req=True
  202. >>> thread = api.list_withdrawals(async_req=True)
  203. >>> result = thread.get()
  204. :param bool async_req: execute request asynchronously
  205. :param str currency: Filter by currency. Return all currency records if not specified
  206. :param int _from: Time range beginning, default to 7 days before current time
  207. :param int to: Time range ending, default to current time
  208. :param int limit: Maximum number of records to be returned in a single list
  209. :param int offset: List offset, starting from 0
  210. :param _preload_content: if False, the urllib3.HTTPResponse object will
  211. be returned without reading/decoding response
  212. data. Default is True.
  213. :param _request_timeout: timeout setting for this request. If one
  214. number provided, it will be total request
  215. timeout. It can also be a pair (tuple) of
  216. (connection, read) timeouts.
  217. :rtype: list[gate_api.LedgerRecord]
  218. :return: If the method is called asynchronously,
  219. returns the request thread.
  220. """
  221. kwargs['_return_http_data_only'] = True
  222. return self.list_withdrawals_with_http_info(**kwargs) # noqa: E501
  223. def list_withdrawals_with_http_info(self, **kwargs): # noqa: E501
  224. """Retrieve withdrawal records # noqa: E501
  225. Record time range cannot exceed 30 days # noqa: E501
  226. This method makes a synchronous HTTP request by default. To make an
  227. asynchronous HTTP request, please pass async_req=True
  228. >>> thread = api.list_withdrawals_with_http_info(async_req=True)
  229. >>> result = thread.get()
  230. :param bool async_req: execute request asynchronously
  231. :param str currency: Filter by currency. Return all currency records if not specified
  232. :param int _from: Time range beginning, default to 7 days before current time
  233. :param int to: Time range ending, default to current time
  234. :param int limit: Maximum number of records to be returned in a single list
  235. :param int offset: List offset, starting from 0
  236. :param _return_http_data_only: response data without head status code
  237. and headers
  238. :param _preload_content: if False, the urllib3.HTTPResponse object will
  239. be returned without reading/decoding response
  240. data. Default is True.
  241. :param _request_timeout: timeout setting for this request. If one
  242. number provided, it will be total request
  243. timeout. It can also be a pair (tuple) of
  244. (connection, read) timeouts.
  245. :rtype: tuple(list[gate_api.LedgerRecord], status_code(int), headers(HTTPHeaderDict))
  246. :return: If the method is called asynchronously,
  247. returns the request thread.
  248. """
  249. local_var_params = locals()
  250. all_params = ['currency', '_from', 'to', 'limit', 'offset']
  251. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  252. for k, v in six.iteritems(local_var_params['kwargs']):
  253. if k not in all_params:
  254. raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_withdrawals" % k)
  255. local_var_params[k] = v
  256. del local_var_params['kwargs']
  257. if (
  258. self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000
  259. ): # noqa: E501
  260. raise ApiValueError(
  261. "Invalid value for parameter `limit` when calling `list_withdrawals`, must be a value less than or equal to `1000`"
  262. ) # noqa: E501
  263. if (
  264. self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1
  265. ): # noqa: E501
  266. raise ApiValueError(
  267. "Invalid value for parameter `limit` when calling `list_withdrawals`, must be a value greater than or equal to `1`"
  268. ) # noqa: E501
  269. if (
  270. self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0
  271. ): # noqa: E501
  272. raise ApiValueError(
  273. "Invalid value for parameter `offset` when calling `list_withdrawals`, must be a value greater than or equal to `0`"
  274. ) # noqa: E501
  275. collection_formats = {}
  276. path_params = {}
  277. query_params = []
  278. if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501
  279. query_params.append(('currency', local_var_params['currency'])) # noqa: E501
  280. if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501
  281. query_params.append(('from', local_var_params['_from'])) # noqa: E501
  282. if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501
  283. query_params.append(('to', local_var_params['to'])) # noqa: E501
  284. if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
  285. query_params.append(('limit', local_var_params['limit'])) # noqa: E501
  286. if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501
  287. query_params.append(('offset', local_var_params['offset'])) # noqa: E501
  288. header_params = {}
  289. form_params = []
  290. local_var_files = {}
  291. body_params = None
  292. # HTTP header `Accept`
  293. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  294. # Authentication setting
  295. auth_settings = ['apiv4'] # noqa: E501
  296. return self.api_client.call_api(
  297. '/wallet/withdrawals',
  298. 'GET',
  299. path_params,
  300. query_params,
  301. header_params,
  302. body=body_params,
  303. post_params=form_params,
  304. files=local_var_files,
  305. response_type='list[LedgerRecord]', # noqa: E501
  306. auth_settings=auth_settings,
  307. async_req=local_var_params.get('async_req'),
  308. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  309. _preload_content=local_var_params.get('_preload_content', True),
  310. _request_timeout=local_var_params.get('_request_timeout'),
  311. collection_formats=collection_formats,
  312. )
  313. def list_deposits(self, **kwargs): # noqa: E501
  314. """Retrieve deposit records # noqa: E501
  315. Record time range cannot exceed 30 days # noqa: E501
  316. This method makes a synchronous HTTP request by default. To make an
  317. asynchronous HTTP request, please pass async_req=True
  318. >>> thread = api.list_deposits(async_req=True)
  319. >>> result = thread.get()
  320. :param bool async_req: execute request asynchronously
  321. :param str currency: Filter by currency. Return all currency records if not specified
  322. :param int _from: Time range beginning, default to 7 days before current time
  323. :param int to: Time range ending, default to current time
  324. :param int limit: Maximum number of records to be returned in a single list
  325. :param int offset: List offset, starting from 0
  326. :param _preload_content: if False, the urllib3.HTTPResponse object will
  327. be returned without reading/decoding response
  328. data. Default is True.
  329. :param _request_timeout: timeout setting for this request. If one
  330. number provided, it will be total request
  331. timeout. It can also be a pair (tuple) of
  332. (connection, read) timeouts.
  333. :rtype: list[gate_api.LedgerRecord]
  334. :return: If the method is called asynchronously,
  335. returns the request thread.
  336. """
  337. kwargs['_return_http_data_only'] = True
  338. return self.list_deposits_with_http_info(**kwargs) # noqa: E501
  339. def list_deposits_with_http_info(self, **kwargs): # noqa: E501
  340. """Retrieve deposit records # noqa: E501
  341. Record time range cannot exceed 30 days # noqa: E501
  342. This method makes a synchronous HTTP request by default. To make an
  343. asynchronous HTTP request, please pass async_req=True
  344. >>> thread = api.list_deposits_with_http_info(async_req=True)
  345. >>> result = thread.get()
  346. :param bool async_req: execute request asynchronously
  347. :param str currency: Filter by currency. Return all currency records if not specified
  348. :param int _from: Time range beginning, default to 7 days before current time
  349. :param int to: Time range ending, default to current time
  350. :param int limit: Maximum number of records to be returned in a single list
  351. :param int offset: List offset, starting from 0
  352. :param _return_http_data_only: response data without head status code
  353. and headers
  354. :param _preload_content: if False, the urllib3.HTTPResponse object will
  355. be returned without reading/decoding response
  356. data. Default is True.
  357. :param _request_timeout: timeout setting for this request. If one
  358. number provided, it will be total request
  359. timeout. It can also be a pair (tuple) of
  360. (connection, read) timeouts.
  361. :rtype: tuple(list[gate_api.LedgerRecord], status_code(int), headers(HTTPHeaderDict))
  362. :return: If the method is called asynchronously,
  363. returns the request thread.
  364. """
  365. local_var_params = locals()
  366. all_params = ['currency', '_from', 'to', 'limit', 'offset']
  367. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  368. for k, v in six.iteritems(local_var_params['kwargs']):
  369. if k not in all_params:
  370. raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_deposits" % k)
  371. local_var_params[k] = v
  372. del local_var_params['kwargs']
  373. if (
  374. self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000
  375. ): # noqa: E501
  376. raise ApiValueError(
  377. "Invalid value for parameter `limit` when calling `list_deposits`, must be a value less than or equal to `1000`"
  378. ) # noqa: E501
  379. if (
  380. self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1
  381. ): # noqa: E501
  382. raise ApiValueError(
  383. "Invalid value for parameter `limit` when calling `list_deposits`, must be a value greater than or equal to `1`"
  384. ) # noqa: E501
  385. if (
  386. self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0
  387. ): # noqa: E501
  388. raise ApiValueError(
  389. "Invalid value for parameter `offset` when calling `list_deposits`, must be a value greater than or equal to `0`"
  390. ) # noqa: E501
  391. collection_formats = {}
  392. path_params = {}
  393. query_params = []
  394. if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501
  395. query_params.append(('currency', local_var_params['currency'])) # noqa: E501
  396. if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501
  397. query_params.append(('from', local_var_params['_from'])) # noqa: E501
  398. if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501
  399. query_params.append(('to', local_var_params['to'])) # noqa: E501
  400. if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
  401. query_params.append(('limit', local_var_params['limit'])) # noqa: E501
  402. if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501
  403. query_params.append(('offset', local_var_params['offset'])) # noqa: E501
  404. header_params = {}
  405. form_params = []
  406. local_var_files = {}
  407. body_params = None
  408. # HTTP header `Accept`
  409. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  410. # Authentication setting
  411. auth_settings = ['apiv4'] # noqa: E501
  412. return self.api_client.call_api(
  413. '/wallet/deposits',
  414. 'GET',
  415. path_params,
  416. query_params,
  417. header_params,
  418. body=body_params,
  419. post_params=form_params,
  420. files=local_var_files,
  421. response_type='list[LedgerRecord]', # noqa: E501
  422. auth_settings=auth_settings,
  423. async_req=local_var_params.get('async_req'),
  424. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  425. _preload_content=local_var_params.get('_preload_content', True),
  426. _request_timeout=local_var_params.get('_request_timeout'),
  427. collection_formats=collection_formats,
  428. )
  429. def transfer(self, transfer, **kwargs): # noqa: E501
  430. """Transfer between trading accounts # noqa: E501
  431. Transfer between different accounts. Currently support transfers between the following: 1. spot - margin 2. spot - futures(perpetual) 3. spot - delivery 4. spot - cross margin 5. spot - options # noqa: E501
  432. This method makes a synchronous HTTP request by default. To make an
  433. asynchronous HTTP request, please pass async_req=True
  434. >>> thread = api.transfer(transfer, async_req=True)
  435. >>> result = thread.get()
  436. :param bool async_req: execute request asynchronously
  437. :param Transfer transfer: (required)
  438. :param _preload_content: if False, the urllib3.HTTPResponse object will
  439. be returned without reading/decoding response
  440. data. Default is True.
  441. :param _request_timeout: timeout setting for this request. If one
  442. number provided, it will be total request
  443. timeout. It can also be a pair (tuple) of
  444. (connection, read) timeouts.
  445. :rtype: gate_api.TransactionID
  446. :return: If the method is called asynchronously,
  447. returns the request thread.
  448. """
  449. kwargs['_return_http_data_only'] = True
  450. return self.transfer_with_http_info(transfer, **kwargs) # noqa: E501
  451. def transfer_with_http_info(self, transfer, **kwargs): # noqa: E501
  452. """Transfer between trading accounts # noqa: E501
  453. Transfer between different accounts. Currently support transfers between the following: 1. spot - margin 2. spot - futures(perpetual) 3. spot - delivery 4. spot - cross margin 5. spot - options # noqa: E501
  454. This method makes a synchronous HTTP request by default. To make an
  455. asynchronous HTTP request, please pass async_req=True
  456. >>> thread = api.transfer_with_http_info(transfer, async_req=True)
  457. >>> result = thread.get()
  458. :param bool async_req: execute request asynchronously
  459. :param Transfer transfer: (required)
  460. :param _return_http_data_only: response data without head status code
  461. and headers
  462. :param _preload_content: if False, the urllib3.HTTPResponse object will
  463. be returned without reading/decoding response
  464. data. Default is True.
  465. :param _request_timeout: timeout setting for this request. If one
  466. number provided, it will be total request
  467. timeout. It can also be a pair (tuple) of
  468. (connection, read) timeouts.
  469. :rtype: tuple(gate_api.TransactionID, status_code(int), headers(HTTPHeaderDict))
  470. :return: If the method is called asynchronously,
  471. returns the request thread.
  472. """
  473. local_var_params = locals()
  474. all_params = ['transfer']
  475. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  476. for k, v in six.iteritems(local_var_params['kwargs']):
  477. if k not in all_params:
  478. raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method transfer" % k)
  479. local_var_params[k] = v
  480. del local_var_params['kwargs']
  481. # verify the required parameter 'transfer' is set
  482. if self.api_client.client_side_validation and (
  483. 'transfer' not in local_var_params or local_var_params['transfer'] is None # noqa: E501
  484. ): # noqa: E501
  485. raise ApiValueError("Missing the required parameter `transfer` when calling `transfer`") # noqa: E501
  486. collection_formats = {}
  487. path_params = {}
  488. query_params = []
  489. header_params = {}
  490. form_params = []
  491. local_var_files = {}
  492. body_params = None
  493. if 'transfer' in local_var_params:
  494. body_params = local_var_params['transfer']
  495. # HTTP header `Accept`
  496. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  497. # HTTP header `Content-Type`
  498. header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
  499. ['application/json']
  500. ) # noqa: E501
  501. # Authentication setting
  502. auth_settings = ['apiv4'] # noqa: E501
  503. return self.api_client.call_api(
  504. '/wallet/transfers',
  505. 'POST',
  506. path_params,
  507. query_params,
  508. header_params,
  509. body=body_params,
  510. post_params=form_params,
  511. files=local_var_files,
  512. response_type='TransactionID', # noqa: E501
  513. auth_settings=auth_settings,
  514. async_req=local_var_params.get('async_req'),
  515. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  516. _preload_content=local_var_params.get('_preload_content', True),
  517. _request_timeout=local_var_params.get('_request_timeout'),
  518. collection_formats=collection_formats,
  519. )
  520. def list_sub_account_transfers(self, **kwargs): # noqa: E501
  521. """Retrieve transfer records between main and sub accounts # noqa: E501
  522. Record time range cannot exceed 30 days > Note: only records after 2020-04-10 can be retrieved # noqa: E501
  523. This method makes a synchronous HTTP request by default. To make an
  524. asynchronous HTTP request, please pass async_req=True
  525. >>> thread = api.list_sub_account_transfers(async_req=True)
  526. >>> result = thread.get()
  527. :param bool async_req: execute request asynchronously
  528. :param str sub_uid: User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts
  529. :param int _from: Time range beginning, default to 7 days before current time
  530. :param int to: Time range ending, default to current time
  531. :param int limit: Maximum number of records to be returned in a single list
  532. :param int offset: List offset, starting from 0
  533. :param _preload_content: if False, the urllib3.HTTPResponse object will
  534. be returned without reading/decoding response
  535. data. Default is True.
  536. :param _request_timeout: timeout setting for this request. If one
  537. number provided, it will be total request
  538. timeout. It can also be a pair (tuple) of
  539. (connection, read) timeouts.
  540. :rtype: list[gate_api.SubAccountTransfer]
  541. :return: If the method is called asynchronously,
  542. returns the request thread.
  543. """
  544. kwargs['_return_http_data_only'] = True
  545. return self.list_sub_account_transfers_with_http_info(**kwargs) # noqa: E501
  546. def list_sub_account_transfers_with_http_info(self, **kwargs): # noqa: E501
  547. """Retrieve transfer records between main and sub accounts # noqa: E501
  548. Record time range cannot exceed 30 days > Note: only records after 2020-04-10 can be retrieved # noqa: E501
  549. This method makes a synchronous HTTP request by default. To make an
  550. asynchronous HTTP request, please pass async_req=True
  551. >>> thread = api.list_sub_account_transfers_with_http_info(async_req=True)
  552. >>> result = thread.get()
  553. :param bool async_req: execute request asynchronously
  554. :param str sub_uid: User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts
  555. :param int _from: Time range beginning, default to 7 days before current time
  556. :param int to: Time range ending, default to current time
  557. :param int limit: Maximum number of records to be returned in a single list
  558. :param int offset: List offset, starting from 0
  559. :param _return_http_data_only: response data without head status code
  560. and headers
  561. :param _preload_content: if False, the urllib3.HTTPResponse object will
  562. be returned without reading/decoding response
  563. data. Default is True.
  564. :param _request_timeout: timeout setting for this request. If one
  565. number provided, it will be total request
  566. timeout. It can also be a pair (tuple) of
  567. (connection, read) timeouts.
  568. :rtype: tuple(list[gate_api.SubAccountTransfer], status_code(int), headers(HTTPHeaderDict))
  569. :return: If the method is called asynchronously,
  570. returns the request thread.
  571. """
  572. local_var_params = locals()
  573. all_params = ['sub_uid', '_from', 'to', 'limit', 'offset']
  574. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  575. for k, v in six.iteritems(local_var_params['kwargs']):
  576. if k not in all_params:
  577. raise ApiTypeError(
  578. "Got an unexpected keyword argument '%s'" " to method list_sub_account_transfers" % k
  579. )
  580. local_var_params[k] = v
  581. del local_var_params['kwargs']
  582. if (
  583. self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 1000
  584. ): # noqa: E501
  585. raise ApiValueError(
  586. "Invalid value for parameter `limit` when calling `list_sub_account_transfers`, must be a value less than or equal to `1000`"
  587. ) # noqa: E501
  588. if (
  589. self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1
  590. ): # noqa: E501
  591. raise ApiValueError(
  592. "Invalid value for parameter `limit` when calling `list_sub_account_transfers`, must be a value greater than or equal to `1`"
  593. ) # noqa: E501
  594. if (
  595. self.api_client.client_side_validation and 'offset' in local_var_params and local_var_params['offset'] < 0
  596. ): # noqa: E501
  597. raise ApiValueError(
  598. "Invalid value for parameter `offset` when calling `list_sub_account_transfers`, must be a value greater than or equal to `0`"
  599. ) # noqa: E501
  600. collection_formats = {}
  601. path_params = {}
  602. query_params = []
  603. if 'sub_uid' in local_var_params and local_var_params['sub_uid'] is not None: # noqa: E501
  604. query_params.append(('sub_uid', local_var_params['sub_uid'])) # noqa: E501
  605. if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501
  606. query_params.append(('from', local_var_params['_from'])) # noqa: E501
  607. if 'to' in local_var_params and local_var_params['to'] is not None: # noqa: E501
  608. query_params.append(('to', local_var_params['to'])) # noqa: E501
  609. if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
  610. query_params.append(('limit', local_var_params['limit'])) # noqa: E501
  611. if 'offset' in local_var_params and local_var_params['offset'] is not None: # noqa: E501
  612. query_params.append(('offset', local_var_params['offset'])) # noqa: E501
  613. header_params = {}
  614. form_params = []
  615. local_var_files = {}
  616. body_params = None
  617. # HTTP header `Accept`
  618. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  619. # Authentication setting
  620. auth_settings = ['apiv4'] # noqa: E501
  621. return self.api_client.call_api(
  622. '/wallet/sub_account_transfers',
  623. 'GET',
  624. path_params,
  625. query_params,
  626. header_params,
  627. body=body_params,
  628. post_params=form_params,
  629. files=local_var_files,
  630. response_type='list[SubAccountTransfer]', # noqa: E501
  631. auth_settings=auth_settings,
  632. async_req=local_var_params.get('async_req'),
  633. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  634. _preload_content=local_var_params.get('_preload_content', True),
  635. _request_timeout=local_var_params.get('_request_timeout'),
  636. collection_formats=collection_formats,
  637. )
  638. def transfer_with_sub_account(self, sub_account_transfer, **kwargs): # noqa: E501
  639. """Transfer between main and sub accounts # noqa: E501
  640. Support transferring with sub user's spot or futures account. Note that only main user's spot account is used no matter which sub user's account is operated. # noqa: E501
  641. This method makes a synchronous HTTP request by default. To make an
  642. asynchronous HTTP request, please pass async_req=True
  643. >>> thread = api.transfer_with_sub_account(sub_account_transfer, async_req=True)
  644. >>> result = thread.get()
  645. :param bool async_req: execute request asynchronously
  646. :param SubAccountTransfer sub_account_transfer: (required)
  647. :param _preload_content: if False, the urllib3.HTTPResponse object will
  648. be returned without reading/decoding response
  649. data. Default is True.
  650. :param _request_timeout: timeout setting for this request. If one
  651. number provided, it will be total request
  652. timeout. It can also be a pair (tuple) of
  653. (connection, read) timeouts.
  654. :rtype: None
  655. :return: If the method is called asynchronously,
  656. returns the request thread.
  657. """
  658. kwargs['_return_http_data_only'] = True
  659. return self.transfer_with_sub_account_with_http_info(sub_account_transfer, **kwargs) # noqa: E501
  660. def transfer_with_sub_account_with_http_info(self, sub_account_transfer, **kwargs): # noqa: E501
  661. """Transfer between main and sub accounts # noqa: E501
  662. Support transferring with sub user's spot or futures account. Note that only main user's spot account is used no matter which sub user's account is operated. # noqa: E501
  663. This method makes a synchronous HTTP request by default. To make an
  664. asynchronous HTTP request, please pass async_req=True
  665. >>> thread = api.transfer_with_sub_account_with_http_info(sub_account_transfer, async_req=True)
  666. >>> result = thread.get()
  667. :param bool async_req: execute request asynchronously
  668. :param SubAccountTransfer sub_account_transfer: (required)
  669. :param _return_http_data_only: response data without head status code
  670. and headers
  671. :param _preload_content: if False, the urllib3.HTTPResponse object will
  672. be returned without reading/decoding response
  673. data. Default is True.
  674. :param _request_timeout: timeout setting for this request. If one
  675. number provided, it will be total request
  676. timeout. It can also be a pair (tuple) of
  677. (connection, read) timeouts.
  678. :rtype: None
  679. :return: If the method is called asynchronously,
  680. returns the request thread.
  681. """
  682. local_var_params = locals()
  683. all_params = ['sub_account_transfer']
  684. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  685. for k, v in six.iteritems(local_var_params['kwargs']):
  686. if k not in all_params:
  687. raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method transfer_with_sub_account" % k)
  688. local_var_params[k] = v
  689. del local_var_params['kwargs']
  690. # verify the required parameter 'sub_account_transfer' is set
  691. if self.api_client.client_side_validation and (
  692. 'sub_account_transfer' not in local_var_params
  693. or local_var_params['sub_account_transfer'] is None # noqa: E501
  694. ): # noqa: E501
  695. raise ApiValueError(
  696. "Missing the required parameter `sub_account_transfer` when calling `transfer_with_sub_account`"
  697. ) # noqa: E501
  698. collection_formats = {}
  699. path_params = {}
  700. query_params = []
  701. header_params = {}
  702. form_params = []
  703. local_var_files = {}
  704. body_params = None
  705. if 'sub_account_transfer' in local_var_params:
  706. body_params = local_var_params['sub_account_transfer']
  707. # HTTP header `Content-Type`
  708. header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
  709. ['application/json']
  710. ) # noqa: E501
  711. # Authentication setting
  712. auth_settings = ['apiv4'] # noqa: E501
  713. return self.api_client.call_api(
  714. '/wallet/sub_account_transfers',
  715. 'POST',
  716. path_params,
  717. query_params,
  718. header_params,
  719. body=body_params,
  720. post_params=form_params,
  721. files=local_var_files,
  722. response_type=None, # noqa: E501
  723. auth_settings=auth_settings,
  724. async_req=local_var_params.get('async_req'),
  725. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  726. _preload_content=local_var_params.get('_preload_content', True),
  727. _request_timeout=local_var_params.get('_request_timeout'),
  728. collection_formats=collection_formats,
  729. )
  730. def sub_account_to_sub_account(self, sub_account_to_sub_account, **kwargs): # noqa: E501
  731. """Sub-account transfers to sub-account # noqa: E501
  732. This method makes a synchronous HTTP request by default. To make an
  733. asynchronous HTTP request, please pass async_req=True
  734. >>> thread = api.sub_account_to_sub_account(sub_account_to_sub_account, async_req=True)
  735. >>> result = thread.get()
  736. :param bool async_req: execute request asynchronously
  737. :param SubAccountToSubAccount sub_account_to_sub_account: (required)
  738. :param _preload_content: if False, the urllib3.HTTPResponse object will
  739. be returned without reading/decoding response
  740. data. Default is True.
  741. :param _request_timeout: timeout setting for this request. If one
  742. number provided, it will be total request
  743. timeout. It can also be a pair (tuple) of
  744. (connection, read) timeouts.
  745. :rtype: None
  746. :return: If the method is called asynchronously,
  747. returns the request thread.
  748. """
  749. kwargs['_return_http_data_only'] = True
  750. return self.sub_account_to_sub_account_with_http_info(sub_account_to_sub_account, **kwargs) # noqa: E501
  751. def sub_account_to_sub_account_with_http_info(self, sub_account_to_sub_account, **kwargs): # noqa: E501
  752. """Sub-account transfers to sub-account # noqa: E501
  753. This method makes a synchronous HTTP request by default. To make an
  754. asynchronous HTTP request, please pass async_req=True
  755. >>> thread = api.sub_account_to_sub_account_with_http_info(sub_account_to_sub_account, async_req=True)
  756. >>> result = thread.get()
  757. :param bool async_req: execute request asynchronously
  758. :param SubAccountToSubAccount sub_account_to_sub_account: (required)
  759. :param _return_http_data_only: response data without head status code
  760. and headers
  761. :param _preload_content: if False, the urllib3.HTTPResponse object will
  762. be returned without reading/decoding response
  763. data. Default is True.
  764. :param _request_timeout: timeout setting for this request. If one
  765. number provided, it will be total request
  766. timeout. It can also be a pair (tuple) of
  767. (connection, read) timeouts.
  768. :rtype: None
  769. :return: If the method is called asynchronously,
  770. returns the request thread.
  771. """
  772. local_var_params = locals()
  773. all_params = ['sub_account_to_sub_account']
  774. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  775. for k, v in six.iteritems(local_var_params['kwargs']):
  776. if k not in all_params:
  777. raise ApiTypeError(
  778. "Got an unexpected keyword argument '%s'" " to method sub_account_to_sub_account" % k
  779. )
  780. local_var_params[k] = v
  781. del local_var_params['kwargs']
  782. # verify the required parameter 'sub_account_to_sub_account' is set
  783. if self.api_client.client_side_validation and (
  784. 'sub_account_to_sub_account' not in local_var_params
  785. or local_var_params['sub_account_to_sub_account'] is None # noqa: E501
  786. ): # noqa: E501
  787. raise ApiValueError(
  788. "Missing the required parameter `sub_account_to_sub_account` when calling `sub_account_to_sub_account`"
  789. ) # noqa: E501
  790. collection_formats = {}
  791. path_params = {}
  792. query_params = []
  793. header_params = {}
  794. form_params = []
  795. local_var_files = {}
  796. body_params = None
  797. if 'sub_account_to_sub_account' in local_var_params:
  798. body_params = local_var_params['sub_account_to_sub_account']
  799. # HTTP header `Content-Type`
  800. header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
  801. ['application/json']
  802. ) # noqa: E501
  803. # Authentication setting
  804. auth_settings = ['apiv4'] # noqa: E501
  805. return self.api_client.call_api(
  806. '/wallet/sub_account_to_sub_account',
  807. 'POST',
  808. path_params,
  809. query_params,
  810. header_params,
  811. body=body_params,
  812. post_params=form_params,
  813. files=local_var_files,
  814. response_type=None, # noqa: E501
  815. auth_settings=auth_settings,
  816. async_req=local_var_params.get('async_req'),
  817. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  818. _preload_content=local_var_params.get('_preload_content', True),
  819. _request_timeout=local_var_params.get('_request_timeout'),
  820. collection_formats=collection_formats,
  821. )
  822. def list_withdraw_status(self, **kwargs): # noqa: E501
  823. """Retrieve withdrawal status # noqa: E501
  824. This method makes a synchronous HTTP request by default. To make an
  825. asynchronous HTTP request, please pass async_req=True
  826. >>> thread = api.list_withdraw_status(async_req=True)
  827. >>> result = thread.get()
  828. :param bool async_req: execute request asynchronously
  829. :param str currency: Retrieve data of the specified currency
  830. :param _preload_content: if False, the urllib3.HTTPResponse object will
  831. be returned without reading/decoding response
  832. data. Default is True.
  833. :param _request_timeout: timeout setting for this request. If one
  834. number provided, it will be total request
  835. timeout. It can also be a pair (tuple) of
  836. (connection, read) timeouts.
  837. :rtype: list[gate_api.WithdrawStatus]
  838. :return: If the method is called asynchronously,
  839. returns the request thread.
  840. """
  841. kwargs['_return_http_data_only'] = True
  842. return self.list_withdraw_status_with_http_info(**kwargs) # noqa: E501
  843. def list_withdraw_status_with_http_info(self, **kwargs): # noqa: E501
  844. """Retrieve withdrawal status # noqa: E501
  845. This method makes a synchronous HTTP request by default. To make an
  846. asynchronous HTTP request, please pass async_req=True
  847. >>> thread = api.list_withdraw_status_with_http_info(async_req=True)
  848. >>> result = thread.get()
  849. :param bool async_req: execute request asynchronously
  850. :param str currency: Retrieve data of the specified currency
  851. :param _return_http_data_only: response data without head status code
  852. and headers
  853. :param _preload_content: if False, the urllib3.HTTPResponse object will
  854. be returned without reading/decoding response
  855. data. Default is True.
  856. :param _request_timeout: timeout setting for this request. If one
  857. number provided, it will be total request
  858. timeout. It can also be a pair (tuple) of
  859. (connection, read) timeouts.
  860. :rtype: tuple(list[gate_api.WithdrawStatus], status_code(int), headers(HTTPHeaderDict))
  861. :return: If the method is called asynchronously,
  862. returns the request thread.
  863. """
  864. local_var_params = locals()
  865. all_params = ['currency']
  866. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  867. for k, v in six.iteritems(local_var_params['kwargs']):
  868. if k not in all_params:
  869. raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_withdraw_status" % k)
  870. local_var_params[k] = v
  871. del local_var_params['kwargs']
  872. collection_formats = {}
  873. path_params = {}
  874. query_params = []
  875. if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501
  876. query_params.append(('currency', local_var_params['currency'])) # noqa: E501
  877. header_params = {}
  878. form_params = []
  879. local_var_files = {}
  880. body_params = None
  881. # HTTP header `Accept`
  882. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  883. # Authentication setting
  884. auth_settings = ['apiv4'] # noqa: E501
  885. return self.api_client.call_api(
  886. '/wallet/withdraw_status',
  887. 'GET',
  888. path_params,
  889. query_params,
  890. header_params,
  891. body=body_params,
  892. post_params=form_params,
  893. files=local_var_files,
  894. response_type='list[WithdrawStatus]', # noqa: E501
  895. auth_settings=auth_settings,
  896. async_req=local_var_params.get('async_req'),
  897. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  898. _preload_content=local_var_params.get('_preload_content', True),
  899. _request_timeout=local_var_params.get('_request_timeout'),
  900. collection_formats=collection_formats,
  901. )
  902. def list_sub_account_balances(self, **kwargs): # noqa: E501
  903. """Retrieve sub account balances # noqa: E501
  904. This method makes a synchronous HTTP request by default. To make an
  905. asynchronous HTTP request, please pass async_req=True
  906. >>> thread = api.list_sub_account_balances(async_req=True)
  907. >>> result = thread.get()
  908. :param bool async_req: execute request asynchronously
  909. :param str sub_uid: User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts
  910. :param _preload_content: if False, the urllib3.HTTPResponse object will
  911. be returned without reading/decoding response
  912. data. Default is True.
  913. :param _request_timeout: timeout setting for this request. If one
  914. number provided, it will be total request
  915. timeout. It can also be a pair (tuple) of
  916. (connection, read) timeouts.
  917. :rtype: list[gate_api.SubAccountBalance]
  918. :return: If the method is called asynchronously,
  919. returns the request thread.
  920. """
  921. kwargs['_return_http_data_only'] = True
  922. return self.list_sub_account_balances_with_http_info(**kwargs) # noqa: E501
  923. def list_sub_account_balances_with_http_info(self, **kwargs): # noqa: E501
  924. """Retrieve sub account balances # noqa: E501
  925. This method makes a synchronous HTTP request by default. To make an
  926. asynchronous HTTP request, please pass async_req=True
  927. >>> thread = api.list_sub_account_balances_with_http_info(async_req=True)
  928. >>> result = thread.get()
  929. :param bool async_req: execute request asynchronously
  930. :param str sub_uid: User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts
  931. :param _return_http_data_only: response data without head status code
  932. and headers
  933. :param _preload_content: if False, the urllib3.HTTPResponse object will
  934. be returned without reading/decoding response
  935. data. Default is True.
  936. :param _request_timeout: timeout setting for this request. If one
  937. number provided, it will be total request
  938. timeout. It can also be a pair (tuple) of
  939. (connection, read) timeouts.
  940. :rtype: tuple(list[gate_api.SubAccountBalance], status_code(int), headers(HTTPHeaderDict))
  941. :return: If the method is called asynchronously,
  942. returns the request thread.
  943. """
  944. local_var_params = locals()
  945. all_params = ['sub_uid']
  946. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  947. for k, v in six.iteritems(local_var_params['kwargs']):
  948. if k not in all_params:
  949. raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_sub_account_balances" % k)
  950. local_var_params[k] = v
  951. del local_var_params['kwargs']
  952. collection_formats = {}
  953. path_params = {}
  954. query_params = []
  955. if 'sub_uid' in local_var_params and local_var_params['sub_uid'] is not None: # noqa: E501
  956. query_params.append(('sub_uid', local_var_params['sub_uid'])) # noqa: E501
  957. header_params = {}
  958. form_params = []
  959. local_var_files = {}
  960. body_params = None
  961. # HTTP header `Accept`
  962. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  963. # Authentication setting
  964. auth_settings = ['apiv4'] # noqa: E501
  965. return self.api_client.call_api(
  966. '/wallet/sub_account_balances',
  967. 'GET',
  968. path_params,
  969. query_params,
  970. header_params,
  971. body=body_params,
  972. post_params=form_params,
  973. files=local_var_files,
  974. response_type='list[SubAccountBalance]', # noqa: E501
  975. auth_settings=auth_settings,
  976. async_req=local_var_params.get('async_req'),
  977. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  978. _preload_content=local_var_params.get('_preload_content', True),
  979. _request_timeout=local_var_params.get('_request_timeout'),
  980. collection_formats=collection_formats,
  981. )
  982. def list_sub_account_margin_balances(self, **kwargs): # noqa: E501
  983. """Query sub accounts' margin balances # noqa: E501
  984. This method makes a synchronous HTTP request by default. To make an
  985. asynchronous HTTP request, please pass async_req=True
  986. >>> thread = api.list_sub_account_margin_balances(async_req=True)
  987. >>> result = thread.get()
  988. :param bool async_req: execute request asynchronously
  989. :param str sub_uid: User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts
  990. :param _preload_content: if False, the urllib3.HTTPResponse object will
  991. be returned without reading/decoding response
  992. data. Default is True.
  993. :param _request_timeout: timeout setting for this request. If one
  994. number provided, it will be total request
  995. timeout. It can also be a pair (tuple) of
  996. (connection, read) timeouts.
  997. :rtype: list[gate_api.SubAccountMarginBalance]
  998. :return: If the method is called asynchronously,
  999. returns the request thread.
  1000. """
  1001. kwargs['_return_http_data_only'] = True
  1002. return self.list_sub_account_margin_balances_with_http_info(**kwargs) # noqa: E501
  1003. def list_sub_account_margin_balances_with_http_info(self, **kwargs): # noqa: E501
  1004. """Query sub accounts' margin balances # noqa: E501
  1005. This method makes a synchronous HTTP request by default. To make an
  1006. asynchronous HTTP request, please pass async_req=True
  1007. >>> thread = api.list_sub_account_margin_balances_with_http_info(async_req=True)
  1008. >>> result = thread.get()
  1009. :param bool async_req: execute request asynchronously
  1010. :param str sub_uid: User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts
  1011. :param _return_http_data_only: response data without head status code
  1012. and headers
  1013. :param _preload_content: if False, the urllib3.HTTPResponse object will
  1014. be returned without reading/decoding response
  1015. data. Default is True.
  1016. :param _request_timeout: timeout setting for this request. If one
  1017. number provided, it will be total request
  1018. timeout. It can also be a pair (tuple) of
  1019. (connection, read) timeouts.
  1020. :rtype: tuple(list[gate_api.SubAccountMarginBalance], status_code(int), headers(HTTPHeaderDict))
  1021. :return: If the method is called asynchronously,
  1022. returns the request thread.
  1023. """
  1024. local_var_params = locals()
  1025. all_params = ['sub_uid']
  1026. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  1027. for k, v in six.iteritems(local_var_params['kwargs']):
  1028. if k not in all_params:
  1029. raise ApiTypeError(
  1030. "Got an unexpected keyword argument '%s'" " to method list_sub_account_margin_balances" % k
  1031. )
  1032. local_var_params[k] = v
  1033. del local_var_params['kwargs']
  1034. collection_formats = {}
  1035. path_params = {}
  1036. query_params = []
  1037. if 'sub_uid' in local_var_params and local_var_params['sub_uid'] is not None: # noqa: E501
  1038. query_params.append(('sub_uid', local_var_params['sub_uid'])) # noqa: E501
  1039. header_params = {}
  1040. form_params = []
  1041. local_var_files = {}
  1042. body_params = None
  1043. # HTTP header `Accept`
  1044. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  1045. # Authentication setting
  1046. auth_settings = ['apiv4'] # noqa: E501
  1047. return self.api_client.call_api(
  1048. '/wallet/sub_account_margin_balances',
  1049. 'GET',
  1050. path_params,
  1051. query_params,
  1052. header_params,
  1053. body=body_params,
  1054. post_params=form_params,
  1055. files=local_var_files,
  1056. response_type='list[SubAccountMarginBalance]', # noqa: E501
  1057. auth_settings=auth_settings,
  1058. async_req=local_var_params.get('async_req'),
  1059. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  1060. _preload_content=local_var_params.get('_preload_content', True),
  1061. _request_timeout=local_var_params.get('_request_timeout'),
  1062. collection_formats=collection_formats,
  1063. )
  1064. def list_sub_account_futures_balances(self, **kwargs): # noqa: E501
  1065. """Query sub accounts' futures account balances # noqa: E501
  1066. This method makes a synchronous HTTP request by default. To make an
  1067. asynchronous HTTP request, please pass async_req=True
  1068. >>> thread = api.list_sub_account_futures_balances(async_req=True)
  1069. >>> result = thread.get()
  1070. :param bool async_req: execute request asynchronously
  1071. :param str sub_uid: User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts
  1072. :param str settle: Query only balances of specified settle currency
  1073. :param _preload_content: if False, the urllib3.HTTPResponse object will
  1074. be returned without reading/decoding response
  1075. data. Default is True.
  1076. :param _request_timeout: timeout setting for this request. If one
  1077. number provided, it will be total request
  1078. timeout. It can also be a pair (tuple) of
  1079. (connection, read) timeouts.
  1080. :rtype: list[gate_api.SubAccountFuturesBalance]
  1081. :return: If the method is called asynchronously,
  1082. returns the request thread.
  1083. """
  1084. kwargs['_return_http_data_only'] = True
  1085. return self.list_sub_account_futures_balances_with_http_info(**kwargs) # noqa: E501
  1086. def list_sub_account_futures_balances_with_http_info(self, **kwargs): # noqa: E501
  1087. """Query sub accounts' futures account balances # noqa: E501
  1088. This method makes a synchronous HTTP request by default. To make an
  1089. asynchronous HTTP request, please pass async_req=True
  1090. >>> thread = api.list_sub_account_futures_balances_with_http_info(async_req=True)
  1091. >>> result = thread.get()
  1092. :param bool async_req: execute request asynchronously
  1093. :param str sub_uid: User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts
  1094. :param str settle: Query only balances of specified settle currency
  1095. :param _return_http_data_only: response data without head status code
  1096. and headers
  1097. :param _preload_content: if False, the urllib3.HTTPResponse object will
  1098. be returned without reading/decoding response
  1099. data. Default is True.
  1100. :param _request_timeout: timeout setting for this request. If one
  1101. number provided, it will be total request
  1102. timeout. It can also be a pair (tuple) of
  1103. (connection, read) timeouts.
  1104. :rtype: tuple(list[gate_api.SubAccountFuturesBalance], status_code(int), headers(HTTPHeaderDict))
  1105. :return: If the method is called asynchronously,
  1106. returns the request thread.
  1107. """
  1108. local_var_params = locals()
  1109. all_params = ['sub_uid', 'settle']
  1110. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  1111. for k, v in six.iteritems(local_var_params['kwargs']):
  1112. if k not in all_params:
  1113. raise ApiTypeError(
  1114. "Got an unexpected keyword argument '%s'" " to method list_sub_account_futures_balances" % k
  1115. )
  1116. local_var_params[k] = v
  1117. del local_var_params['kwargs']
  1118. collection_formats = {}
  1119. path_params = {}
  1120. query_params = []
  1121. if 'sub_uid' in local_var_params and local_var_params['sub_uid'] is not None: # noqa: E501
  1122. query_params.append(('sub_uid', local_var_params['sub_uid'])) # noqa: E501
  1123. if 'settle' in local_var_params and local_var_params['settle'] is not None: # noqa: E501
  1124. query_params.append(('settle', local_var_params['settle'])) # noqa: E501
  1125. header_params = {}
  1126. form_params = []
  1127. local_var_files = {}
  1128. body_params = None
  1129. # HTTP header `Accept`
  1130. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  1131. # Authentication setting
  1132. auth_settings = ['apiv4'] # noqa: E501
  1133. return self.api_client.call_api(
  1134. '/wallet/sub_account_futures_balances',
  1135. 'GET',
  1136. path_params,
  1137. query_params,
  1138. header_params,
  1139. body=body_params,
  1140. post_params=form_params,
  1141. files=local_var_files,
  1142. response_type='list[SubAccountFuturesBalance]', # noqa: E501
  1143. auth_settings=auth_settings,
  1144. async_req=local_var_params.get('async_req'),
  1145. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  1146. _preload_content=local_var_params.get('_preload_content', True),
  1147. _request_timeout=local_var_params.get('_request_timeout'),
  1148. collection_formats=collection_formats,
  1149. )
  1150. def list_sub_account_cross_margin_balances(self, **kwargs): # noqa: E501
  1151. """Query subaccount's cross_margin account info # noqa: E501
  1152. This method makes a synchronous HTTP request by default. To make an
  1153. asynchronous HTTP request, please pass async_req=True
  1154. >>> thread = api.list_sub_account_cross_margin_balances(async_req=True)
  1155. >>> result = thread.get()
  1156. :param bool async_req: execute request asynchronously
  1157. :param str sub_uid: User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts
  1158. :param _preload_content: if False, the urllib3.HTTPResponse object will
  1159. be returned without reading/decoding response
  1160. data. Default is True.
  1161. :param _request_timeout: timeout setting for this request. If one
  1162. number provided, it will be total request
  1163. timeout. It can also be a pair (tuple) of
  1164. (connection, read) timeouts.
  1165. :rtype: list[gate_api.SubAccountCrossMarginBalance]
  1166. :return: If the method is called asynchronously,
  1167. returns the request thread.
  1168. """
  1169. kwargs['_return_http_data_only'] = True
  1170. return self.list_sub_account_cross_margin_balances_with_http_info(**kwargs) # noqa: E501
  1171. def list_sub_account_cross_margin_balances_with_http_info(self, **kwargs): # noqa: E501
  1172. """Query subaccount's cross_margin account info # noqa: E501
  1173. This method makes a synchronous HTTP request by default. To make an
  1174. asynchronous HTTP request, please pass async_req=True
  1175. >>> thread = api.list_sub_account_cross_margin_balances_with_http_info(async_req=True)
  1176. >>> result = thread.get()
  1177. :param bool async_req: execute request asynchronously
  1178. :param str sub_uid: User ID of sub-account, you can query multiple records separated by `,`. If not specified, it will return the records of all sub accounts
  1179. :param _return_http_data_only: response data without head status code
  1180. and headers
  1181. :param _preload_content: if False, the urllib3.HTTPResponse object will
  1182. be returned without reading/decoding response
  1183. data. Default is True.
  1184. :param _request_timeout: timeout setting for this request. If one
  1185. number provided, it will be total request
  1186. timeout. It can also be a pair (tuple) of
  1187. (connection, read) timeouts.
  1188. :rtype: tuple(list[gate_api.SubAccountCrossMarginBalance], status_code(int), headers(HTTPHeaderDict))
  1189. :return: If the method is called asynchronously,
  1190. returns the request thread.
  1191. """
  1192. local_var_params = locals()
  1193. all_params = ['sub_uid']
  1194. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  1195. for k, v in six.iteritems(local_var_params['kwargs']):
  1196. if k not in all_params:
  1197. raise ApiTypeError(
  1198. "Got an unexpected keyword argument '%s'" " to method list_sub_account_cross_margin_balances" % k
  1199. )
  1200. local_var_params[k] = v
  1201. del local_var_params['kwargs']
  1202. collection_formats = {}
  1203. path_params = {}
  1204. query_params = []
  1205. if 'sub_uid' in local_var_params and local_var_params['sub_uid'] is not None: # noqa: E501
  1206. query_params.append(('sub_uid', local_var_params['sub_uid'])) # noqa: E501
  1207. header_params = {}
  1208. form_params = []
  1209. local_var_files = {}
  1210. body_params = None
  1211. # HTTP header `Accept`
  1212. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  1213. # Authentication setting
  1214. auth_settings = ['apiv4'] # noqa: E501
  1215. return self.api_client.call_api(
  1216. '/wallet/sub_account_cross_margin_balances',
  1217. 'GET',
  1218. path_params,
  1219. query_params,
  1220. header_params,
  1221. body=body_params,
  1222. post_params=form_params,
  1223. files=local_var_files,
  1224. response_type='list[SubAccountCrossMarginBalance]', # noqa: E501
  1225. auth_settings=auth_settings,
  1226. async_req=local_var_params.get('async_req'),
  1227. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  1228. _preload_content=local_var_params.get('_preload_content', True),
  1229. _request_timeout=local_var_params.get('_request_timeout'),
  1230. collection_formats=collection_formats,
  1231. )
  1232. def list_saved_address(self, currency, **kwargs): # noqa: E501
  1233. """Query saved address # noqa: E501
  1234. This method makes a synchronous HTTP request by default. To make an
  1235. asynchronous HTTP request, please pass async_req=True
  1236. >>> thread = api.list_saved_address(currency, async_req=True)
  1237. >>> result = thread.get()
  1238. :param bool async_req: execute request asynchronously
  1239. :param str currency: Currency (required)
  1240. :param str chain: Chain name
  1241. :param str limit: Maximum number returned, 100 at most
  1242. :param _preload_content: if False, the urllib3.HTTPResponse object will
  1243. be returned without reading/decoding response
  1244. data. Default is True.
  1245. :param _request_timeout: timeout setting for this request. If one
  1246. number provided, it will be total request
  1247. timeout. It can also be a pair (tuple) of
  1248. (connection, read) timeouts.
  1249. :rtype: list[gate_api.SavedAddress]
  1250. :return: If the method is called asynchronously,
  1251. returns the request thread.
  1252. """
  1253. kwargs['_return_http_data_only'] = True
  1254. return self.list_saved_address_with_http_info(currency, **kwargs) # noqa: E501
  1255. def list_saved_address_with_http_info(self, currency, **kwargs): # noqa: E501
  1256. """Query saved address # noqa: E501
  1257. This method makes a synchronous HTTP request by default. To make an
  1258. asynchronous HTTP request, please pass async_req=True
  1259. >>> thread = api.list_saved_address_with_http_info(currency, async_req=True)
  1260. >>> result = thread.get()
  1261. :param bool async_req: execute request asynchronously
  1262. :param str currency: Currency (required)
  1263. :param str chain: Chain name
  1264. :param str limit: Maximum number returned, 100 at most
  1265. :param _return_http_data_only: response data without head status code
  1266. and headers
  1267. :param _preload_content: if False, the urllib3.HTTPResponse object will
  1268. be returned without reading/decoding response
  1269. data. Default is True.
  1270. :param _request_timeout: timeout setting for this request. If one
  1271. number provided, it will be total request
  1272. timeout. It can also be a pair (tuple) of
  1273. (connection, read) timeouts.
  1274. :rtype: tuple(list[gate_api.SavedAddress], status_code(int), headers(HTTPHeaderDict))
  1275. :return: If the method is called asynchronously,
  1276. returns the request thread.
  1277. """
  1278. local_var_params = locals()
  1279. all_params = ['currency', 'chain', 'limit']
  1280. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  1281. for k, v in six.iteritems(local_var_params['kwargs']):
  1282. if k not in all_params:
  1283. raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_saved_address" % k)
  1284. local_var_params[k] = v
  1285. del local_var_params['kwargs']
  1286. # verify the required parameter 'currency' is set
  1287. if self.api_client.client_side_validation and (
  1288. 'currency' not in local_var_params or local_var_params['currency'] is None # noqa: E501
  1289. ): # noqa: E501
  1290. raise ApiValueError(
  1291. "Missing the required parameter `currency` when calling `list_saved_address`"
  1292. ) # noqa: E501
  1293. collection_formats = {}
  1294. path_params = {}
  1295. query_params = []
  1296. if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501
  1297. query_params.append(('currency', local_var_params['currency'])) # noqa: E501
  1298. if 'chain' in local_var_params and local_var_params['chain'] is not None: # noqa: E501
  1299. query_params.append(('chain', local_var_params['chain'])) # noqa: E501
  1300. if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501
  1301. query_params.append(('limit', local_var_params['limit'])) # noqa: E501
  1302. header_params = {}
  1303. form_params = []
  1304. local_var_files = {}
  1305. body_params = None
  1306. # HTTP header `Accept`
  1307. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  1308. # Authentication setting
  1309. auth_settings = ['apiv4'] # noqa: E501
  1310. return self.api_client.call_api(
  1311. '/wallet/saved_address',
  1312. 'GET',
  1313. path_params,
  1314. query_params,
  1315. header_params,
  1316. body=body_params,
  1317. post_params=form_params,
  1318. files=local_var_files,
  1319. response_type='list[SavedAddress]', # noqa: E501
  1320. auth_settings=auth_settings,
  1321. async_req=local_var_params.get('async_req'),
  1322. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  1323. _preload_content=local_var_params.get('_preload_content', True),
  1324. _request_timeout=local_var_params.get('_request_timeout'),
  1325. collection_formats=collection_formats,
  1326. )
  1327. def get_trade_fee(self, **kwargs): # noqa: E501
  1328. """Retrieve personal trading fee # noqa: E501
  1329. This method makes a synchronous HTTP request by default. To make an
  1330. asynchronous HTTP request, please pass async_req=True
  1331. >>> thread = api.get_trade_fee(async_req=True)
  1332. >>> result = thread.get()
  1333. :param bool async_req: execute request asynchronously
  1334. :param str currency_pair: Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs
  1335. :param str settle: Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same.
  1336. :param _preload_content: if False, the urllib3.HTTPResponse object will
  1337. be returned without reading/decoding response
  1338. data. Default is True.
  1339. :param _request_timeout: timeout setting for this request. If one
  1340. number provided, it will be total request
  1341. timeout. It can also be a pair (tuple) of
  1342. (connection, read) timeouts.
  1343. :rtype: gate_api.TradeFee
  1344. :return: If the method is called asynchronously,
  1345. returns the request thread.
  1346. """
  1347. kwargs['_return_http_data_only'] = True
  1348. return self.get_trade_fee_with_http_info(**kwargs) # noqa: E501
  1349. def get_trade_fee_with_http_info(self, **kwargs): # noqa: E501
  1350. """Retrieve personal trading fee # noqa: E501
  1351. This method makes a synchronous HTTP request by default. To make an
  1352. asynchronous HTTP request, please pass async_req=True
  1353. >>> thread = api.get_trade_fee_with_http_info(async_req=True)
  1354. >>> result = thread.get()
  1355. :param bool async_req: execute request asynchronously
  1356. :param str currency_pair: Specify a currency pair to retrieve precise fee rate This field is optional. In most cases, the fee rate is identical among all currency pairs
  1357. :param str settle: Specify the settlement currency of the contract to get more accurate rate settings This field is optional. Generally, the rate settings for all settlement currencies are the same.
  1358. :param _return_http_data_only: response data without head status code
  1359. and headers
  1360. :param _preload_content: if False, the urllib3.HTTPResponse object will
  1361. be returned without reading/decoding response
  1362. data. Default is True.
  1363. :param _request_timeout: timeout setting for this request. If one
  1364. number provided, it will be total request
  1365. timeout. It can also be a pair (tuple) of
  1366. (connection, read) timeouts.
  1367. :rtype: tuple(gate_api.TradeFee, status_code(int), headers(HTTPHeaderDict))
  1368. :return: If the method is called asynchronously,
  1369. returns the request thread.
  1370. """
  1371. local_var_params = locals()
  1372. all_params = ['currency_pair', 'settle']
  1373. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  1374. for k, v in six.iteritems(local_var_params['kwargs']):
  1375. if k not in all_params:
  1376. raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_trade_fee" % k)
  1377. local_var_params[k] = v
  1378. del local_var_params['kwargs']
  1379. collection_formats = {}
  1380. path_params = {}
  1381. query_params = []
  1382. if 'currency_pair' in local_var_params and local_var_params['currency_pair'] is not None: # noqa: E501
  1383. query_params.append(('currency_pair', local_var_params['currency_pair'])) # noqa: E501
  1384. if 'settle' in local_var_params and local_var_params['settle'] is not None: # noqa: E501
  1385. query_params.append(('settle', local_var_params['settle'])) # noqa: E501
  1386. header_params = {}
  1387. form_params = []
  1388. local_var_files = {}
  1389. body_params = None
  1390. # HTTP header `Accept`
  1391. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  1392. # Authentication setting
  1393. auth_settings = ['apiv4'] # noqa: E501
  1394. return self.api_client.call_api(
  1395. '/wallet/fee',
  1396. 'GET',
  1397. path_params,
  1398. query_params,
  1399. header_params,
  1400. body=body_params,
  1401. post_params=form_params,
  1402. files=local_var_files,
  1403. response_type='TradeFee', # noqa: E501
  1404. auth_settings=auth_settings,
  1405. async_req=local_var_params.get('async_req'),
  1406. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  1407. _preload_content=local_var_params.get('_preload_content', True),
  1408. _request_timeout=local_var_params.get('_request_timeout'),
  1409. collection_formats=collection_formats,
  1410. )
  1411. def get_total_balance(self, **kwargs): # noqa: E501
  1412. """Retrieve user's total balances # noqa: E501
  1413. This endpoint returns an approximate sum of exchanged amount from all currencies to input currency for each account.The exchange rate and account balance could have been cached for at most 1 minute. It is not recommended to use its result for any trading calculation. For trading calculation, use the corresponding account query endpoint for each account type. For example: - `GET /spot/accounts` to query spot account balance - `GET /margin/accounts` to query margin account balance - `GET /futures/{settle}/accounts` to query futures account balance # noqa: E501
  1414. This method makes a synchronous HTTP request by default. To make an
  1415. asynchronous HTTP request, please pass async_req=True
  1416. >>> thread = api.get_total_balance(async_req=True)
  1417. >>> result = thread.get()
  1418. :param bool async_req: execute request asynchronously
  1419. :param str currency: Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default.
  1420. :param _preload_content: if False, the urllib3.HTTPResponse object will
  1421. be returned without reading/decoding response
  1422. data. Default is True.
  1423. :param _request_timeout: timeout setting for this request. If one
  1424. number provided, it will be total request
  1425. timeout. It can also be a pair (tuple) of
  1426. (connection, read) timeouts.
  1427. :rtype: gate_api.TotalBalance
  1428. :return: If the method is called asynchronously,
  1429. returns the request thread.
  1430. """
  1431. kwargs['_return_http_data_only'] = True
  1432. return self.get_total_balance_with_http_info(**kwargs) # noqa: E501
  1433. def get_total_balance_with_http_info(self, **kwargs): # noqa: E501
  1434. """Retrieve user's total balances # noqa: E501
  1435. This endpoint returns an approximate sum of exchanged amount from all currencies to input currency for each account.The exchange rate and account balance could have been cached for at most 1 minute. It is not recommended to use its result for any trading calculation. For trading calculation, use the corresponding account query endpoint for each account type. For example: - `GET /spot/accounts` to query spot account balance - `GET /margin/accounts` to query margin account balance - `GET /futures/{settle}/accounts` to query futures account balance # noqa: E501
  1436. This method makes a synchronous HTTP request by default. To make an
  1437. asynchronous HTTP request, please pass async_req=True
  1438. >>> thread = api.get_total_balance_with_http_info(async_req=True)
  1439. >>> result = thread.get()
  1440. :param bool async_req: execute request asynchronously
  1441. :param str currency: Currency unit used to calculate the balance amount. BTC, CNY, USD and USDT are allowed. USDT is the default.
  1442. :param _return_http_data_only: response data without head status code
  1443. and headers
  1444. :param _preload_content: if False, the urllib3.HTTPResponse object will
  1445. be returned without reading/decoding response
  1446. data. Default is True.
  1447. :param _request_timeout: timeout setting for this request. If one
  1448. number provided, it will be total request
  1449. timeout. It can also be a pair (tuple) of
  1450. (connection, read) timeouts.
  1451. :rtype: tuple(gate_api.TotalBalance, status_code(int), headers(HTTPHeaderDict))
  1452. :return: If the method is called asynchronously,
  1453. returns the request thread.
  1454. """
  1455. local_var_params = locals()
  1456. all_params = ['currency']
  1457. all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout'])
  1458. for k, v in six.iteritems(local_var_params['kwargs']):
  1459. if k not in all_params:
  1460. raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_total_balance" % k)
  1461. local_var_params[k] = v
  1462. del local_var_params['kwargs']
  1463. collection_formats = {}
  1464. path_params = {}
  1465. query_params = []
  1466. if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501
  1467. query_params.append(('currency', local_var_params['currency'])) # noqa: E501
  1468. header_params = {}
  1469. form_params = []
  1470. local_var_files = {}
  1471. body_params = None
  1472. # HTTP header `Accept`
  1473. header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501
  1474. # Authentication setting
  1475. auth_settings = ['apiv4'] # noqa: E501
  1476. return self.api_client.call_api(
  1477. '/wallet/total_balance',
  1478. 'GET',
  1479. path_params,
  1480. query_params,
  1481. header_params,
  1482. body=body_params,
  1483. post_params=form_params,
  1484. files=local_var_files,
  1485. response_type='TotalBalance', # noqa: E501
  1486. auth_settings=auth_settings,
  1487. async_req=local_var_params.get('async_req'),
  1488. _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
  1489. _preload_content=local_var_params.get('_preload_content', True),
  1490. _request_timeout=local_var_params.get('_request_timeout'),
  1491. collection_formats=collection_formats,
  1492. )