Skip to content

Commit 72ea5c6

Browse files
docs: env 配置页增加 Hyperliquid API 钱包创建三步指引
- 新增创建 API 钱包入口链接 https://app.hyperliquid.xyz/API - 分步说明:创建钱包 → 配置 .env → 充值 - 增加测试网水龙头链接 - 中英文同步更新 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3490316 commit 72ea5c6

File tree

2 files changed

+56
-26
lines changed
  • website
    • docs/configuration
    • i18n/zh-Hans/docusaurus-plugin-content-docs/current/configuration

2 files changed

+56
-26
lines changed

website/docs/configuration/env.md

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,39 @@ If you use `client_type: litellm`, set `OPENAI_API_KEY` or configure the LiteLLM
3535
| `HYPERLIQUID_PRIVATE_KEY` | **Yes** | Ethereum private key for signing orders (`0x...`) |
3636
| `HYPERLIQUID_TESTNET` | No | `true` to use testnet, `false` for mainnet (default: `false`) |
3737

38-
:::danger Private Key Security
39-
- Never commit `.env` to any repository
40-
- Never share your private key with anyone
41-
- Loss of the private key means permanent loss of funds
42-
- Use a dedicated trading wallet, not your main holdings wallet
38+
### API Wallet Authorization
39+
40+
Hyperliquid supports **API wallets** (sub-wallets) for programmatic trading. This is the **recommended approach** — it keeps your main wallet's private key safe and lets you revoke access at any time.
41+
42+
#### Step 1 — Create an API Wallet
43+
44+
1. Open [https://app.hyperliquid.xyz/API](https://app.hyperliquid.xyz/API) with your **main wallet** connected
45+
2. Click **Generate API Wallet** — Hyperliquid will create a new key pair
46+
3. Copy and save the **private key** shown (it will not be shown again)
47+
4. The API wallet address will now appear in your API Wallets list
48+
49+
:::tip Testnet
50+
For testnet, use [https://app.hyperliquid-testnet.xyz/API](https://app.hyperliquid-testnet.xyz/API). Get free test funds from the [Testnet Faucet](https://app.hyperliquid-testnet.xyz/faucet).
4351
:::
4452

45-
### API Wallet Authorization
53+
#### Step 2 — Configure `.env`
54+
55+
Set the API wallet's private key in your `.env`:
56+
57+
```bash
58+
HYPERLIQUID_PRIVATE_KEY=0x<api-wallet-private-key>
59+
HYPERLIQUID_TESTNET=true # set to false for mainnet
60+
```
4661

47-
Hyperliquid supports API wallets (sub-wallets) for programmatic trading. If you are using an API wallet address:
62+
#### Step 3 — Fund the API Wallet
4863

49-
1. The API wallet can query balances but **cannot trade** until authorized
50-
2. Go to the Hyperliquid web interface with your **main wallet**
51-
3. Navigate to **Settings → API Wallets**
52-
4. Authorize the API wallet address
64+
Transfer USDC from your main wallet to the API wallet address on Hyperliquid. The API wallet needs funds to place orders.
5365

54-
:::tip
55-
Using an API wallet is safer than using your main wallet's private key directly — you can revoke API wallet access at any time from the web UI.
66+
:::danger Private Key Security
67+
- Never commit `.env` to any repository
68+
- Never share your private key with anyone
69+
- Loss of the private key means permanent loss of funds
70+
- Use a dedicated trading wallet, not your main holdings wallet
5671
:::
5772

5873
## Optional: External Data APIs

website/i18n/zh-Hans/docusaurus-plugin-content-docs/current/configuration/env.md

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,24 +35,39 @@ cp .env.example .env
3535
| `HYPERLIQUID_PRIVATE_KEY` | **必须** | 用于签署订单的以太坊私钥(`0x...`|
3636
| `HYPERLIQUID_TESTNET` || `true` 使用测试网,`false` 使用主网(默认:`false`|
3737

38-
:::danger 私钥安全
39-
- 永远不要将 `.env` 提交到任何仓库
40-
- 永远不要与任何人分享你的私钥
41-
- 私钥丢失意味着资产永久丢失
42-
- 建议使用专用的交易钱包,不要使用持有主要资产的钱包
38+
### API 钱包授权
39+
40+
Hyperliquid 支持使用 **API 钱包**(子钱包)进行程序化交易。这是**推荐方式**——主钱包私钥不需要暴露,且可随时撤销权限。
41+
42+
#### 第一步 — 创建 API 钱包
43+
44+
1.**主钱包**连接并打开 [https://app.hyperliquid.xyz/API](https://app.hyperliquid.xyz/API)
45+
2. 点击 **Generate API Wallet**,Hyperliquid 会自动生成新的密钥对
46+
3. 复制并保存显示的**私钥**(该私钥只显示一次)
47+
4. API 钱包地址会出现在 API Wallets 列表中
48+
49+
:::tip 测试网
50+
测试网请访问 [https://app.hyperliquid-testnet.xyz/API](https://app.hyperliquid-testnet.xyz/API)。测试资金可从[测试网水龙头](https://app.hyperliquid-testnet.xyz/faucet)领取。
4351
:::
4452

45-
### API 钱包授权
53+
#### 第二步 — 配置 `.env`
54+
55+
将 API 钱包的私钥填入 `.env`
56+
57+
```bash
58+
HYPERLIQUID_PRIVATE_KEY=0x<api-wallet-private-key>
59+
HYPERLIQUID_TESTNET=true # 主网设为 false
60+
```
4661

47-
Hyperliquid 支持使用 API 钱包(子钱包)进行程序化交易。如果你使用 API 钱包地址:
62+
#### 第三步 — 向 API 钱包充值
4863

49-
1. API 钱包可以查询余额,但**在未授权前无法交易**
50-
2. 用你的**主钱包**打开 Hyperliquid 网页端
51-
3. 进入**设置 → API 钱包**
52-
4. 授权 API 钱包地址
64+
在 Hyperliquid 上将 USDC 从主钱包转入 API 钱包地址,API 钱包需要有资金才能下单。
5365

54-
:::tip
55-
使用 API 钱包比直接使用主钱包私钥更安全——你可以随时通过网页界面撤销 API 钱包的访问权限。
66+
:::danger 私钥安全
67+
- 永远不要将 `.env` 提交到任何仓库
68+
- 永远不要与任何人分享你的私钥
69+
- 私钥丢失意味着资产永久丢失
70+
- 建议使用专用的交易钱包,不要使用持有主要资产的钱包
5671
:::
5772

5873
## 可选:外部数据 API

0 commit comments

Comments
 (0)