forked from BitonicNL/bl3p-api
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.py
More file actions
executable file
·72 lines (62 loc) · 1.43 KB
/
Copy pathexample.py
File metadata and controls
executable file
·72 lines (62 loc) · 1.43 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
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python
import bl3p
import json
def d(j):
print (json.dumps(j, sort_keys=True, indent=4, separators=(',', ': ')))
def main():
# example:
public_key = ''
secret_key = ''
b = bl3p.Bl3pApi('https://api.bl3p.eu/1/', public_key, secret_key)
# b.setVerbose(True)
'''
koers_in_eur = 5000
kapitaal_in_eur = 10000
btc = round(kapitaal_in_eur / koers_in_eur, 8) # round to 8 decimals
market = 'BTC'
order_type = 'bid' # 'bid' (=buy BTC) or 'ask' (=sell BTC)
order_amount = int(btc * b.getBtcMultiplier()) # 1 BTC = 100000000
order_price = int(koers_in_eur * b.getEurMultiplier()) # 1 EUR = 100000
d(b.addOrder(market, order_type, order_amount, order_price))
'''
'''
market = 'BTC'
order_id = 0
d(b.cancelOrder(market, order_id))
'''
'''
market = 'BTC'
order_id = 0
d(b.orderInfo(market, order_id))
'''
'''
market = 'BTC'
d(b.fullDepth(market))
'''
'''
market = 'BTC'
d(b.getNewDepositAddress(market))
'''
'''
market = 'BTC'
d(b.getLastDepositAddress(market))
'''
'''
market = 'BTC'
trade_id = 0
d(b.fetchLast1000Trades(market, trade_id))
'''
'''
currency = 'BTC'
n = 10
d(b.walletHistory(currency, n))
'''
'''
market = 'BTC'
d(b.getAllActiveOrders(market))
'''
# '''
d(b.getBalances())
# '''
if __name__ == '__main__':
main()