https://api.pacifica.fiwss://ws.pacifica.fi/wsGET /api/v1/info # 市场信息
GET /api/v1/prices # 价格数据
GET /api/v1/book # 订单簿
GET /api/v1/trades # 历史交易
GET /api/v1/kline # K线数据
GET /api/v1/funding # 资金费率
POST /api/v1/account/info # 账户信息
POST /api/v1/account/leverage # 杠杆设置
GET /api/v1/account/positions # 仓位查询
GET /api/v1/account/balance # 余额查询
GET /api/v1/account/trades # 交易历史
GET /api/v1/account/funding # 资金历史
POST /api/v1/account/withdraw # 提现申请
POST /api/v1/account/margin_mode # 保证金模式
POST /api/v1/order/market # 市价单
POST /api/v1/order/limit # 限价单
POST /api/v1/order/stop # 止损单
POST /api/v1/order/cancel # 取消订单
POST /api/v1/order/batch # 批量下单
GET /api/v1/order/open # 当前委托
GET /api/v1/order/history # 订单历史
POST /api/v1/account/subaccount/create # 创建子账户
POST /api/v1/account/subaccount/transfer # 资金转移
| 订阅类型 | 主题格式 | 说明 |
|---|---|---|
| 价格 | prices@all |
所有交易对价格 |
| 订单簿 | orderbook@BTCUSDT |
指定交易对深度 |
| 交易 | trades@BTCUSDT |
最新成交 |
| K线 | candle@BTCUSDT@1m |
K线数据 |
| 余额 | balance@{account} |
账户余额变化 |
| 保证金 | margin@{account} |
保证金状态 |
| 仓位 | positions@{account} |
仓位变化 |
| 订单 | orders@{account} |
订单状态更新 |
// 签名计算
const message = `${method}${path}${timestamp}${body}`
const signature = nacl.sign.detached(new TextEncoder().encode(message), privateKeyBytes)
// 请求头
headers = {
'Content-Type': 'application/json',
'Pacifica-Signature': base64.encode(signature),
'Pacifica-Timestamp': timestamp,
}
import { PacificaAdapter } from './src/exchanges/pacifica/PacificaAdapter'
const adapter = new PacificaAdapter(client)
// 获取余额
const balances = await adapter.balances()
// 下限价单
const order = await adapter.placeOrder({
symbol: 'BTCUSDT',
side: 'BUY',
type: 'LIMIT',
quantity: '0.1',
price: '50000',
})
// 订阅实时数据
adapter.ws().on('depth', data => {
console.log('订单簿更新:', data)
})
📚 完整文档: docs/PACIFICA_API_REFERENCE.md
🧪 测试命令: yarn test:pacifica
🔗 官方文档: https://docs.pacifica.fi/api-documentation/api