Metadata-Version: 2.4
Name: 1m-trade
Version: 0.3.0
Summary: Hyperliquid trading and query CLI (HIP-3 supported)
License: MIT
Keywords: hyperliquid,trading,dex,cli
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: hyperliquid-python-sdk
Requires-Dist: websockets<12.0,>=11.0
Requires-Dist: python-dotenv
Requires-Dist: cryptography>=42.0.0
Requires-Dist: eth-account
Requires-Dist: requests
Requires-Dist: msgpack
Requires-Dist: web3
Requires-Dist: eth-abi
Requires-Dist: eth-utils
Dynamic: license-file

# 1m-trade

Hyperliquid trading and query CLI (HIP-3 supported).

## Install

```bash
pip install 1m-trade
```

## Usage

The CLI command is `hl1m`.

It loads environment variables from:

1. `OPENCLAW_STATE_DIR` (if set)
2. `OPENCLAW_HOME/.openclaw/.1m-trade/.env`
3. `~/.openclaw/.1m-trade/.env`

### Query examples

```bash
hl1m query-user-state
hl1m query-open-orders
hl1m query-meta
hl1m query-kline --coin BTC --period 1m --start 1700000000000 --end 1700003600000
```

### Trading examples

> 需要设置私钥环境变量（例如 `HYPERLIQUID_PRIVATE_KEY`，或 `HYPERLIQUID_PRIVATE_KEY_ENC` + `HYPERLIQUID_PK_ENC_PASSWORD`）。

```bash
hl1m place-order --coin BTC --is-buy true --qty 0.01 --limit-px 60000 --tif Gtc
hl1m market-order --coin BTC --is-buy true --qty 0.01 --slippage 0.02
hl1m cancel-order --coin BTC
hl1m update-leverage --coin BTC --leverage 5 --is-cross true
hl1m market-close --coin BTC --qty 0.01 --slippage 0.02
```

### Wallet examples

```bash
hl1m create-wallet
hl1m init-wallet --pri_key 0xYourPrivateKey
hl1m init-wallet --address 0xYourPublicAddress --pri_key 0xYourPrivateKey
hl1m init_wallet --address 0xYourPublicAddress --pri_key 0xYourPrivateKey
hl1m send-private-key --target openclaw_target
hl1m start-listener
hl1m register-wallet 0xYourDepositAddress
```

## License

MIT

