Skip to content

Commit ae4583f

Browse files
author
Daniel Kislitsya
committed
Update CLOB examples to production host
1 parent 8ba5008 commit ae4583f

37 files changed

Lines changed: 738 additions & 55 deletions

) {

Lines changed: 327 additions & 0 deletions
Large diffs are not rendered by default.

-clob-client-

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
3+
4+
Commands marked with * may be preceded by a number, _N.
5+
Notes in parentheses indicate the behavior if _N is given.
6+
A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
7+
8+
h H Display this help.
9+
q :q Q :Q ZZ Exit.
10+
---------------------------------------------------------------------------
11+
12+
MMOOVVIINNGG
13+
14+
e ^E j ^N CR * Forward one line (or _N lines).
15+
y ^Y k ^K ^P * Backward one line (or _N lines).
16+
ESC-j * Forward one file line (or _N file lines).
17+
ESC-k * Backward one file line (or _N file lines).
18+
f ^F ^V SPACE * Forward one window (or _N lines).
19+
b ^B ESC-v * Backward one window (or _N lines).
20+
z * Forward one window (and set window to _N).
21+
w * Backward one window (and set window to _N).
22+
ESC-SPACE * Forward one window, but don't stop at end-of-file.
23+
ESC-b * Backward one window, but don't stop at beginning-of-file.
24+
d ^D * Forward one half-window (and set half-window to _N).
25+
u ^U * Backward one half-window (and set half-window to _N).
26+
ESC-) RightArrow * Right one half screen width (or _N positions).
27+
ESC-( LeftArrow * Left one half screen width (or _N positions).
28+
ESC-} ^RightArrow Right to last column displayed.
29+
ESC-{ ^LeftArrow Left to first column.

-clob-client-v2

Lines changed: 327 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ use polymarket_client_sdk_v2::clob::{Client, Config};
160160
async fn main() -> anyhow::Result<()> {
161161
let private_key = std::env::var(PRIVATE_KEY_VAR).expect("Need a private key");
162162
let signer = LocalSigner::from_str(&private_key)?.with_chain_id(Some(POLYGON));
163-
let client = Client::new("https://clob-v2.polymarket.com", Config::default())?
163+
let client = Client::new("https://clob.polymarket.com", Config::default())?
164164
.authentication_builder(&signer)
165165
.authenticate()
166166
.await?;
@@ -179,7 +179,7 @@ async fn main() -> anyhow::Result<()> {
179179
For proxy/Safe wallets, the funder address is **automatically derived** using CREATE2 from your signer's EOA address:
180180

181181
```rust,ignore
182-
let client = Client::new("https://clob-v2.polymarket.com", Config::default())?
182+
let client = Client::new("https://clob.polymarket.com", Config::default())?
183183
.authentication_builder(&signer)
184184
.signature_type(SignatureType::GnosisSafe) // Funder auto-derived via CREATE2
185185
.authenticate()
@@ -192,7 +192,7 @@ shown on polymarket.com when you log in with a browser wallet.
192192
If you need to override the derived address (e.g., for advanced use cases), you can explicitly provide it:
193193

194194
```rust,ignore
195-
let client = Client::new("https://clob-v2.polymarket.com", Config::default())?
195+
let client = Client::new("https://clob.polymarket.com", Config::default())?
196196
.authentication_builder(&signer)
197197
.funder(address!("<your-polymarket-wallet-address>"))
198198
.signature_type(SignatureType::GnosisSafe)
@@ -231,7 +231,7 @@ See [`SignatureType`](src/clob/types/mod.rs) for more information.
231231
For deposit wallets, pass the deployed deposit wallet as the funder and use `SignatureType::Poly1271`:
232232

233233
```rust,ignore
234-
let client = Client::new("https://clob-v2.polymarket.com", Config::default())?
234+
let client = Client::new("https://clob.polymarket.com", Config::default())?
235235
.authentication_builder(&signer)
236236
.funder(deposit_wallet)
237237
.signature_type(SignatureType::Poly1271)
@@ -255,7 +255,7 @@ use polymarket_client_sdk_v2::types::Decimal;
255255
async fn main() -> anyhow::Result<()> {
256256
let private_key = std::env::var(PRIVATE_KEY_VAR).expect("Need a private key");
257257
let signer = LocalSigner::from_str(&private_key)?.with_chain_id(Some(POLYGON));
258-
let client = Client::new("https://clob-v2.polymarket.com", Config::default())?
258+
let client = Client::new("https://clob.polymarket.com", Config::default())?
259259
.authentication_builder(&signer)
260260
.authenticate()
261261
.await?;
@@ -293,7 +293,7 @@ use rust_decimal_macros::dec;
293293
async fn main() -> anyhow::Result<()> {
294294
let private_key = std::env::var(PRIVATE_KEY_VAR).expect("Need a private key");
295295
let signer = LocalSigner::from_str(&private_key)?.with_chain_id(Some(POLYGON));
296-
let client = Client::new("https://clob-v2.polymarket.com", Config::default())?
296+
let client = Client::new("https://clob.polymarket.com", Config::default())?
297297
.authentication_builder(&signer)
298298
.authenticate()
299299
.await?;
@@ -322,7 +322,7 @@ the protocol by pointing the client at the corresponding host:
322322

323323
| Protocol | Host | Collateral | EIP-712 domain version |
324324
|----------|-----------------------------------|--------------|------------------------|
325-
| V2 | `https://clob-v2.polymarket.com` | pUSD | `"2"` |
325+
| V2 | `https://clob.polymarket.com` | pUSD | `"2"` |
326326
| V1 | `https://clob.polymarket.com` | USDC.e | `"1"` |
327327

328328
V2 orders add `timestamp`, `metadata`, and `builder` fields. V1 orders use `taker`, `nonce`,
@@ -390,7 +390,7 @@ async fn main() -> anyhow::Result<()> {
390390
let signer = LocalSigner::from_str(&private_key)?.with_chain_id(Some(POLYGON));
391391
392392
let config = Config::builder().builder_code(builder_code).build();
393-
let client = Client::new("https://clob-v2.polymarket.com", config)?
393+
let client = Client::new("https://clob.polymarket.com", config)?
394394
.authentication_builder(&signer)
395395
.authenticate()
396396
.await?;

examples/clob/account/get_balance_allowance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use polymarket_client_sdk_v2::{POLYGON, PRIVATE_KEY_VAR};
1717
#[tokio::main]
1818
async fn main() -> anyhow::Result<()> {
1919
let host =
20-
std::env::var("CLOB_API_URL").unwrap_or_else(|_| "https://clob-v2.polymarket.com".into());
20+
std::env::var("CLOB_API_URL").unwrap_or_else(|_| "https://clob.polymarket.com".into());
2121
let signer =
2222
LocalSigner::from_str(&std::env::var(PRIVATE_KEY_VAR)?)?.with_chain_id(Some(POLYGON));
2323

examples/clob/account/get_notifications.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use polymarket_client_sdk_v2::{POLYGON, PRIVATE_KEY_VAR};
1515
#[tokio::main]
1616
async fn main() -> anyhow::Result<()> {
1717
let host =
18-
std::env::var("CLOB_API_URL").unwrap_or_else(|_| "https://clob-v2.polymarket.com".into());
18+
std::env::var("CLOB_API_URL").unwrap_or_else(|_| "https://clob.polymarket.com".into());
1919
let signer =
2020
LocalSigner::from_str(&std::env::var(PRIVATE_KEY_VAR)?)?.with_chain_id(Some(POLYGON));
2121

examples/clob/account/get_open_orders.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use polymarket_client_sdk_v2::{POLYGON, PRIVATE_KEY_VAR};
1717
#[tokio::main]
1818
async fn main() -> anyhow::Result<()> {
1919
let host =
20-
std::env::var("CLOB_API_URL").unwrap_or_else(|_| "https://clob-v2.polymarket.com".into());
20+
std::env::var("CLOB_API_URL").unwrap_or_else(|_| "https://clob.polymarket.com".into());
2121
let signer =
2222
LocalSigner::from_str(&std::env::var(PRIVATE_KEY_VAR)?)?.with_chain_id(Some(POLYGON));
2323

examples/clob/account/get_trades.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use polymarket_client_sdk_v2::{POLYGON, PRIVATE_KEY_VAR};
1717
#[tokio::main]
1818
async fn main() -> anyhow::Result<()> {
1919
let host =
20-
std::env::var("CLOB_API_URL").unwrap_or_else(|_| "https://clob-v2.polymarket.com".into());
20+
std::env::var("CLOB_API_URL").unwrap_or_else(|_| "https://clob.polymarket.com".into());
2121
let signer =
2222
LocalSigner::from_str(&std::env::var(PRIVATE_KEY_VAR)?)?.with_chain_id(Some(POLYGON));
2323

examples/clob/account/update_balance_allowance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use polymarket_client_sdk_v2::{POLYGON, PRIVATE_KEY_VAR};
1717
#[tokio::main]
1818
async fn main() -> anyhow::Result<()> {
1919
let host =
20-
std::env::var("CLOB_API_URL").unwrap_or_else(|_| "https://clob-v2.polymarket.com".into());
20+
std::env::var("CLOB_API_URL").unwrap_or_else(|_| "https://clob.polymarket.com".into());
2121
let signer =
2222
LocalSigner::from_str(&std::env::var(PRIVATE_KEY_VAR)?)?.with_chain_id(Some(POLYGON));
2323

examples/clob/async.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async fn main() -> anyhow::Result<()> {
5353
}
5454

5555
async fn unauthenticated() -> anyhow::Result<()> {
56-
let client = Client::new("https://clob-v2.polymarket.com", Config::default())?;
56+
let client = Client::new("https://clob.polymarket.com", Config::default())?;
5757
let client_clone = client.clone();
5858

5959
let token_id = U256::from_str(
@@ -115,7 +115,7 @@ async fn authenticated() -> anyhow::Result<()> {
115115
};
116116
let signer = LocalSigner::from_str(&private_key)?.with_chain_id(Some(POLYGON));
117117

118-
let client = Client::new("https://clob-v2.polymarket.com", Config::default())?
118+
let client = Client::new("https://clob.polymarket.com", Config::default())?
119119
.authentication_builder(&signer)
120120
.authenticate()
121121
.await?;

0 commit comments

Comments
 (0)