forked from blockcmd/backpack-api-py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
41 lines (28 loc) · 950 Bytes
/
test.py
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
from lib import Backpack
from config import Config
# Create a config object to get the public and private keys
config = Config()
# Create a Backpack object
bp = Backpack(config.get_config()['public_key'], config.get_config()['private_key'])
# Test status
print('Current status:', bp.status())
# Test ping
print('Ping:', bp.ping())
# Test timestamp
print('Timestamp:', bp.time())
# Test get trades
print('Public trades:', bp.get_trades('SOL_USDC'))
# Test historical trades
print('Historical trades:', bp.get_historical_trades('SOL_USDC', 10))
#Test get assets
print('Get assets:', bp.get_assets())
# Test get markets
print ('Get markets:', bp.get_markets())
# Test ticker
print('Get ticker:', bp.get_ticker('USDT_USDC'))
#Test get depth
print('Get depth:', bp.get_depth('SOL_USDC'))
# Test get klines
print('Get klines:', bp.get_kline('SOL_USDC', bp.KlineInterval.ONE_MINUTE))
# Test get account
print('Get account:', bp.get_balances())