-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.py
54 lines (37 loc) · 1.38 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
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())
# # Test get deposits
print('Get deposits:', bp.get_deposits())
# # Test get deposit address
# print('Get deposit address:', bp.get_deposit_address(bp.Blockchain.SOLANA))
# Test get orders
# print('Get orders:', bp.get_order_history('SOL_USDC'))
# Test create order
# result = bp.create_order(orderType=bp.OrderType.LIMIT, side=bp.Side.BID, symbol='SOL_USDC', price='170', quantity='0.1')
# print('Create order:', result)