Skip to content

Commit 5130309

Browse files
committed
chore: updates readme
1 parent d6ab6a6 commit 5130309

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

README.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,15 @@ pip install cryptomarket
1414

1515
# Documentation
1616

17-
This sdk makes use of the [api version 2](https://api.exchange.cryptomkt.com/v2) of cryptomarket
17+
This sdk makes use of the [api version 3](https://api.exchange.cryptomkt.com) of cryptomarket
1818

1919
# Quick Start
2020

2121
## rest client
2222

2323
```python
2424
from cryptomarket.client import Client
25+
from cryptomarket.args import Account, Side, OrderType
2526
from cryptomarket.exceptions import CryptomarketSDKException
2627

2728
# instance a client
@@ -33,27 +34,27 @@ client = Client(api_key, api_secret)
3334
currencies = client.get_currencies()
3435

3536
# get order books
36-
order_book = client.get_order_book('EOSETH')
37+
order_book = client.get_order_book_of_symbol('EOSETH')
3738

38-
# get your account balances
39-
account_balance = client.get_account_balance()
39+
# get your wallet balances
40+
account_balance = client.get_wallet_balances()
4041

41-
# get your trading balances
42-
trading_balance = client.get_trading_balance()
42+
# get your spot trading balances
43+
trading_balance = client.get_spot_trading_balances()
4344

44-
# move balance from account bank to account trading
45-
result = client.transfer_money_from_bank_balance_to_trading_balance('ETH', '3.2')
45+
# move balance from wallet account to trading account
46+
result = client.transfer_between_wallet_and_exchange('ETH', '3.2', source=Account.WALLET, destination=Account.SPOT)
4647

47-
# get your active orders
48-
orders = client.get_active_orders('EOSETH')
48+
# get your active spot orders
49+
orders = client.get_all_active_spot_orders('EOSETH')
4950

50-
# create a new order
51-
order = client.create_order('EOSETH', 'buy', '10', order_type=args.ORDER_TYPE.MARKET)
51+
# create a new spot order
52+
order = client.create_spot_order('EOSETH', Side.BUY, '10', type=OrderType.MARKET)
5253
```
5354

5455
## Websocket Clients
5556

56-
there are three websocket clients, `MarketDataClient`, the `SpotTradingClient` and the `WalletManagementClient`. The `MarketDataClient` is public, while the others require authentication to be used.
57+
there are three websocket clients, `MarketDataClient`, the `TradingClient` and the `WalletClient`. The `MarketDataClient` is public, while the others require authentication to be used.
5758

5859
Some subscription callbacks take a second argument, indicating the type of notification, either 'snapshsot' or 'update'.
5960

@@ -67,14 +68,15 @@ client = MarketDataClient()
6768
client.connect()
6869
# close the client
6970
client.close()
71+
7072
# subscribe to public trades
71-
def callback(trades_by_symbol: Dict[str, List[WSTrade]], notification_type):
73+
def trades_callback(trades_by_symbol: Dict[str, List[WSTrade]], notification_type):
7274
for symbol in trades_by_symbol:
7375
trade_list = trades_by_symbol[symbol]
7476
for trade in trade_list:
7577
print(trade)
7678
client.subscribe_to_trades(
77-
callback=callback,
79+
callback=trades_callback,
7880
symbols=['ETHBTC'],
7981
limit=5,
8082
)
@@ -91,7 +93,7 @@ client.subscribe_to_ticker(
9193
)
9294
```
9395

94-
### SpotTradingClient
96+
### TradingClient
9597

9698
```python
9799
# instance a client with a 15 seconds window
@@ -124,14 +126,15 @@ client.cancel_spot_order(client_order_id)
124126

125127
```
126128

127-
### WalletManagementClient
129+
### WalletClient
128130

129131
```python
130132
# instance a client
131133
client = WalletClient(api_key, api_secret)
132134
client.connect()
135+
133136
# close the client
134-
defer client.close()
137+
client.close()
135138

136139
# subscribe to wallet transactions
137140
def callback(transaction):

0 commit comments

Comments
 (0)