Skip to main content

Module client

Module client 

Source
Expand description

Client for the Polymarket Data API.

This module provides an HTTP client for interacting with the Polymarket Data API, which offers endpoints for querying user positions, trades, activity, and market data.

§Example

use polymarket_client_sdk::types::address;
use polymarket_client_sdk::data::{Client, types::request::PositionsRequest};

let client = Client::default();

let request = PositionsRequest::builder()
    .user(address!("56687bf447db6ffa42ffe2204a05edaa20f55839"))
    .build();

let positions = client.positions(&request).await?;
for position in positions {
    println!("{}: {} tokens", position.title, position.size);
}

Structs§

Client
HTTP client for the Polymarket Data API.