dYdX Chain Client
Project description
dYdX Chain Client for Python
Python client for dYdX (v4 API).
The library is currently tested against Python versions 3.9, and 3.11.
Installation
The v4-client-py
package is available on PyPI. Install with pip
:
pip install v4-client-py
Getting Started
Sample code is located in examples folder
Development Setup - VS Code
Install Microsoft Python extensions
Shift-Command-P: Create Python Environment
Select Venv
Select Python 3.9 as interpreter
Select requirements.txt as the dependencies to install
Install requirements
pip install -r requirements.txt
VS Code will automatically switch to .venv environment when running example code. Or you can manually switch
source ~/<project_dir>/.venv/bin/activate
Set PYTHONPATH
export PYTHONPATH=~/<project_dir>/.venv/lib/<Python version>/site-packages
Troubleshootimg
Cython and Brownie must be installed before cytoolz
If there is any issue with cytoolz, uninstall cytoolz, Brownie and Cython, reinstall Cython, Brownie and cytoolz sequentially.
VS Code may need to be restarted to have Cython functioning correctly
Running examples
Select the file to be debugged Select the debug button on the left Select "Python: Current File"
Running tests
Integration tests uses testnet environment for testing. We use pytest.
To install pytest
pip install pytest
For read-only integration tests, run:
pytest -v
For integration tests with transactions, a subaccount must exist for the specified address. This subaccount may be reset when testnet environment is reset. To create the subaccount, run
examples/faucet_endpoint.py
Wait for a few seconds for the faucet transaction to commit, then run
pytest -v -c pytest_integration.ini
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
File details
Details for the file dydx_v4_python-0.0.4.tar.gz
.
File metadata
- Download URL: dydx_v4_python-0.0.4.tar.gz
- Upload date:
- Size: 47.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.9.18 Linux/6.2.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ab0018abf3e6e706b1e9906ade7dd4a98ab83abed0714d087d4a8566ff810de |
|
MD5 | 73c626aa34c0d0fdf6dafd5643b183f4 |
|
BLAKE2b-256 | 58cf6e54118265256bb6e6424acc65a75c83e6a14cd3b673d763401b3a5ce049 |
File details
Details for the file dydx_v4_python-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: dydx_v4_python-0.0.4-py3-none-any.whl
- Upload date:
- Size: 88.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.9.18 Linux/6.2.0-1018-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54430abde25140b8f015141e610a2295bf1ab58bd6473ada65efec500dddae33 |
|
MD5 | 429bd22f18fcc088d08c685c2943f7f2 |
|
BLAKE2b-256 | 5a10a6194ff873cf9850b3dca96da6cb8d04762afe9e457db143c55ff3a42b76 |