@alango/dr-manhattan 0.1.2 → 0.1.4
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/README.md +39 -1
- package/dist/index.d.ts +362 -311
- package/dist/index.js +614 -261
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ CCXT-style unified API for prediction markets in TypeScript.
|
|
|
15
15
|
| [Polymarket](https://polymarket.com) | ✅ | ✅ | Polygon |
|
|
16
16
|
| [Limitless](https://limitless.exchange) | ✅ | ✅ | Base |
|
|
17
17
|
| [Opinion](https://opinion.trade) | ✅ | ❌ | BNB |
|
|
18
|
+
| [Kalshi](https://kalshi.com) | ✅ | ❌ | - |
|
|
18
19
|
|
|
19
20
|
## Installation
|
|
20
21
|
|
|
@@ -32,7 +33,7 @@ yarn add @alango/dr-manhattan
|
|
|
32
33
|
import { createExchange, listExchanges, MarketUtils } from '@alango/dr-manhattan';
|
|
33
34
|
|
|
34
35
|
// List available exchanges
|
|
35
|
-
console.log(listExchanges()); // ['polymarket', 'limitless', 'opinion']
|
|
36
|
+
console.log(listExchanges()); // ['polymarket', 'limitless', 'opinion', 'kalshi']
|
|
36
37
|
|
|
37
38
|
// Create exchange instance (no auth required for public data)
|
|
38
39
|
const polymarket = createExchange('polymarket');
|
|
@@ -101,6 +102,43 @@ const opinion = new Opinion({
|
|
|
101
102
|
});
|
|
102
103
|
```
|
|
103
104
|
|
|
105
|
+
### Kalshi
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
import { Kalshi } from '@alango/dr-manhattan';
|
|
109
|
+
|
|
110
|
+
// With RSA private key file
|
|
111
|
+
const kalshi = new Kalshi({
|
|
112
|
+
apiKeyId: process.env.KALSHI_API_KEY_ID,
|
|
113
|
+
privateKeyPath: '/path/to/kalshi_private_key.pem',
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Or with PEM content directly
|
|
117
|
+
const kalshi = new Kalshi({
|
|
118
|
+
apiKeyId: process.env.KALSHI_API_KEY_ID,
|
|
119
|
+
privateKeyPem: process.env.KALSHI_PRIVATE_KEY_PEM,
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
// Demo environment
|
|
123
|
+
const kalshiDemo = new Kalshi({
|
|
124
|
+
apiKeyId: process.env.KALSHI_API_KEY_ID,
|
|
125
|
+
privateKeyPath: '/path/to/private_key.pem',
|
|
126
|
+
demo: true,
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// Fetch markets (no auth required)
|
|
130
|
+
const markets = await kalshi.fetchMarkets({ limit: 10 });
|
|
131
|
+
|
|
132
|
+
// Create order (auth required)
|
|
133
|
+
const order = await kalshi.createOrder({
|
|
134
|
+
marketId: 'INXD-24DEC31-B5000',
|
|
135
|
+
outcome: 'Yes',
|
|
136
|
+
side: OrderSide.BUY,
|
|
137
|
+
price: 0.55,
|
|
138
|
+
size: 10,
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
104
142
|
## API Reference
|
|
105
143
|
|
|
106
144
|
### Exchange Methods
|