Python SDK
This page will help you get started with D2Y. You'll be up and running in a jiffy!
D2Y Trading Client SDK Documentation
This SDK allows you to interact with the D2Y trading API for managing your account, placing orders, and retrieving market information.
Installation
The SDK can be downloaded and used directly in your project.
Usage
To use the SDK, you first need to create a TradingClient instance:
from trading_client import TradingClient
api_key = "your-api-key"
api_secret = "your-api-secret"
base_url = "https://api.dev.d2y.exchange" # You can change this to the desired base URL, this is a sample base URL.
client = TradingClient(api_key, api_secret, base_url)
Once you have created a TradingClient instance, you can start using its methods to interact with the API. Below is a list of methods and their descriptions:
Error Handling
In case of an error or an unsuccessful response, an exception will be raised. You can handle these exceptions using a try and except block to get more information on the error:
try:
account = client.get_account()
except Exception as e:
print(f"An error occurred: {e}")
Exceptions might include API-related errors, authentication errors, or other issues such as invalid input.
Updated almost 3 years ago
