Skip to content

Commit 6f58680

Browse files
committed
docs: update readme
1 parent 66cd631 commit 6f58680

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@ from sidan_gin import HDWallet
2828
network="preprod",
2929
api_key="your_api_key",
3030

31-
# Initialize HDWallet
32-
wallet = HDWallet("your_wallet_mnemonic")
33-
3431
# Initialize ApiClient
35-
api = ApiClient(network=network, api_key=api_key, wallet=wallet)
32+
api = ApiClient(network=network, api_key=api_key)
3633
```
3734

3835
### Accounts
@@ -45,33 +42,40 @@ account_balance = api.accounts.get_account_balance()
4542
print(account_balance)
4643
```
4744

48-
### Market
45+
### Markets
4946

5047
The Market client allows you to interact with market-related endpoints.
5148

5249
```python
5350
# Get market depth
54-
market_depth = api.market.get_depth("ADAUSDM")
51+
market_depth = api.markets.get_depth("ADAUSDM")
5552
print(market_depth_response)
5653

5754
# Get market price
58-
market_price_response = api.market.get_market_price("ADAUSDM")
55+
market_price_response = api.markets.get_market_price("ADAUSDM")
5956
print(market_price_response)
6057
```
6158

62-
### Order
59+
### Orders
6360

6461
The Order client allows you to interact with order-related endpoints.
6562

6663
```python
67-
# Build place order transaction
68-
place_order_request = BuildPlaceOrderTransactionRequest(pair="BTC/USD", amount=1, price=50000)
69-
place_order_response = api.order.build_place_order_transaction(symbol="ADAUSDM", amount=50, price=0.75, type="limit")
70-
print(place_order_response)
71-
72-
# Submit place order transaction
73-
submit_order_response = api.order.submit_place_order_transaction(signed_tx="<signed_tx>", order_id="<order_id>")
74-
print(submit_order_response)
64+
api_key = os.environ.get("DELTADEFI_API_KEY")
65+
password = os.environ.get("TRADING_PASSWORD")
66+
67+
api = ApiClient(api_key=api_key)
68+
api.load_operation_key(password)
69+
70+
res = api.post_order(
71+
symbol="ADAUSDM",
72+
side="sell",
73+
type="limit",
74+
quantity=51,
75+
price=15,
76+
)
77+
78+
print("Order submitted successfully.", res)
7579
```
7680

7781
## Development

0 commit comments

Comments
 (0)