Dango Python SDK
Sync Python client for the Dango perpetual futures exchange. Wraps the GraphQL HTTP and WebSocket endpoints behind three classes: Exchange for signed actions, Info for read queries and subscriptions, and Secp256k1Wallet/SingleSigner for keys and nonces.
The distribution package is named dango. Both dango/__init__.py and dango/hyperliquid_compatibility/__init__.py are empty — import everything from submodules:
from dango.exchange import Exchange
from dango.info import Info
from dango.utils.signing import Secp256k1Wallet, SingleSigner
from dango.utils.types import Addr, PairId, TimeInForce
from dango.utils.constants import MAINNET_API_URL, PERPS_CONTRACT_MAINNETWhere to start
- Installation — install the wheel and set up a virtualenv
- First call — run a read query against mainnet in five minutes
- Project setup — networks, env vars, signer construction
Reference
- Classes —
Exchange,Info,WebsocketManager,API,Secp256k1Wallet,SingleSigner - Methods — per-method pages under
Exchange,Info, andWebsocketManager - Helpers — module-level helpers (
paginate_all,dango_decimal,sign_doc_canonical_json,sign_doc_sha256) - Types — user-facing aliases, dataclasses, enums
- Errors —
Error,ClientError,ServerError,GraphQLError,TxFailed
Migrating from Hyperliquid
The package ships an HL-shaped facade under dango.hyperliquid_compatibility. Swap your imports and most existing HL code keeps working — but there are sharp edges. Read Migration: Hyperliquid SDK before flipping the switch.