forked from btcccorp/btcchina-api-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbtcchina-client.py
More file actions
60 lines (47 loc) · 1.75 KB
/
btcchina-client.py
File metadata and controls
60 lines (47 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/python
# -*- coding: utf-8 -*-
import btcchina
access_key="YOUR_ACCESS_KEY"
secret_key="YOUR_SECRET_KEY"
bc = btcchina.BTCChina(access_key,secret_key)
''' These methods have no arguments '''
#result = bc.get_account_info()
#print result
#result = bc.get_market_depth2()
#print result
# NOTE: for all methods shown here, the transaction ID could be set by doing
#result = bc.get_account_info(post_data={'id':'stuff'})
#print result
''' buy and sell require price (CNY, 5 decimals) and amount (LTC/BTC, 8 decimals) '''
#result = bc.buy(500,1)
#print result
#result = bc.sell(500,1)
#print result
''' cancel requires id number of order '''
#result = bc.cancel(2)
#print result
''' request withdrawal requires currency and amount '''
#result = bc.request_withdrawal('BTC',0.1)
#print result
''' get deposits requires currency. the optional "pending" defaults to true '''
#result = bc.get_deposits('BTC',pending=False)
#print result
''' get orders returns status for one order if ID is specified,
otherwise returns all orders, the optional "open_only" defaults to true '''
#result = bc.get_orders(2)
#print result
#result = bc.get_orders(open_only=True)
#print result
''' get withdrawals returns status for one transaction if ID is specified,
if currency is specified it returns all transactions,
the optional "pending" defaults to true '''
#result = bc.get_withdrawals(2)
#print result
#result = bc.get_withdrawals('BTC',pending=True)
#print result
''' Fetch transactions by type. Default is 'all'.
Available types 'all | fundbtc | withdrawbtc | fundmoney | withdrawmoney |
refundmoney | buybtc | sellbtc | tradefee'
Limit the number of transactions, default value is 10 '''
#result = bc.get_transactions('all',10)
#print result