GithubHelp home page GithubHelp logo

itsdchen / hyperliquid-python-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hyperliquid-dex/hyperliquid-python-sdk

0.0 0.0 0.0 225 KB

SDK for Hyperliquid API trading with Python.

License: MIT License

Python 95.66% Makefile 4.34%

hyperliquid-python-sdk's Introduction

hyperliquid-python-sdk

Dependencies Status

Code style: black Security: bandit Pre-commit Semantic Versions License Coverage Report

SDK for Hyperliquid API trading with Python.

Installation

pip install hyperliquid-python-sdk

Usage Examples

from hyperliquid.info import Info
from hyperliquid.utils import constants

info = Info(constants.TESTNET_API_URL, skip_ws=True)
user_state = info.user_state("0xcd5051944f780a621ee62e39e493c489668acf4d")
print(user_state)

See examples for more complete examples. You can also checkout the repo and run any of the examples after configuring your private key e.g.

cp examples/config.json.example examples/config.json
vim examples/config.json
python examples/basic_order.py

Getting started with contributing to this repo

  1. Download Poetry: https://python-poetry.org/. Note that in the install script you might have to set symlinks=True in venv.EnvBuilder.

  2. Point poetry to correct version of python. For development we require python 3.10 exactly. Some dependencies have issues on 3.11, while older versions don't have correct typing support. brew install [email protected] && poetry env use /opt/homebrew/Cellar/[email protected]/3.10.10_1/bin/python3.10

  3. Install dependencies:

make install

Makefile usage

CLI commands for faster development.

Install all dependencies

Install requirements:

make install

Codestyle

Automatic formatting uses pyupgrade, isort and black.

make codestyle

# or use synonym
make formatting

Codestyle checks only, without rewriting files:

make check-codestyle

Note: check-codestyle uses isort, black and darglint library

Update all dev libraries to the latest version using one comand

make update-dev-deps

Tests with coverage badges

Run pytest

make test

All linters

make lint

the same as:

make test && make check-codestyle && make mypy && make check-safety

Cleanup

Delete pycache files

make pycache-remove

Remove package build

make build-remove

Delete .DS_STORE files

make dsstore-remove

Remove .mypycache

make mypycache-remove

Or to remove all above run:

make cleanup

Releases

You can see the list of available releases on the GitHub Releases page.

We follow the Semantic Versions specification and use Release Drafter. As pull requests are merged, a draft release is kept up-to-date listing the changes, ready to publish when you’re ready. With the categories option, you can categorize pull requests in release notes using labels.

List of labels and corresponding titles

Label Title in Releases
enhancement, feature Features
bug, refactoring, bugfix, fix Fixes & Refactoring
build, ci, testing Build System & CI/CD
breaking Breaking Changes
documentation Documentation
dependencies Dependencies updates

Building and releasing

Building a new version of the application contains steps:

  • Bump the version of your package with poetry version <version>. You can pass the new version explicitly, or a rule such as major, minor, or patch. For more details, refer to the Semantic Versions standard.
  • Make a commit to GitHub
  • Create a GitHub release
  • poetry publish --build

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

@misc{hyperliquid-python-sdk,
  author = {Hyperliquid},
  title = {SDK for Hyperliquid API trading with Python.},
  year = {2023},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/hyperliquid-dex/hyperliquid-python-sdk}}
}

Terms

By using this package you agree to the Terms of Use. See TERMS for more details.

Credits

This project was generated with python-package-template.

hyperliquid-python-sdk's People

Contributors

adam254689 avatar alliedtoasters avatar elevatordown avatar itsdchen avatar lmlmt avatar terencebeauj avatar traderben avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.