pmxtjs 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Cargo.toml ADDED
@@ -0,0 +1,15 @@
1
+ [package]
2
+ name = "pmxt-node"
3
+ version = "0.0.1"
4
+ edition = "2021"
5
+
6
+ [lib]
7
+ crate-type = ["cdylib"]
8
+
9
+ [dependencies]
10
+ napi = { version = "2.12", features = ["async"] }
11
+ napi-derive = "2.12"
12
+ pmxt-core = { path = "../../crates/core" }
13
+
14
+ [build-dependencies]
15
+ napi-build = "2.0"
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # PMXT: The ccxt for Prediction Markets
2
+
3
+ PMXT is a unified endpoint for trading on prediction markets (Polymarket, Kalshi, etc.), written in Rust for performance with native bindings for Python and Node.js.
4
+
5
+ ## Architecture
6
+
7
+ This project is organized as a Cargo Workspace:
8
+
9
+ - **`crates/core`**: Defines the shared `Exchange` trait and data models (`Market`, `Order`, `Ticker`).
10
+ - **`crates/polymarket`**: The implementation for Polymarket.
11
+ - **`bindings/python`**: The native Python extension (using PyO3).
12
+
13
+ ## Development
14
+
15
+ ### Prerequisites
16
+
17
+ - Rust (cargo)
18
+ - Python 3.9+
19
+ - `maturin` (for building Python bindings) -> `pip install maturin`
20
+
21
+ ### Building Python Bindings
22
+
23
+ To build and install the python library into your current environment:
24
+
25
+ ```bash
26
+ cd bindings/python
27
+ maturin develop
28
+ ```
29
+
30
+ ### Usage (Python)
31
+
32
+ ```python
33
+ import pmxt
34
+ import asyncio
35
+
36
+ async def main():
37
+ exchange = pmxt.Polymarket(api_key="your_key")
38
+ markets = await exchange.load_markets()
39
+ print(markets)
40
+
41
+ asyncio.run(main())
42
+ ```
43
+
44
+ ## Contributing
45
+
46
+ 1. Implement `Exchange` trait for a new market in `crates/new_market`.
47
+ 2. Register it in `bindings/python/src/lib.rs`.
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "pmxtjs",
3
+ "version": "0.0.1",
4
+ "description": "The ccxt for Prediction Markets (Node.js bindings)",
5
+ "main": "index.js",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/samueltinnerholm/PMXT.git"
9
+ },
10
+ "keywords": [
11
+ "prediction-markets",
12
+ "trading",
13
+ "polymarket",
14
+ "kalshi",
15
+ "ccxt"
16
+ ],
17
+ "author": "PMXT Team",
18
+ "license": "MIT",
19
+ "bugs": {
20
+ "url": "https://github.com/samueltinnerholm/PMXT/issues"
21
+ },
22
+ "homepage": "https://github.com/samueltinnerholm/PMXT#readme"
23
+ }
package/src/lib.rs ADDED
@@ -0,0 +1,6 @@
1
+ use napi_derive::napi;
2
+
3
+ #[napi]
4
+ pub fn info() -> String {
5
+ "PMXT Node.js Bindings".to_string()
6
+ }