docs: sync with official Polymarket docs - 2026-04-20
This commit is contained in:
@@ -65,7 +65,7 @@ components:
|
||||
$ref: '#/components/schemas/Address'
|
||||
description: >-
|
||||
Your Polymarket wallet address where deposited funds will be
|
||||
credited as USDC.e
|
||||
credited as pUSD
|
||||
DepositResponse:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
@@ -39,7 +39,7 @@ paths:
|
||||
fromTokenAddress: '0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359'
|
||||
recipientAddress: '0x17eC161f126e82A8ba337f4022d574DBEaFef575'
|
||||
toChainId: '137'
|
||||
toTokenAddress: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
|
||||
toTokenAddress: '0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB'
|
||||
responses:
|
||||
'200':
|
||||
description: Quote retrieved successfully
|
||||
@@ -135,7 +135,7 @@ components:
|
||||
toTokenAddress:
|
||||
type: string
|
||||
description: Destination token address
|
||||
example: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
|
||||
example: '0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB'
|
||||
QuoteResponse:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
@@ -50,20 +50,20 @@ paths:
|
||||
fromTokenAddress: '11111111111111111111111111111111'
|
||||
fromAmountBaseUnit: '13566635'
|
||||
toChainId: '137'
|
||||
toTokenAddress: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
|
||||
toTokenAddress: '0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB'
|
||||
status: DEPOSIT_DETECTED
|
||||
- fromChainId: '1151111081099710'
|
||||
fromTokenAddress: '11111111111111111111111111111111'
|
||||
fromAmountBaseUnit: '13400000'
|
||||
toChainId: '137'
|
||||
toTokenAddress: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
|
||||
toTokenAddress: '0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB'
|
||||
createdTimeMs: 1757646914535
|
||||
status: PROCESSING
|
||||
- fromChainId: '1151111081099710'
|
||||
fromTokenAddress: '11111111111111111111111111111111'
|
||||
fromAmountBaseUnit: '13500152'
|
||||
toChainId: '137'
|
||||
toTokenAddress: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
|
||||
toTokenAddress: '0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB'
|
||||
txHash: >-
|
||||
3atr19NAiNCYt24RHM1WnzZp47RXskpTDzspJoCBBaMFwUB8fk37hFkxz35P5UEnnmWz21rb2t5wJ8pq3EE2XnxU
|
||||
createdTimeMs: 1757531217339
|
||||
@@ -123,7 +123,7 @@ components:
|
||||
toTokenAddress:
|
||||
type: string
|
||||
description: Destination token contract address
|
||||
example: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
|
||||
example: '0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB'
|
||||
status:
|
||||
type: string
|
||||
description: >
|
||||
|
||||
@@ -12,11 +12,11 @@ Polymarket provides official open-source clients in TypeScript, Python, and Rust
|
||||
|
||||
<CodeGroup>
|
||||
```bash TypeScript theme={null}
|
||||
npm install @polymarket/clob-client ethers@5
|
||||
npm install @polymarket/clob-client-v2 ethers@5
|
||||
```
|
||||
|
||||
```bash Python theme={null}
|
||||
pip install py-clob-client
|
||||
pip install py-clob-client-v2
|
||||
```
|
||||
|
||||
```bash Rust theme={null}
|
||||
@@ -28,14 +28,14 @@ Polymarket provides official open-source clients in TypeScript, Python, and Rust
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript theme={null}
|
||||
import { ClobClient } from "@polymarket/clob-client";
|
||||
import { ClobClient } from "@polymarket/clob-client-v2";
|
||||
|
||||
const client = new ClobClient(
|
||||
"https://clob.polymarket.com",
|
||||
137,
|
||||
const client = new ClobClient({
|
||||
host: "https://clob.polymarket.com",
|
||||
chain: 137,
|
||||
signer,
|
||||
apiCreds,
|
||||
);
|
||||
creds: apiCreds,
|
||||
});
|
||||
|
||||
const markets = await client.getMarkets();
|
||||
```
|
||||
@@ -46,7 +46,7 @@ Polymarket provides official open-source clients in TypeScript, Python, and Rust
|
||||
client = ClobClient(
|
||||
"https://clob.polymarket.com",
|
||||
key=private_key,
|
||||
chain_id=137,
|
||||
chain=137,
|
||||
creds=api_creds,
|
||||
)
|
||||
|
||||
@@ -67,25 +67,14 @@ Polymarket provides official open-source clients in TypeScript, Python, and Rust
|
||||
|
||||
## Source Code
|
||||
|
||||
| Language | Package | Repository |
|
||||
| ---------- | ------------------------- | ------------------------------------------------------------------------------------ |
|
||||
| TypeScript | `@polymarket/clob-client` | [github.com/Polymarket/clob-client](https://github.com/Polymarket/clob-client) |
|
||||
| Python | `py-clob-client` | [github.com/Polymarket/py-clob-client](https://github.com/Polymarket/py-clob-client) |
|
||||
| Rust | `polymarket-client-sdk` | [github.com/Polymarket/rs-clob-client](https://github.com/Polymarket/rs-clob-client) |
|
||||
| Language | Package | Repository |
|
||||
| ---------- | ---------------------------- | ------------------------------------------------------------------------------------------ |
|
||||
| TypeScript | `@polymarket/clob-client-v2` | [github.com/Polymarket/clob-client-v2](https://github.com/Polymarket/clob-client-v2) |
|
||||
| Python | `py-clob-client-v2` | [github.com/Polymarket/py-clob-client-v2](https://github.com/Polymarket/py-clob-client-v2) |
|
||||
| Rust | `polymarket-client-sdk` | [github.com/Polymarket/rs-clob-client-v2](https://github.com/Polymarket/rs-clob-client-v2) |
|
||||
|
||||
Each repository includes working examples in the `/examples` directory.
|
||||
|
||||
## Builder SDKs
|
||||
|
||||
If you're building an app through the [Builder Program](/builders/overview), additional signing SDKs are available:
|
||||
|
||||
| Language | Package | Repository |
|
||||
| ---------- | --------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| TypeScript | `@polymarket/builder-signing-sdk` | [github.com/Polymarket/builder-signing-sdk](https://github.com/Polymarket/builder-signing-sdk) |
|
||||
| Python | `py_builder_signing_sdk` | [github.com/Polymarket/py-builder-signing-sdk](https://github.com/Polymarket/py-builder-signing-sdk) |
|
||||
|
||||
See [Order Attribution](/trading/orders/attribution) for usage details.
|
||||
|
||||
## Relayer SDK
|
||||
|
||||
For [gasless transactions](/trading/gasless) using proxy wallets, the relayer client handles submitting transactions through Polymarket's relayer:
|
||||
|
||||
@@ -88,7 +88,7 @@ paths:
|
||||
- date: '2026-02-27'
|
||||
condition_id: >-
|
||||
0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af
|
||||
asset_address: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
|
||||
asset_address: '0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB'
|
||||
maker_address: '0xFeA4cB3dD4ca7CefD3368653B7D6FF9BcDFca604'
|
||||
rebated_fees_usdc: '0.237519'
|
||||
'400':
|
||||
@@ -137,7 +137,7 @@ components:
|
||||
asset_address:
|
||||
type: string
|
||||
description: Asset address (e.g. USDC contract)
|
||||
example: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
|
||||
example: '0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB'
|
||||
maker_address:
|
||||
type: string
|
||||
description: Maker's Ethereum address
|
||||
|
||||
@@ -123,7 +123,7 @@ paths:
|
||||
$ref: '#/components/schemas/SubmitRequest'
|
||||
example:
|
||||
from: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5'
|
||||
to: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174'
|
||||
to: '0xC011a7E12a19f7B1f670d46F03B03f3342E82DFB'
|
||||
proxyWallet: '0x6d8c4e9aDF5748Af82Dabe2C6225207770d6B4fa'
|
||||
data: 0x...
|
||||
nonce: '60'
|
||||
|
||||
@@ -69,8 +69,8 @@ paths:
|
||||
parameters:
|
||||
- name: condition_id
|
||||
in: path
|
||||
description: The condition ID of the market
|
||||
required: true
|
||||
description: The condition ID of the market
|
||||
schema:
|
||||
type: string
|
||||
example: '0xbd31dc8a20211944f6b70f31557f1001557b59905b7738480ca09bd4532f84af'
|
||||
|
||||
@@ -171,10 +171,11 @@ paths:
|
||||
example:
|
||||
error: could not fetch builder trades
|
||||
security:
|
||||
- polyBuilderApiKey: []
|
||||
polyBuilderPassphrase: []
|
||||
polyBuilderSignature: []
|
||||
polyBuilderTimestamp: []
|
||||
- polyApiKey: []
|
||||
polyAddress: []
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
BuilderTradesResponse:
|
||||
@@ -342,25 +343,30 @@ components:
|
||||
description: Last update timestamp
|
||||
example: '2024-01-01T00:00:00Z'
|
||||
securitySchemes:
|
||||
polyBuilderApiKey:
|
||||
polyApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_API_KEY
|
||||
description: Builder API key for authentication
|
||||
polyBuilderPassphrase:
|
||||
name: POLY_API_KEY
|
||||
description: Your API key
|
||||
polyAddress:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_PASSPHRASE
|
||||
description: Passphrase for builder authentication
|
||||
polyBuilderSignature:
|
||||
name: POLY_ADDRESS
|
||||
description: Ethereum address associated with the API key
|
||||
polySignature:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_SIGNATURE
|
||||
description: HMAC signature for builder authentication
|
||||
polyBuilderTimestamp:
|
||||
name: POLY_SIGNATURE
|
||||
description: HMAC signature of the request
|
||||
polyPassphrase:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_TIMESTAMP
|
||||
description: Unix timestamp for builder authentication
|
||||
name: POLY_PASSPHRASE
|
||||
description: API key passphrase
|
||||
polyTimestamp:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
@@ -123,10 +123,6 @@ paths:
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
- polyBuilderApiKey: []
|
||||
polyBuilderPassphrase: []
|
||||
polyBuilderSignature: []
|
||||
polyBuilderTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
OpenOrder:
|
||||
@@ -257,25 +253,5 @@ components:
|
||||
in: header
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
polyBuilderApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_API_KEY
|
||||
description: Builder API key for authentication
|
||||
polyBuilderPassphrase:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_PASSPHRASE
|
||||
description: Passphrase for builder authentication
|
||||
polyBuilderSignature:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_SIGNATURE
|
||||
description: HMAC signature for builder authentication
|
||||
polyBuilderTimestamp:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_TIMESTAMP
|
||||
description: Unix timestamp for builder authentication
|
||||
|
||||
````
|
||||
@@ -160,10 +160,6 @@ paths:
|
||||
polySignature: []
|
||||
polyPassphrase: []
|
||||
polyTimestamp: []
|
||||
- polyBuilderApiKey: []
|
||||
polyBuilderPassphrase: []
|
||||
polyBuilderSignature: []
|
||||
polyBuilderTimestamp: []
|
||||
components:
|
||||
schemas:
|
||||
OrdersResponse:
|
||||
@@ -321,25 +317,5 @@ components:
|
||||
in: header
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
polyBuilderApiKey:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_API_KEY
|
||||
description: Builder API key for authentication
|
||||
polyBuilderPassphrase:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_PASSPHRASE
|
||||
description: Passphrase for builder authentication
|
||||
polyBuilderSignature:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_SIGNATURE
|
||||
description: HMAC signature for builder authentication
|
||||
polyBuilderTimestamp:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: POLY_BUILDER_TIMESTAMP
|
||||
description: Unix timestamp for builder authentication
|
||||
|
||||
````
|
||||
@@ -61,14 +61,15 @@ paths:
|
||||
order:
|
||||
maker: '0x1234567890123456789012345678901234567890'
|
||||
signer: '0x1234567890123456789012345678901234567890'
|
||||
taker: '0x0000000000000000000000000000000000000000'
|
||||
tokenId: 0xabc123def456...
|
||||
makerAmount: '100000000'
|
||||
takerAmount: '200000000'
|
||||
side: BUY
|
||||
expiration: '1735689600'
|
||||
nonce: '0'
|
||||
feeRateBps: '30'
|
||||
timestamp: '1735689600000'
|
||||
metadata: ''
|
||||
builder: >-
|
||||
0x0000000000000000000000000000000000000000000000000000000000000000
|
||||
signature: 0x1234abcd...
|
||||
salt: 1234567890
|
||||
signatureType: 0
|
||||
@@ -276,14 +277,13 @@ components:
|
||||
required:
|
||||
- maker
|
||||
- signer
|
||||
- taker
|
||||
- tokenId
|
||||
- makerAmount
|
||||
- takerAmount
|
||||
- side
|
||||
- expiration
|
||||
- nonce
|
||||
- feeRateBps
|
||||
- timestamp
|
||||
- builder
|
||||
- signature
|
||||
- salt
|
||||
- signatureType
|
||||
@@ -298,10 +298,6 @@ components:
|
||||
type: string
|
||||
description: Ethereum address of the signer
|
||||
example: '0x1234567890123456789012345678901234567890'
|
||||
taker:
|
||||
type: string
|
||||
description: Ethereum address of the taker (0x0 for open orders)
|
||||
example: '0x0000000000000000000000000000000000000000'
|
||||
tokenId:
|
||||
type: string
|
||||
description: Token ID (asset ID) for the order
|
||||
@@ -325,14 +321,22 @@ components:
|
||||
type: string
|
||||
description: Unix timestamp when the order expires
|
||||
example: '1735689600'
|
||||
nonce:
|
||||
timestamp:
|
||||
type: string
|
||||
description: Order nonce
|
||||
example: '0'
|
||||
feeRateBps:
|
||||
description: >-
|
||||
Unix timestamp in milliseconds when the order was created (used for
|
||||
order uniqueness)
|
||||
example: '1735689600000'
|
||||
metadata:
|
||||
type: string
|
||||
description: Fee rate in basis points
|
||||
example: '30'
|
||||
description: Reserved for future use
|
||||
example: ''
|
||||
builder:
|
||||
type: string
|
||||
description: >-
|
||||
Builder code (bytes32) for integrator attribution. `0x` + 64 hex
|
||||
chars or empty.
|
||||
example: '0x0000000000000000000000000000000000000000000000000000000000000000'
|
||||
signature:
|
||||
type: string
|
||||
description: Cryptographic signature of the order
|
||||
|
||||
@@ -68,14 +68,15 @@ paths:
|
||||
- order:
|
||||
maker: '0x1234567890123456789012345678901234567890'
|
||||
signer: '0x1234567890123456789012345678901234567890'
|
||||
taker: '0x0000000000000000000000000000000000000000'
|
||||
tokenId: 0xabc123def456...
|
||||
makerAmount: '100000000'
|
||||
takerAmount: '200000000'
|
||||
side: BUY
|
||||
expiration: '1735689600'
|
||||
nonce: '0'
|
||||
feeRateBps: '30'
|
||||
timestamp: '1735689600000'
|
||||
metadata: ''
|
||||
builder: >-
|
||||
0x0000000000000000000000000000000000000000000000000000000000000000
|
||||
signature: 0x1234abcd...
|
||||
salt: 1234567890
|
||||
signatureType: 0
|
||||
@@ -85,14 +86,15 @@ paths:
|
||||
- order:
|
||||
maker: '0x1234567890123456789012345678901234567890'
|
||||
signer: '0x1234567890123456789012345678901234567890'
|
||||
taker: '0x0000000000000000000000000000000000000000'
|
||||
tokenId: 0xdef456abc789...
|
||||
makerAmount: '200000000'
|
||||
takerAmount: '100000000'
|
||||
side: SELL
|
||||
expiration: '1735689600'
|
||||
nonce: '0'
|
||||
feeRateBps: '30'
|
||||
timestamp: '1735689600000'
|
||||
metadata: ''
|
||||
builder: >-
|
||||
0x0000000000000000000000000000000000000000000000000000000000000000
|
||||
signature: 0x5678efgh...
|
||||
salt: 1234567891
|
||||
signatureType: 0
|
||||
@@ -298,14 +300,13 @@ components:
|
||||
required:
|
||||
- maker
|
||||
- signer
|
||||
- taker
|
||||
- tokenId
|
||||
- makerAmount
|
||||
- takerAmount
|
||||
- side
|
||||
- expiration
|
||||
- nonce
|
||||
- feeRateBps
|
||||
- timestamp
|
||||
- builder
|
||||
- signature
|
||||
- salt
|
||||
- signatureType
|
||||
@@ -320,10 +321,6 @@ components:
|
||||
type: string
|
||||
description: Ethereum address of the signer
|
||||
example: '0x1234567890123456789012345678901234567890'
|
||||
taker:
|
||||
type: string
|
||||
description: Ethereum address of the taker (0x0 for open orders)
|
||||
example: '0x0000000000000000000000000000000000000000'
|
||||
tokenId:
|
||||
type: string
|
||||
description: Token ID (asset ID) for the order
|
||||
@@ -347,14 +344,22 @@ components:
|
||||
type: string
|
||||
description: Unix timestamp when the order expires
|
||||
example: '1735689600'
|
||||
nonce:
|
||||
timestamp:
|
||||
type: string
|
||||
description: Order nonce
|
||||
example: '0'
|
||||
feeRateBps:
|
||||
description: >-
|
||||
Unix timestamp in milliseconds when the order was created (used for
|
||||
order uniqueness)
|
||||
example: '1735689600000'
|
||||
metadata:
|
||||
type: string
|
||||
description: Fee rate in basis points
|
||||
example: '30'
|
||||
description: Reserved for future use
|
||||
example: ''
|
||||
builder:
|
||||
type: string
|
||||
description: >-
|
||||
Builder code (bytes32) for integrator attribution. `0x` + 64 hex
|
||||
chars or empty.
|
||||
example: '0x0000000000000000000000000000000000000000000000000000000000000000'
|
||||
signature:
|
||||
type: string
|
||||
description: Cryptographic signature of the order
|
||||
|
||||
Reference in New Issue
Block a user