Skip to main content

A fully typed, validated async client for the dYdX Indexer, Node and CosmosSDK/CometBFT APIs.

Project description

Typed dYdX

A fully typed, validated async client for the dYdX Indexer, Node and CosmosSDK/CometBFT APIs.

from dydx import Dydx

async with Dydx.testnet(public=True) as client:
  market = await client.indexer.data.get_market('BTC-USD')
  stream = await client.indexer.streams.markets()
  balances = await client.chain.bank.all_balances('dydx1...')
  block = await client.chain.comet.block()
  clob_pairs = await client.node.public.get_clob_pairs()

  print(market['oraclePrice'])
  print(stream.reply['markets']['BTC-USD']['oraclePrice'])
  print(balances)
  print(block['block']['header']['height'])
  print(clob_pairs)
  await stream.unsubscribe()

Package Shape

  • client.indexer.data: indexer HTTP reads for markets, orders, fills, transfers, and account history
  • client.indexer.streams: indexer WebSocket subscriptions
  • client.chain: Cosmos gRPC module queries for balances, CLOB metadata, prices, subaccounts, staking, and transactions
  • client.chain.comet: CometBFT HTTP RPC reads for blocks, transaction lookup, and transaction search
  • client.node: wallet-aware signing, order placement, cancellation, and transaction helpers

Installation

pip install typed-dydx

Documentation

Source Code

github.com/tribulnation/dydx

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

typed_dydx-2.0.0.tar.gz (262.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

typed_dydx-2.0.0-py3-none-any.whl (406.3 kB view details)

Uploaded Python 3

File details

Details for the file typed_dydx-2.0.0.tar.gz.

File metadata

  • Download URL: typed_dydx-2.0.0.tar.gz
  • Upload date:
  • Size: 262.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for typed_dydx-2.0.0.tar.gz
Algorithm Hash digest
SHA256 cd0a05a6f8733d47eb4a1f63c3dd671a186737c82f3277928970376f1b50b72a
MD5 3309567ab7d0c6dfe0074525d59eba3f
BLAKE2b-256 3641d3dcfd01933d6fc866e49cbccf45c18b72bb5984f0954b7f15041d3098f4

See more details on using hashes here.

File details

Details for the file typed_dydx-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: typed_dydx-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 406.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.10

File hashes

Hashes for typed_dydx-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06e274bbde152de8b0fed7659a1e37a31b146e8b37dbd1acd1a48aa9e35fbf75
MD5 2107787a6da7fa30a6577ac500f631f3
BLAKE2b-256 4c9913a1d3a8e497f1383261f66a747f207f3efbafd99a077353702619706ecd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page