Metadata-Version: 2.4
Name: typed-dydx
Version: 2.0.0
Summary: A fully typed, validated async client for the dYdX Indexer, Node and CosmosSDK/CometBFT APIs.
Author-email: Marcel Claramunt <marcel@tribulnation.com>
License-Expression: GPL-3.0-only
Project-URL: Repository, https://github.com/tribulnation/dydx.git
Project-URL: Documentation, https://dydx.tribulnation.com
Project-URL: Website, https://tribulnation.com
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: typed-core
Requires-Dist: betterproto2==0.9.*
Requires-Dist: grpclib
Requires-Dist: httpx
Requires-Dist: typing-extensions
Requires-Dist: bech32
Requires-Dist: bip-utils
Requires-Dist: coincurve
Requires-Dist: pycryptodome
Dynamic: license-file

# Typed dYdX

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

```python
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

```bash
pip install typed-dydx
```

## Documentation

- [Wallet Setup](https://dydx.tribulnation.com/api-keys/)
- [How To](https://dydx.tribulnation.com/how-to/)
- [Reference](https://dydx.tribulnation.com/reference/)

## Source Code

> [github.com/tribulnation/dydx](https://github.com/tribulnation/dydx)
