Account Endpoints¶
-
class
kucoin.client.
Client
(api_key, api_secret, passphrase, sandbox=False, requests_params=None)[source] -
cancel_withdrawal
(withdrawal_id)[source] Cancel a withdrawal
https://docs.kucoin.com/#cancel-withdrawal
Parameters: withdrawal_id (string) – ID of withdrawal client.cancel_withdrawal('5bffb63303aa675e8bbe18f9')
Returns: None Raises: KucoinResponseException, KucoinAPIException
-
create_account
(account_type, currency)[source] Create an account
https://docs.kucoin.com/#create-an-account
Parameters: - account_type (string) – Account type - main or trade
- currency (string) – Currency code
account = client.create_account('trade', 'BTC')
Returns: API Response { "id": "5bd6e9286d99522a52e458de" }
Raises: KucoinResponseException, KucoinAPIException
-
create_deposit_address
(currency)[source] Create deposit address of currency for deposit. You can just create one deposit address.
https://docs.kucoin.com/#create-deposit-address
Parameters: currency (string) – Name of currency address = client.create_deposit_address('NEO')
Returns: ApiResponse { "address": "0x78d3ad1c0aa1bf068e19c94a2d7b16c9c0fcd8b1", "memo": "5c247c8a03aa677cea2a251d" }
Raises: KucoinResponseException, KucoinAPIException
-
create_inner_transfer
(from_account_id, to_account_id, amount, order_id=None)[source] Get account holds placed for any active orders or pending withdraw requests
https://docs.kucoin.com/#get-holds
Parameters: - from_account_id (str) – ID of account to transfer funds from - from list_accounts()
- to_account_id (str) – ID of account to transfer funds to - from list_accounts()
- amount (int) – Amount to transfer
- order_id (string) – (optional) Request ID (default flat_uuid())
transfer = client.create_inner_transfer('5bd6e9216d99522a52e458d6', 5bc7f080b39c5c03286eef8e', 20)
Returns: API Response { "orderId": "5bd6e9286d99522a52e458de" }
Raises: KucoinResponseException, KucoinAPIException
-
create_withdrawal
(currency, amount, address, memo=None, is_inner=False, remark=None)[source] Process a withdrawal
https://docs.kucoin.com/#apply-withdraw
Parameters: - currency (string) – Name of currency
- amount (number) – Amount to withdraw
- address (string) – Address to withdraw to
- memo (string) – (optional) Remark to the withdrawal address
- is_inner (bool) – (optional) Remark to the withdrawal address
- remark (string) – (optional) Remark
withdrawal = client.create_withdrawal('NEO', 20, '598aeb627da3355fa3e851')
Returns: ApiResponse { "withdrawalId": "5bffb63303aa675e8bbe18f9" }
Raises: KucoinResponseException, KucoinAPIException
-
get_account
(account_id)[source] Get an individual account
https://docs.kucoin.com/#get-an-account
Parameters: account_id (string) – ID for account - from list_accounts() account = client.get_account('5bd6e9216d99522a52e458d6')
Returns: API Response { "currency": "KCS", "balance": "1000000060.6299", "available": "1000000060.6299", "holds": "0" }
Raises: KucoinResponseException, KucoinAPIException
-
get_account_holds
(account_id, page=None, page_size=None)[source] Get account holds placed for any active orders or pending withdraw requests
https://docs.kucoin.com/#get-holds
Parameters: - account_id (string) – ID for account - from list_accounts()
- page (int) – (optional) Current page - default 1
- page_size (int) – (optional) Number of results to return - default 50
holds = client.get_account_holds('5bd6e9216d99522a52e458d6') holds = client.get_account_holds('5bd6e9216d99522a52e458d6', page=2, page_size=10)
Returns: API Response { "currentPage": 1, "pageSize": 10, "totalNum": 2, "totalPage": 1, "items": [ { "currency": "ETH", "holdAmount": "5083", "bizType": "Withdraw", "orderId": "5bc7f080b39c5c03286eef8e", "createdAt": 1545898567000, "updatedAt": 1545898567000 }, { "currency": "ETH", "holdAmount": "1452", "bizType": "Withdraw", "orderId": "5bc7f518b39c5c033818d62d", "createdAt": 1545898567000, "updatedAt": 1545898567000 } ] }
Raises: KucoinResponseException, KucoinAPIException
-
get_accounts
()[source] Get a list of accounts
https://docs.kucoin.com/#accounts
accounts = client.get_accounts()
Returns: API Response [ { "id": "5bd6e9286d99522a52e458de", "currency": "BTC", "type": "main", "balance": "237582.04299", "available": "237582.032", "holds": "0.01099" }, { "id": "5bd6e9216d99522a52e458d6", "currency": "BTC", "type": "trade", "balance": "1234356", "available": "1234356", "holds": "0" } ]
Raises: KucoinResponseException, KucoinAPIException
-
get_deposit_address
(currency)[source] Get deposit address for a currency
https://docs.kucoin.com/#get-deposit-address
Parameters: currency (string) – Name of currency address = client.get_deposit_address('NEO')
Returns: ApiResponse { "address": "0x78d3ad1c0aa1bf068e19c94a2d7b16c9c0fcd8b1", "memo": "5c247c8a03aa677cea2a251d" }
Raises: KucoinResponseException, KucoinAPIException
-
get_deposits
(currency=None, status=None, start=None, end=None, page=None, limit=None)[source] Get deposit records for a currency
https://docs.kucoin.com/#get-deposit-list
Parameters: - currency (string) – Name of currency (optional)
- status (string) – optional - Status of deposit (PROCESSING, SUCCESS, FAILURE)
- start (string) – (optional) Start time as unix timestamp
- end (string) – (optional) End time as unix timestamp
- page (int) – (optional) Page to fetch
- limit (int) – (optional) Number of transactions
deposits = client.get_deposits('NEO')
Returns: ApiResponse { "currentPage": 1, "pageSize": 5, "totalNum": 2, "totalPage": 1, "items": [ { "address": "0x5f047b29041bcfdbf0e4478cdfa753a336ba6989", "memo": "5c247c8a03aa677cea2a251d", "amount": 1, "fee": 0.0001, "currency": "KCS", "isInner": false, "walletTxId": "5bbb57386d99522d9f954c5a@test004", "status": "SUCCESS", "createdAt": 1544178843000, "updatedAt": 1544178891000 }, { "address": "0x5f047b29041bcfdbf0e4478cdfa753a336ba6989", "memo": "5c247c8a03aa677cea2a251d", "amount": 1, "fee": 0.0001, "currency": "KCS", "isInner": false, "walletTxId": "5bbb57386d99522d9f954c5a@test003", "status": "SUCCESS", "createdAt": 1544177654000, "updatedAt": 1544178733000 } ] }
Raises: KucoinResponseException, KucoinAPIException
-
get_withdrawal_quotas
(currency)[source] Get withdrawal quotas for a currency
https://docs.kucoin.com/#get-withdrawal-quotas
Parameters: currency (string) – Name of currency quotas = client.get_withdrawal_quotas('ETH')
Returns: ApiResponse { "currency": "ETH", "availableAmount": 2.9719999, "remainAmount": 2.9719999, "withdrawMinSize": 0.1000000, "limitBTCAmount": 2.0, "innerWithdrawMinFee": 0.00001, "isWithdrawEnabled": true, "withdrawMinFee": 0.0100000, "precision": 7 }
Raises: KucoinResponseException, KucoinAPIException
-
get_withdrawals
(currency=None, status=None, start=None, end=None, page=None, limit=None)[source] Get deposit records for a currency
https://docs.kucoin.com/#get-withdrawals-list
Parameters: - currency (string) – Name of currency (optional)
- status (string) – optional - Status of deposit (PROCESSING, SUCCESS, FAILURE)
- start (string) – (optional) Start time as unix timestamp
- end (string) – (optional) End time as unix timestamp
- page (int) – (optional) Page to fetch
- limit (int) – (optional) Number of transactions
withdrawals = client.get_withdrawals('NEO')
Returns: ApiResponse { "currentPage": 1, "pageSize": 10, "totalNum": 1, "totalPage": 1, "items": [ { "id": "5c2dc64e03aa675aa263f1ac", "address": "0x5bedb060b8eb8d823e2414d82acce78d38be7fe9", "memo": "", "currency": "ETH", "amount": 1.0000000, "fee": 0.0100000, "walletTxId": "3e2414d82acce78d38be7fe9", "isInner": false, "status": "FAILURE", "createdAt": 1546503758000, "updatedAt": 1546504603000 } ] }
Raises: KucoinResponseException, KucoinAPIException
-