https://github.com/0xnathanw/clob-rs
A polymarket CLOB client in rust.
https://github.com/0xnathanw/clob-rs
Last synced: 9 months ago
JSON representation
A polymarket CLOB client in rust.
- Host: GitHub
- URL: https://github.com/0xnathanw/clob-rs
- Owner: 0xNathanW
- License: mit
- Created: 2025-02-10T20:01:32.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-02-10T20:46:20.000Z (11 months ago)
- Last Synced: 2025-04-10T00:48:37.350Z (9 months ago)
- Language: Rust
- Size: 39.1 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# clob-rs
A PolyMarket CLOB API client in rust.
## Usage
2 options:
1. Build a client using:
- `fn new(base_url: &str) -> Self`
- `fn with_signer(mut self, private_key: &str, chain_id: u64) -> Result` for Level 1 access.
- `fn with_creds(mut self, creds: ApiCreds) -> Self` for Level 2 access.
2. Use `fn from_env() -> Result` where environment variables required are as follows:
- `CLOB_URL`: base http url.
- `PRIVATE_KEY`: wallet private key for signing.
- `CHAIN_ID`: associated blockchain id, 137 for polygon.
- `PROXY`: address of proxy wallet.
- 'SIG_TYPE': signature type, 1 for EOA, 2 for PolyProxy, 3 for PolyGnosisSafe.
All endpoint methods use the `pub async fn request(&self, args: RequestArgs<'_>) -> Result` function. Therefore future or changed endpoints can be accessed easily.