# DeltaDeFi Python SDK
The DeltaDeFi Python SDK provides a convenient way to interact with the DeltaDeFi API. This SDK allows developers to easily integrate DeltaDeFi's features into their Python applications.
## Installation
To install the SDK, use `pip`:
```sh
pip install deltadefi
```
## Requirements
- Python 3.11 or higher
## Usage
### Initialization
To use the SDK, you need to initialize the ApiClient with your API configuration and wallet.
```python
from deltadefi.clients import ApiClient
from sidan_gin import HDWallet
# Initialize API configuration
network="preprod",
api_key="your_api_key",
# Initialize HDWallet
wallet = HDWallet("your_wallet_mnemonic")
# Initialize ApiClient
api = ApiClient(network=network, api_key=api_key, wallet=wallet)
```
### Accounts
The Accounts client allows you to interact with account-related endpoints.
```python
# Get account balance
account_balance = api.accounts.get_account_balance()
print(account_balance)
```
### Market
The Market client allows you to interact with market-related endpoints.
```python
# Get market depth
market_depth = api.market.get_depth("ADAUSDX")
print(market_depth_response)
# Get market price
market_price_response = api.market.get_market_price("ADAUSDX")
print(market_price_response)
```
### Order
The Order client allows you to interact with order-related endpoints.
```python
# Build place order transaction
place_order_request = BuildPlaceOrderTransactionRequest(pair="BTC/USD", amount=1, price=50000)
place_order_response = api.order.build_place_order_transaction(symbol="ADAUSDX", amount=50, price=0.75, type="limit")
print(place_order_response)
# Submit place order transaction
submit_order_response = api.order.submit_place_order_transaction(signed_tx="<signed_tx>", order_id="<order_id>")
print(submit_order_response)
```
## License
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>
Raw data
{
"_id": null,
"home_page": "https://github.com/deltadefi-protocol/python-sdk",
"name": "deltadefi",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0.0,>3.11",
"maintainer_email": null,
"keywords": "cardano",
"author": "HinsonSIDAN",
"author_email": "wongkahinhinson@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/18/e5/3e8baf28c40596c92f1e3ebbb7ff2f6dabbd14817d8cb2b2ce8c8b11bf4d/deltadefi-0.0.6.tar.gz",
"platform": null,
"description": "# DeltaDeFi Python SDK\n\nThe DeltaDeFi Python SDK provides a convenient way to interact with the DeltaDeFi API. This SDK allows developers to easily integrate DeltaDeFi's features into their Python applications.\n\n## Installation\n\nTo install the SDK, use `pip`:\n\n```sh\npip install deltadefi\n```\n\n## Requirements\n\n- Python 3.11 or higher\n\n## Usage\n\n### Initialization\n\nTo use the SDK, you need to initialize the ApiClient with your API configuration and wallet.\n\n```python\nfrom deltadefi.clients import ApiClient\nfrom sidan_gin import HDWallet\n\n# Initialize API configuration\nnetwork=\"preprod\",\napi_key=\"your_api_key\",\n\n# Initialize HDWallet\nwallet = HDWallet(\"your_wallet_mnemonic\")\n\n# Initialize ApiClient\napi = ApiClient(network=network, api_key=api_key, wallet=wallet)\n```\n\n### Accounts\n\nThe Accounts client allows you to interact with account-related endpoints.\n\n```python\n# Get account balance\naccount_balance = api.accounts.get_account_balance()\nprint(account_balance)\n```\n\n### Market\n\nThe Market client allows you to interact with market-related endpoints.\n\n```python\n# Get market depth\nmarket_depth = api.market.get_depth(\"ADAUSDX\")\nprint(market_depth_response)\n\n# Get market price\nmarket_price_response = api.market.get_market_price(\"ADAUSDX\")\nprint(market_price_response)\n```\n\n### Order\n\nThe Order client allows you to interact with order-related endpoints.\n\n```python\n# Build place order transaction\nplace_order_request = BuildPlaceOrderTransactionRequest(pair=\"BTC/USD\", amount=1, price=50000)\nplace_order_response = api.order.build_place_order_transaction(symbol=\"ADAUSDX\", amount=50, price=0.75, type=\"limit\")\nprint(place_order_response)\n\n# Submit place order transaction\nsubmit_order_response = api.order.submit_place_order_transaction(signed_tx=\"<signed_tx>\", order_id=\"<order_id>\")\nprint(submit_order_response)\n```\n\n## License\n\nLicensed 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>\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "Python SDK for DeltaDeFi protocol.",
"version": "0.0.6",
"project_urls": {
"Documentation": "https://github.com/deltadefi-protocol/python-sdk",
"Homepage": "https://github.com/deltadefi-protocol/python-sdk"
},
"split_keywords": [
"cardano"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "74b2e257b1bfcc25f586d20160e39397c917f785c225b414c7638ca231848c6f",
"md5": "32fb796da90dc2b4ceb8fc3bb61f63d5",
"sha256": "87be68ffd0da3e5069eaf0af2db6c6643f83c1d82b3e8dd99a1fa302506945bb"
},
"downloads": -1,
"filename": "deltadefi-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "32fb796da90dc2b4ceb8fc3bb61f63d5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0.0,>3.11",
"size": 12981,
"upload_time": "2025-04-09T11:00:23",
"upload_time_iso_8601": "2025-04-09T11:00:23.307475Z",
"url": "https://files.pythonhosted.org/packages/74/b2/e257b1bfcc25f586d20160e39397c917f785c225b414c7638ca231848c6f/deltadefi-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "18e53e8baf28c40596c92f1e3ebbb7ff2f6dabbd14817d8cb2b2ce8c8b11bf4d",
"md5": "b12ffe5e48e98cb52bc10d7a8d0787d1",
"sha256": "349fe5eb2bf460b7db53bef53822022026e03c808daf0724c52fb83043b45724"
},
"downloads": -1,
"filename": "deltadefi-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "b12ffe5e48e98cb52bc10d7a8d0787d1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0.0,>3.11",
"size": 8116,
"upload_time": "2025-04-09T11:00:24",
"upload_time_iso_8601": "2025-04-09T11:00:24.547286Z",
"url": "https://files.pythonhosted.org/packages/18/e5/3e8baf28c40596c92f1e3ebbb7ff2f6dabbd14817d8cb2b2ce8c8b11bf4d/deltadefi-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-04-09 11:00:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "deltadefi-protocol",
"github_project": "python-sdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "deltadefi"
}