Python SDK for DeltaDeFi protocol.
Project description
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:
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.
from deltadefi.clients import ApiClient
from sidan_gin import HDWallet
# Initialize API configuration
network="preprod",
api_key="your_api_key",
# Initialize ApiClient
api = ApiClient(network=network, api_key=api_key)
Accounts
The Accounts client allows you to interact with account-related endpoints.
# Get account balance
account_balance = api.accounts.get_account_balance()
print(account_balance)
Markets
The Market client allows you to interact with market-related endpoints.
# Get market depth
market_depth = api.markets.get_depth("ADAUSDM")
print(market_depth_response)
# Get market price
market_price_response = api.markets.get_market_price("ADAUSDM")
print(market_price_response)
Orders
The Order client allows you to interact with order-related endpoints.
api_key = os.environ.get("DELTADEFI_API_KEY")
password = os.environ.get("TRADING_PASSWORD")
api = ApiClient(api_key=api_key)
api.load_operation_key(password)
res = api.post_order(
symbol="ADAUSDM",
side="sell",
type="limit",
quantity=51,
price=15,
)
print("Order submitted successfully.", res)
Development
Tests
Testing sdk:
DELTADEFI_API_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx make test
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deltadefi-0.0.11.tar.gz.
File metadata
- Download URL: deltadefi-0.0.11.tar.gz
- Upload date:
- Size: 9.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36d1860140205e3df03ab884c8bbbff65878a1e8be69660438a2291d01cf5313
|
|
| MD5 |
35776c6e49abf70cddf2c2cc488042bf
|
|
| BLAKE2b-256 |
8bcf70ffba88fa462158a2da4e8c25c5309c3998c7c270263b95ca2cdb499604
|
File details
Details for the file deltadefi-0.0.11-py3-none-any.whl.
File metadata
- Download URL: deltadefi-0.0.11-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe6b8052a2d7f90d7f7ee566cd4a21fc09709d7350d3489ae82aeb2ec2a28060
|
|
| MD5 |
d4e9b0749937a2eecdac7bd4876043be
|
|
| BLAKE2b-256 |
58d797834ea5ee7e32de8ac15e794d7290501447eeeb9c9d97e32cec2cad8a38
|