-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.py
More file actions
39 lines (27 loc) · 910 Bytes
/
example.py
File metadata and controls
39 lines (27 loc) · 910 Bytes
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
from bitmart_api import *
api_key = '<your api key>'
secret_key = '<your secret key>'
# title of your API key that you set when registered your key.
title = '<title>'
############# Usage #############
bitmart = Bitmart(api_key, secret_key, title)
# Public Endpoints
print(bitmart.ping())
print(bitmart.time())
print(bitmart.steps())
print(bitmart.currencies())
print(bitmart.symbols())
print(bitmart.symbols_details())
print(bitmart.ticker('ETH_BTC'))
print(bitmart.kline('ETH_BTC', 15, 1525760116000, 1525769116000))
print(bitmart.orderbook('ETH_BTC', 6))
print(bitmart.trades('ETH_BTC'))
# Authenticated Endpoints
print(bitmart.wallet())
print(bitmart.place_order('ETH_BTC', 1, 1, 'buy'))
print(bitmart.cancel_order(564654))
print(bitmart.cancel_all_order('ETH_BTC', 'buy'))
print(bitmart.list_orders('ETH_BTC', 0, 0, 100))
print(bitmart.order_details(123232))
# Service
print(bitmart.precision)