Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deltadefi-0.1.3.tar.gz (103.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deltadefi-0.1.3-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file deltadefi-0.1.3.tar.gz.

File metadata

  • Download URL: deltadefi-0.1.3.tar.gz
  • Upload date:
  • Size: 103.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.4

File hashes

Hashes for deltadefi-0.1.3.tar.gz
Algorithm Hash digest
SHA256 7c065f09fdd145e372d35972f35b2b554e2b77c9e321ae7ad79db6a2905a5f5c
MD5 aeccf80aed5b1d11c7e08ff5d069ed45
BLAKE2b-256 4eebe365aa9af360ff9d1e63821b248f63a3d04d6b2031c0f72fb215d16dc42e

See more details on using hashes here.

File details

Details for the file deltadefi-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: deltadefi-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.4

File hashes

Hashes for deltadefi-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f1675ac01be873c18db66832376582f0647e1a2b928311b6265f67feb4efd853
MD5 cd0dac66de90985607e8875f36662628
BLAKE2b-256 3fc8af41bfdde2d92e52091ab2feb541feb2e7ad32a584043e3a6560442d6d32

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page