@@ -7,7 +7,7 @@ The DeltaDeFi Python SDK provides a convenient way to interact with the DeltaDeF
77To install the SDK, use ` pip ` :
88
99``` sh
10- pip install deltadefi-python-sdk
10+ pip install deltadefi
1111```
1212
1313## Requirements
@@ -21,32 +21,27 @@ pip install deltadefi-python-sdk
2121To use the SDK, you need to initialize the ApiClient with your API configuration and wallet.
2222
2323``` python
24- from deltadefi.api_resources.api_config import ApiConfig
25- from deltadefi.clients.clients import ApiClient
24+ from deltadefi.clients import ApiClient
2625from sidan_gin import HDWallet
2726
2827# Initialize API configuration
29- network= " mainnet " ,
28+ network= " preprod " ,
3029api_key= " your_api_key" ,
3130
3231# Initialize HDWallet
3332wallet = HDWallet(" your_wallet_mnemonic" )
3433
3534# Initialize ApiClient
36- api_client = ApiClient(network = network, api_key = api_key, wallet = wallet)
35+ api = ApiClient(network = network, api_key = api_key, wallet = wallet)
3736```
3837
3938### Accounts
4039
4140The Accounts client allows you to interact with account-related endpoints.
4241
4342``` python
44- from deltadefi.clients.accounts import Accounts
45-
46- accounts_client = api_client.accounts
47-
4843# Get account balance
49- account_balance = accounts_client .get_account_balance()
44+ account_balance = api.accounts .get_account_balance()
5045print (account_balance)
5146```
5247
@@ -55,45 +50,30 @@ print(account_balance)
5550The Markets client allows you to interact with market-related endpoints.
5651
5752``` python
58- from deltadefi.clients.markets import Markets
59-
60- markets_client = api_client.markets
61-
6253# Get market depth
63- market_depth_request = GetMarketDepthRequest(pair = " BTC/USD" )
64- market_depth_response = markets_client.get_depth(market_depth_request)
54+ market_depth = api.markets.get_depth(" ADAUSDX" )
6555print (market_depth_response)
6656
6757# Get market price
68- market_price_request = GetMarketPriceRequest(pair = " BTC/USD" )
69- market_price_response = markets_client.get_market_price(market_price_request)
58+ market_price_response = api.markets.get_market_price(" ADAUSDX" )
7059print (market_price_response)
7160```
7261
73- ### Orders
62+ ### Order
7463
75- The Orders client allows you to interact with order-related endpoints.
64+ The Order client allows you to interact with order-related endpoints.
7665
7766``` python
78- from deltadefi.clients.orders import Orders
79-
80- orders_client = api_client.orders
81-
8267# Build place order transaction
8368place_order_request = BuildPlaceOrderTransactionRequest(pair = " BTC/USD" , amount = 1 , price = 50000 )
84- place_order_response = orders_client. build_place_order_transaction(place_order_request )
69+ place_order_response = api.order. build_place_order_transaction(symbol = " ADAUSDX " , amount = 50 , price = 0.75 , type = " limit " )
8570print (place_order_response)
8671
8772# Submit place order transaction
88- submit_order_request = SubmitPlaceOrderTransactionRequest(order_id = " order_id" )
89- submit_order_response = orders_client.submit_place_order_transaction(submit_order_request)
73+ submit_order_response = api.order.submit_place_order_transaction(signed_tx = " <signed_tx>" , order_id = " <order_id>" )
9074print (submit_order_response)
9175```
9276
9377## License
9478
95- Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
96-
97- ```
98- http://www.apache.org/licenses/LICENSE-2.0
99- ```
79+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at < http://www.apache.org/licenses/LICENSE-2.0 >
0 commit comments