跳转到主要内容

Documentation Index

Fetch the complete documentation index at: https://docs.polymarket.com/llms.txt

Use this file to discover all available pages before exploring further.

Polymarket 提供 TypeScript、Python 和 Rust 的官方开源客户端。三者都支持完整的 CLOB API,包括市场数据、订单管理和身份验证。

安装

npm install @polymarket/clob-client-v2 viem

快速示例

import { ClobClient } from "@polymarket/clob-client-v2";

const client = new ClobClient({
  host: "https://clob.polymarket.com",
  chain: 137,
  signer,
  creds: apiCreds,
});

const markets = await client.getMarkets();

源代码

语言仓库
TypeScript@polymarket/clob-client-v2github.com/Polymarket/clob-client-v2
Pythonpy-clob-client-v2github.com/Polymarket/py-clob-client-v2
Rustpolymarket_client_sdk_v2github.com/Polymarket/rs-clob-client-v2
每个仓库的 /examples 目录中包含可运行的示例。

Relayer SDK

对于使用代理钱包的免 Gas 交易,Relayer 客户端负责通过 Polymarket 的 relayer 提交交易:
语言仓库
TypeScript@polymarket/builder-relayer-clientgithub.com/Polymarket/builder-relayer-client
Pythonpy-builder-relayer-clientgithub.com/Polymarket/py-builder-relayer-client

下一步

快速开始

设置客户端并下你的第一笔订单。

身份验证

了解 L1/L2 身份验证和 API 凭证。