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
Hashes for v4_client_py-4.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45694a127cb24c2fcda11b5557f0121329ab8c3bd4d303fd2039a0c397c4c160 |
|
MD5 | 99760b2a16b6f0e81831404d92e7cdeb |
|
BLAKE2b-256 | e8c0421ee31f75b69e0738c1d5a8f06a7666bdf608693818c077c839b677d36e |