docs: sync with docs.polymarket.com - 2026-05-08
This commit is contained in:
@@ -266,14 +266,15 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
|
||||
|
||||
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
|
||||
const signer = createWalletClient({ account, transport: http() });
|
||||
const depositWalletAddress = process.env.DEPOSIT_WALLET_ADDRESS!;
|
||||
|
||||
const client = new ClobClient({
|
||||
host: "https://clob.polymarket.com",
|
||||
chain: 137,
|
||||
signer,
|
||||
creds: apiCreds, // Generated from L1 auth, API credentials enable L2 methods
|
||||
signatureType: 1, // signatureType explained below
|
||||
funderAddress, // funder explained below
|
||||
signatureType: 3, // POLY_1271, explained below
|
||||
funderAddress: depositWalletAddress, // deposit wallet funder
|
||||
});
|
||||
|
||||
// Now you can trade!
|
||||
@@ -295,8 +296,8 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
|
||||
chain_id=137,
|
||||
key=os.getenv("PRIVATE_KEY"),
|
||||
creds=api_creds, # Generated from L1 auth, API credentials enable L2 methods
|
||||
signature_type=1, # signatureType explained below
|
||||
funder=os.getenv("FUNDER_ADDRESS") # funder explained below
|
||||
signature_type=3, # POLY_1271, explained below
|
||||
funder=os.getenv("DEPOSIT_WALLET_ADDRESS")
|
||||
)
|
||||
|
||||
# Now you can trade!
|
||||
@@ -312,10 +313,12 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
|
||||
use polymarket_client_sdk_v2::clob::types::{Side, SignatureType};
|
||||
use polymarket_client_sdk_v2::types::dec;
|
||||
|
||||
let deposit_wallet = std::env::var("DEPOSIT_WALLET_ADDRESS")?.parse()?;
|
||||
|
||||
let client = Client::new("https://clob.polymarket.com", Config::default())?
|
||||
.authentication_builder(&signer)
|
||||
.signature_type(SignatureType::Proxy) // signatureType explained below
|
||||
// Funder auto-derived via CREATE2 for Proxy/GnosisSafe
|
||||
.funder(deposit_wallet)
|
||||
.signature_type(SignatureType::Poly1271)
|
||||
.authenticate()
|
||||
.await?;
|
||||
|
||||
@@ -343,17 +346,18 @@ The `POLY_SIGNATURE` for L2 is an HMAC-SHA256 signature created using the user's
|
||||
|
||||
When initializing the L2 client, you must specify your wallet **signatureType** and the **funder** address which holds the funds:
|
||||
|
||||
| Signature Type | Value | Description |
|
||||
| -------------- | ----- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| EOA | `0` | Standard Ethereum wallet (MetaMask). Funder is the EOA address and will need POL to pay gas on transactions. |
|
||||
| POLY\_PROXY | `1` | A custom proxy wallet only used with users who logged in via Magic Link email/Google. Using this requires the user to have exported their PK from Polymarket.com and imported into your app. |
|
||||
| GNOSIS\_SAFE | `2` | Gnosis Safe multisig proxy wallet (most common). Use this for any new or returning user who does not fit the other 2 types. |
|
||||
| Signature Type | Value | Description |
|
||||
| -------------- | ----- | -------------------------------------------------------------------------------------------------------------------------- |
|
||||
| EOA | `0` | Standard Ethereum wallet (MetaMask). Funder is the EOA address and will need POL to pay gas on transactions. |
|
||||
| POLY\_PROXY | `1` | Existing Polymarket proxy wallet flow, commonly used by users who logged in via Magic Link email/Google. |
|
||||
| GNOSIS\_SAFE | `2` | Existing Gnosis Safe wallet flow. Existing Safe users can continue using this type. |
|
||||
| POLY\_1271 | `3` | Deposit wallet flow for new API users. The funder is the deposit wallet address and orders are validated through ERC-1271. |
|
||||
|
||||
<Tip>
|
||||
The wallet address displayed to the user on Polymarket.com is the proxy wallet
|
||||
and should be used as the funder. These can be deterministically derived or
|
||||
you can deploy them on behalf of the user. These proxy wallets are
|
||||
automatically deployed for the user on their first login to Polymarket.com.
|
||||
New API users should use deposit wallets with `POLY_1271`. Existing Safe and
|
||||
Proxy users are unaffected and can keep using their current funder address and
|
||||
signature type. See the [Deposit Wallet Guide](/trading/deposit-wallets) for
|
||||
setup details.
|
||||
</Tip>
|
||||
|
||||
***
|
||||
|
||||
@@ -106,4 +106,4 @@ components:
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
|
||||
````
|
||||
````
|
||||
@@ -132,4 +132,4 @@ components:
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
|
||||
````
|
||||
````
|
||||
@@ -221,4 +221,4 @@ components:
|
||||
description: Impact cost of the transaction
|
||||
example: 0
|
||||
|
||||
````
|
||||
````
|
||||
@@ -96,4 +96,4 @@ components:
|
||||
description: Token decimals
|
||||
example: 6
|
||||
|
||||
````
|
||||
````
|
||||
@@ -151,4 +151,4 @@ components:
|
||||
when status is DEPOSIT_DETECTED)
|
||||
example: 1757531217339
|
||||
|
||||
````
|
||||
````
|
||||
@@ -113,4 +113,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -102,4 +102,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -77,7 +77,9 @@ Each repository includes working examples in the `/examples` directory.
|
||||
|
||||
## Relayer SDK
|
||||
|
||||
For [gasless transactions](/trading/gasless) using proxy wallets, the relayer client handles submitting transactions through Polymarket's relayer:
|
||||
For [gasless transactions](/trading/gasless), the relayer client handles deposit
|
||||
wallet creation and signed wallet batches for new API users. Existing Safe and
|
||||
Proxy wallet flows remain supported.
|
||||
|
||||
| Language | Package | Repository |
|
||||
| ---------- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
|
||||
|
||||
@@ -209,4 +209,4 @@ components:
|
||||
type: string
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -234,4 +234,4 @@ components:
|
||||
type: string
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -248,4 +248,4 @@ components:
|
||||
type: string
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -191,4 +191,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -218,4 +218,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -190,4 +190,4 @@ components:
|
||||
outcomeIndex:
|
||||
type: integer
|
||||
|
||||
````
|
||||
````
|
||||
@@ -137,4 +137,4 @@ components:
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x56687bf447db6ffa42ffe2204a05edaa20f55839'
|
||||
|
||||
````
|
||||
````
|
||||
@@ -94,4 +94,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -158,4 +158,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -190,4 +190,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -229,4 +229,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1 +1 @@
|
||||
null
|
||||
null
|
||||
@@ -102,4 +102,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -78,4 +78,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1210,4 +1210,4 @@ components:
|
||||
type: number
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1210,4 +1210,4 @@ components:
|
||||
type: number
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -105,4 +105,4 @@ components:
|
||||
type: boolean
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1468,4 +1468,4 @@ components:
|
||||
type: number
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1320,4 +1320,4 @@ components:
|
||||
type: number
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1 +1 @@
|
||||
null
|
||||
null
|
||||
@@ -112,4 +112,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -115,4 +115,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -111,4 +111,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -131,4 +131,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -148,4 +148,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -130,4 +130,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -127,4 +127,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -142,4 +142,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -101,4 +101,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -120,4 +120,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -190,4 +190,4 @@ components:
|
||||
description: Order size
|
||||
example: '100'
|
||||
|
||||
````
|
||||
````
|
||||
@@ -190,4 +190,4 @@ components:
|
||||
description: Order size
|
||||
example: '100'
|
||||
|
||||
````
|
||||
````
|
||||
@@ -100,4 +100,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -118,4 +118,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -112,4 +112,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -116,4 +116,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -135,4 +135,4 @@ components:
|
||||
type: number
|
||||
format: float
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1206,4 +1206,4 @@ components:
|
||||
type: string
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1206,4 +1206,4 @@ components:
|
||||
type: string
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -105,4 +105,4 @@ components:
|
||||
type: boolean
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -134,4 +134,4 @@ components:
|
||||
type: number
|
||||
format: float
|
||||
|
||||
````
|
||||
````
|
||||
@@ -180,4 +180,4 @@ components:
|
||||
winner:
|
||||
type: boolean
|
||||
|
||||
````
|
||||
````
|
||||
@@ -127,4 +127,4 @@ components:
|
||||
winner:
|
||||
type: boolean
|
||||
|
||||
````
|
||||
````
|
||||
@@ -127,4 +127,4 @@ components:
|
||||
winner:
|
||||
type: boolean
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1422,4 +1422,4 @@ components:
|
||||
type: string
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1333,4 +1333,4 @@ components:
|
||||
type: string
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -74,4 +74,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -91,4 +91,4 @@ components:
|
||||
pattern: ^0x[a-fA-F0-9]{64}$
|
||||
example: '0xdd22472e552920b8438158ea7238bfadfa4f736aa4cee91a6b86c39ead110917'
|
||||
|
||||
````
|
||||
````
|
||||
@@ -84,4 +84,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -85,4 +85,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1 +1 @@
|
||||
null
|
||||
null
|
||||
@@ -1 +1 @@
|
||||
null
|
||||
null
|
||||
@@ -1 +1 @@
|
||||
null
|
||||
null
|
||||
@@ -1 +1 @@
|
||||
null
|
||||
null
|
||||
@@ -1 +1 @@
|
||||
null
|
||||
null
|
||||
@@ -1 +1 @@
|
||||
null
|
||||
null
|
||||
@@ -1 +1 @@
|
||||
null
|
||||
null
|
||||
@@ -151,4 +151,4 @@ components:
|
||||
type: boolean
|
||||
description: Whether the user is a moderator
|
||||
|
||||
````
|
||||
````
|
||||
@@ -155,4 +155,4 @@ components:
|
||||
type: string
|
||||
description: Error message
|
||||
|
||||
````
|
||||
````
|
||||
@@ -136,4 +136,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -103,4 +103,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -205,4 +205,4 @@ components:
|
||||
pattern: ^0x[a-fA-F0-9]{40}$
|
||||
example: '0x6e0c80c90ea6c15917308F820Eac91Ce2724B5b5'
|
||||
|
||||
````
|
||||
````
|
||||
@@ -118,4 +118,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -266,4 +266,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -123,4 +123,4 @@ components:
|
||||
required:
|
||||
- error
|
||||
|
||||
````
|
||||
````
|
||||
@@ -293,4 +293,4 @@ components:
|
||||
description: Refund receiver address
|
||||
example: '0x0000000000000000000000000000000000000000'
|
||||
|
||||
````
|
||||
````
|
||||
@@ -224,4 +224,4 @@ components:
|
||||
- start_date
|
||||
- rate_per_day
|
||||
|
||||
````
|
||||
````
|
||||
@@ -255,4 +255,4 @@ components:
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
````
|
||||
@@ -404,4 +404,4 @@ components:
|
||||
- start_date
|
||||
- rate_per_day
|
||||
|
||||
````
|
||||
````
|
||||
@@ -284,4 +284,4 @@ components:
|
||||
- start_date
|
||||
- rate_per_day
|
||||
|
||||
````
|
||||
````
|
||||
@@ -172,4 +172,4 @@ components:
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
````
|
||||
@@ -217,4 +217,4 @@ components:
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
````
|
||||
@@ -494,4 +494,4 @@ components:
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1364,4 +1364,4 @@ components:
|
||||
type: number
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1206,4 +1206,4 @@ components:
|
||||
type: number
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1256,4 +1256,4 @@ components:
|
||||
type: number
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -87,4 +87,4 @@ components:
|
||||
Series identifier linking the sport to a specific tournament or
|
||||
season series
|
||||
|
||||
````
|
||||
````
|
||||
@@ -62,4 +62,4 @@ components:
|
||||
items:
|
||||
type: string
|
||||
|
||||
````
|
||||
````
|
||||
@@ -134,4 +134,4 @@ components:
|
||||
format: date-time
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -1 +1 @@
|
||||
null
|
||||
null
|
||||
@@ -91,4 +91,4 @@ components:
|
||||
type: integer
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -91,4 +91,4 @@ components:
|
||||
type: integer
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -106,4 +106,4 @@ components:
|
||||
type: boolean
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -106,4 +106,4 @@ components:
|
||||
type: boolean
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -114,4 +114,4 @@ components:
|
||||
type: boolean
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -114,4 +114,4 @@ components:
|
||||
type: boolean
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -130,4 +130,4 @@ components:
|
||||
type: boolean
|
||||
nullable: true
|
||||
|
||||
````
|
||||
````
|
||||
@@ -167,4 +167,4 @@ components:
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
````
|
||||
@@ -207,4 +207,4 @@ components:
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
````
|
||||
@@ -202,4 +202,4 @@ components:
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
````
|
||||
@@ -191,4 +191,4 @@ components:
|
||||
name: POLY_TIMESTAMP
|
||||
description: Unix timestamp of the request
|
||||
|
||||
````
|
||||
````
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user