kalshi-typescript 2.1.0 → 2.1.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/.openapi-generator-ignore +1 -0
- package/README.md +29 -197
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,212 +1,44 @@
|
|
|
1
|
-
|
|
1
|
+
# Kalshi Trading API - TypeScript SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Complete TypeScript/JavaScript SDK for the Kalshi trading platform
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
* Node.js
|
|
7
|
-
* Webpack
|
|
8
|
-
* Browserify
|
|
5
|
+
This TypeScript package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
- API version: 2.0.0
|
|
8
|
+
- Package version: 2.1.0
|
|
9
|
+
- Generator version: 7.15.0
|
|
10
|
+
- Build package: org.openapitools.codegen.languages.TypeScriptAxiosClientCodegen
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
* CommonJS
|
|
16
|
-
* ES6 module system
|
|
12
|
+
## Requirements
|
|
17
13
|
|
|
18
|
-
|
|
14
|
+
Node.js 14+
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
```
|
|
24
|
-
npm install
|
|
25
|
-
npm run build
|
|
16
|
+
## Installation & Usage
|
|
17
|
+
```bash
|
|
18
|
+
npm install kalshi-typescript
|
|
26
19
|
```
|
|
27
20
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
First build the package then run `npm publish`
|
|
21
|
+
## Getting Started
|
|
31
22
|
|
|
32
|
-
|
|
23
|
+
```typescript
|
|
24
|
+
import { Configuration, PortfolioApi } from 'kalshi-typescript';
|
|
33
25
|
|
|
34
|
-
|
|
26
|
+
// Configure the client
|
|
27
|
+
const config = new Configuration({
|
|
28
|
+
basePath: 'https://api.elections.kalshi.com/trade-api/v2',
|
|
29
|
+
apiKey: 'your-api-key-id',
|
|
30
|
+
privateKeyPath: 'path/to/private_key.pem'
|
|
31
|
+
// or privateKeyPem: 'your-private-key-string'
|
|
32
|
+
});
|
|
35
33
|
|
|
36
|
-
|
|
34
|
+
// Initialize API client
|
|
35
|
+
const portfolioApi = new PortfolioApi(config);
|
|
37
36
|
|
|
37
|
+
// Make API calls
|
|
38
|
+
const balance = await portfolioApi.getBalance();
|
|
39
|
+
console.log(`Balance: $${balance.data.balance / 100}`);
|
|
38
40
|
```
|
|
39
|
-
npm install @kalshi/trading-api@2.1.0 --save
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
_unPublished (not recommended):_
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
npm install PATH_TO_GENERATED_PACKAGE --save
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Documentation for API Endpoints
|
|
49
|
-
|
|
50
|
-
All URIs are relative to *https://api.elections.kalshi.com/trade-api/v2*
|
|
51
|
-
|
|
52
|
-
Class | Method | HTTP request | Description
|
|
53
|
-
------------ | ------------- | ------------- | -------------
|
|
54
|
-
*ApiKeysApi* | [**createApiKey**](docs/ApiKeysApi.md#createapikey) | **POST** /api_keys | Create API Key
|
|
55
|
-
*ApiKeysApi* | [**deleteApiKey**](docs/ApiKeysApi.md#deleteapikey) | **DELETE** /api_keys/{api_key} | Delete API Key
|
|
56
|
-
*ApiKeysApi* | [**generateApiKey**](docs/ApiKeysApi.md#generateapikey) | **POST** /api_keys/generate | Generate API Key
|
|
57
|
-
*ApiKeysApi* | [**getApiKeys**](docs/ApiKeysApi.md#getapikeys) | **GET** /api_keys | Get API Keys
|
|
58
|
-
*CommunicationsApi* | [**acceptQuote**](docs/CommunicationsApi.md#acceptquote) | **PUT** /communications/quotes/{quote_id}/accept | Accept Quote
|
|
59
|
-
*CommunicationsApi* | [**confirmQuote**](docs/CommunicationsApi.md#confirmquote) | **PUT** /communications/quotes/{quote_id}/confirm | Confirm Quote
|
|
60
|
-
*CommunicationsApi* | [**createQuote**](docs/CommunicationsApi.md#createquote) | **POST** /communications/quotes | Create Quote
|
|
61
|
-
*CommunicationsApi* | [**createRFQ**](docs/CommunicationsApi.md#createrfq) | **POST** /communications/rfqs | Create RFQ
|
|
62
|
-
*CommunicationsApi* | [**deleteQuote**](docs/CommunicationsApi.md#deletequote) | **DELETE** /communications/quotes/{quote_id} | Delete Quote
|
|
63
|
-
*CommunicationsApi* | [**deleteRFQ**](docs/CommunicationsApi.md#deleterfq) | **DELETE** /communications/rfqs/{rfq_id} | Delete RFQ
|
|
64
|
-
*CommunicationsApi* | [**getCommunicationsID**](docs/CommunicationsApi.md#getcommunicationsid) | **GET** /communications/id | Get Communications ID
|
|
65
|
-
*CommunicationsApi* | [**getQuote**](docs/CommunicationsApi.md#getquote) | **GET** /communications/quotes/{quote_id} | Get Quote
|
|
66
|
-
*CommunicationsApi* | [**getQuotes**](docs/CommunicationsApi.md#getquotes) | **GET** /communications/quotes | Get Quotes
|
|
67
|
-
*CommunicationsApi* | [**getRFQ**](docs/CommunicationsApi.md#getrfq) | **GET** /communications/rfqs/{rfq_id} | Get RFQ
|
|
68
|
-
*CommunicationsApi* | [**getRFQs**](docs/CommunicationsApi.md#getrfqs) | **GET** /communications/rfqs | Get RFQs
|
|
69
|
-
*EventsApi* | [**getEvent**](docs/EventsApi.md#getevent) | **GET** /events/{event_ticker} | Get Event
|
|
70
|
-
*EventsApi* | [**getEventMetadata**](docs/EventsApi.md#geteventmetadata) | **GET** /events/{event_ticker}/metadata | Get Event Metadata
|
|
71
|
-
*EventsApi* | [**getEvents**](docs/EventsApi.md#getevents) | **GET** /events | Get Events
|
|
72
|
-
*ExchangeApi* | [**getExchangeAnnouncements**](docs/ExchangeApi.md#getexchangeannouncements) | **GET** /exchange/announcements | Get Exchange Announcements
|
|
73
|
-
*ExchangeApi* | [**getExchangeSchedule**](docs/ExchangeApi.md#getexchangeschedule) | **GET** /exchange/schedule | Get Exchange Schedule
|
|
74
|
-
*ExchangeApi* | [**getExchangeStatus**](docs/ExchangeApi.md#getexchangestatus) | **GET** /exchange/status | Get Exchange Status
|
|
75
|
-
*ExchangeApi* | [**getUserDataTimestamp**](docs/ExchangeApi.md#getuserdatatimestamp) | **GET** /exchange/user_data_timestamp | Get User Data Timestamp
|
|
76
|
-
*MarketsApi* | [**getMarket**](docs/MarketsApi.md#getmarket) | **GET** /markets/{ticker} | Get Market
|
|
77
|
-
*MarketsApi* | [**getMarketCandlesticks**](docs/MarketsApi.md#getmarketcandlesticks) | **GET** /series/{ticker}/markets/{market_ticker}/candlesticks | Get Market Candlesticks
|
|
78
|
-
*MarketsApi* | [**getMarketOrderbook**](docs/MarketsApi.md#getmarketorderbook) | **GET** /markets/{ticker}/orderbook | Get Market Orderbook
|
|
79
|
-
*MarketsApi* | [**getMarkets**](docs/MarketsApi.md#getmarkets) | **GET** /markets | Get Markets
|
|
80
|
-
*MarketsApi* | [**getTrades**](docs/MarketsApi.md#gettrades) | **GET** /markets/trades | Get Trades
|
|
81
|
-
*MilestonesApi* | [**getMilestone**](docs/MilestonesApi.md#getmilestone) | **GET** /milestones/{milestone_id} | Get Milestone
|
|
82
|
-
*MilestonesApi* | [**getMilestones**](docs/MilestonesApi.md#getmilestones) | **GET** /milestones | Get Milestones
|
|
83
|
-
*MultivariateCollectionsApi* | [**getMultivariateEventCollection**](docs/MultivariateCollectionsApi.md#getmultivariateeventcollection) | **GET** /multivariate_event_collections/{collection_ticker} | Get Multivariate Event Collection
|
|
84
|
-
*MultivariateCollectionsApi* | [**getMultivariateEventCollections**](docs/MultivariateCollectionsApi.md#getmultivariateeventcollections) | **GET** /multivariate_event_collections | Get Multivariate Event Collections
|
|
85
|
-
*MultivariateCollectionsApi* | [**lookupMultivariateEventCollectionBundle**](docs/MultivariateCollectionsApi.md#lookupmultivariateeventcollectionbundle) | **POST** /multivariate_event_collections/{collection_ticker}/lookup | Lookup Multivariate Event Collection Bundle
|
|
86
|
-
*PortfolioApi* | [**amendOrder**](docs/PortfolioApi.md#amendorder) | **POST** /portfolio/orders/{order_id}/amend | Amend Order
|
|
87
|
-
*PortfolioApi* | [**batchCancelOrders**](docs/PortfolioApi.md#batchcancelorders) | **DELETE** /portfolio/orders/batched | Batch Cancel Orders
|
|
88
|
-
*PortfolioApi* | [**batchCreateOrders**](docs/PortfolioApi.md#batchcreateorders) | **POST** /portfolio/orders/batched | Batch Create Orders
|
|
89
|
-
*PortfolioApi* | [**cancelOrder**](docs/PortfolioApi.md#cancelorder) | **DELETE** /portfolio/orders/{order_id} | Cancel Order
|
|
90
|
-
*PortfolioApi* | [**createOrder**](docs/PortfolioApi.md#createorder) | **POST** /portfolio/orders | Create Order
|
|
91
|
-
*PortfolioApi* | [**createOrderGroup**](docs/PortfolioApi.md#createordergroup) | **POST** /portfolio/order_groups/create | Create Order Group
|
|
92
|
-
*PortfolioApi* | [**decreaseOrder**](docs/PortfolioApi.md#decreaseorder) | **POST** /portfolio/orders/{order_id}/decrease | Decrease Order
|
|
93
|
-
*PortfolioApi* | [**deleteOrderGroup**](docs/PortfolioApi.md#deleteordergroup) | **DELETE** /portfolio/order_groups/{order_group_id} | Delete Order Group
|
|
94
|
-
*PortfolioApi* | [**getBalance**](docs/PortfolioApi.md#getbalance) | **GET** /portfolio/balance | Get Balance
|
|
95
|
-
*PortfolioApi* | [**getFills**](docs/PortfolioApi.md#getfills) | **GET** /portfolio/fills | Get Fills
|
|
96
|
-
*PortfolioApi* | [**getOrder**](docs/PortfolioApi.md#getorder) | **GET** /portfolio/orders/{order_id} | Get Order
|
|
97
|
-
*PortfolioApi* | [**getOrderGroups**](docs/PortfolioApi.md#getordergroups) | **GET** /portfolio/order_groups | Get Order Groups
|
|
98
|
-
*PortfolioApi* | [**getOrderQueuePosition**](docs/PortfolioApi.md#getorderqueueposition) | **GET** /portfolio/orders/{order_id}/queue_position | Get Order Queue Position
|
|
99
|
-
*PortfolioApi* | [**getOrders**](docs/PortfolioApi.md#getorders) | **GET** /portfolio/orders | Get Orders
|
|
100
|
-
*PortfolioApi* | [**getPositions**](docs/PortfolioApi.md#getpositions) | **GET** /portfolio/positions | Get Positions
|
|
101
|
-
*PortfolioApi* | [**getQueuePositions**](docs/PortfolioApi.md#getqueuepositions) | **POST** /portfolio/orders/queue_positions | Get Queue Positions
|
|
102
|
-
*PortfolioApi* | [**getSettlements**](docs/PortfolioApi.md#getsettlements) | **GET** /portfolio/settlements | Get Settlements
|
|
103
|
-
*PortfolioApi* | [**getTotalRestingOrderValue**](docs/PortfolioApi.md#gettotalrestingordervalue) | **GET** /portfolio/summary/total_resting_order_value | Get Total Resting Order Value
|
|
104
|
-
*PortfolioApi* | [**resetOrderGroup**](docs/PortfolioApi.md#resetordergroup) | **POST** /portfolio/order_groups/{order_group_id}/reset | Reset Order Group
|
|
105
|
-
*SeriesApi* | [**getSeries**](docs/SeriesApi.md#getseries) | **GET** /series | Get Series
|
|
106
|
-
*SeriesApi* | [**getSeriesByTicker**](docs/SeriesApi.md#getseriesbyticker) | **GET** /series/{ticker} | Get Series by Ticker
|
|
107
|
-
*StructuredTargetsApi* | [**getStructuredTarget**](docs/StructuredTargetsApi.md#getstructuredtarget) | **GET** /structured_targets/{structured_target_id} | Get Structured Target
|
|
108
|
-
*StructuredTargetsApi* | [**getStructuredTargets**](docs/StructuredTargetsApi.md#getstructuredtargets) | **GET** /structured_targets | Get Structured Targets
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
### Documentation For Models
|
|
112
|
-
|
|
113
|
-
- [AcceptQuoteRequest](docs/AcceptQuoteRequest.md)
|
|
114
|
-
- [AmendOrderRequest](docs/AmendOrderRequest.md)
|
|
115
|
-
- [AmendOrderResponse](docs/AmendOrderResponse.md)
|
|
116
|
-
- [Announcement](docs/Announcement.md)
|
|
117
|
-
- [ApiKey](docs/ApiKey.md)
|
|
118
|
-
- [BatchCancelOrdersRequest](docs/BatchCancelOrdersRequest.md)
|
|
119
|
-
- [BatchCancelOrdersResponse](docs/BatchCancelOrdersResponse.md)
|
|
120
|
-
- [BatchCancelOrdersResponseResponsesInner](docs/BatchCancelOrdersResponseResponsesInner.md)
|
|
121
|
-
- [BatchCreateOrdersRequest](docs/BatchCreateOrdersRequest.md)
|
|
122
|
-
- [BatchCreateOrdersResponse](docs/BatchCreateOrdersResponse.md)
|
|
123
|
-
- [BatchCreateOrdersResponseResponsesInner](docs/BatchCreateOrdersResponseResponsesInner.md)
|
|
124
|
-
- [CancelOrderResponse](docs/CancelOrderResponse.md)
|
|
125
|
-
- [Candlestick](docs/Candlestick.md)
|
|
126
|
-
- [CreateApiKeyRequest](docs/CreateApiKeyRequest.md)
|
|
127
|
-
- [CreateApiKeyResponse](docs/CreateApiKeyResponse.md)
|
|
128
|
-
- [CreateOrderGroupRequest](docs/CreateOrderGroupRequest.md)
|
|
129
|
-
- [CreateOrderGroupResponse](docs/CreateOrderGroupResponse.md)
|
|
130
|
-
- [CreateOrderRequest](docs/CreateOrderRequest.md)
|
|
131
|
-
- [CreateOrderResponse](docs/CreateOrderResponse.md)
|
|
132
|
-
- [CreateQuoteRequest](docs/CreateQuoteRequest.md)
|
|
133
|
-
- [CreateQuoteResponse](docs/CreateQuoteResponse.md)
|
|
134
|
-
- [CreateRFQRequest](docs/CreateRFQRequest.md)
|
|
135
|
-
- [CreateRFQResponse](docs/CreateRFQResponse.md)
|
|
136
|
-
- [DailySchedule](docs/DailySchedule.md)
|
|
137
|
-
- [DecreaseOrderRequest](docs/DecreaseOrderRequest.md)
|
|
138
|
-
- [DecreaseOrderResponse](docs/DecreaseOrderResponse.md)
|
|
139
|
-
- [ErrorResponse](docs/ErrorResponse.md)
|
|
140
|
-
- [ErrorResponseError](docs/ErrorResponseError.md)
|
|
141
|
-
- [Event](docs/Event.md)
|
|
142
|
-
- [ExchangeStatus](docs/ExchangeStatus.md)
|
|
143
|
-
- [Fill](docs/Fill.md)
|
|
144
|
-
- [GenerateApiKeyRequest](docs/GenerateApiKeyRequest.md)
|
|
145
|
-
- [GenerateApiKeyResponse](docs/GenerateApiKeyResponse.md)
|
|
146
|
-
- [GetApiKeysResponse](docs/GetApiKeysResponse.md)
|
|
147
|
-
- [GetBalanceResponse](docs/GetBalanceResponse.md)
|
|
148
|
-
- [GetCommunicationsIDResponse](docs/GetCommunicationsIDResponse.md)
|
|
149
|
-
- [GetEventMetadataResponse](docs/GetEventMetadataResponse.md)
|
|
150
|
-
- [GetEventResponse](docs/GetEventResponse.md)
|
|
151
|
-
- [GetEventsResponse](docs/GetEventsResponse.md)
|
|
152
|
-
- [GetExchangeAnnouncementsResponse](docs/GetExchangeAnnouncementsResponse.md)
|
|
153
|
-
- [GetExchangeScheduleResponse](docs/GetExchangeScheduleResponse.md)
|
|
154
|
-
- [GetExchangeScheduleResponseSchedule](docs/GetExchangeScheduleResponseSchedule.md)
|
|
155
|
-
- [GetFillsResponse](docs/GetFillsResponse.md)
|
|
156
|
-
- [GetMarketCandlesticksResponse](docs/GetMarketCandlesticksResponse.md)
|
|
157
|
-
- [GetMarketOrderbookResponse](docs/GetMarketOrderbookResponse.md)
|
|
158
|
-
- [GetMarketOrderbookResponseOrderbook](docs/GetMarketOrderbookResponseOrderbook.md)
|
|
159
|
-
- [GetMarketResponse](docs/GetMarketResponse.md)
|
|
160
|
-
- [GetMarketsResponse](docs/GetMarketsResponse.md)
|
|
161
|
-
- [GetMilestoneResponse](docs/GetMilestoneResponse.md)
|
|
162
|
-
- [GetMilestonesResponse](docs/GetMilestonesResponse.md)
|
|
163
|
-
- [GetMultivariateEventCollectionResponse](docs/GetMultivariateEventCollectionResponse.md)
|
|
164
|
-
- [GetMultivariateEventCollectionsResponse](docs/GetMultivariateEventCollectionsResponse.md)
|
|
165
|
-
- [GetOrderGroupsResponse](docs/GetOrderGroupsResponse.md)
|
|
166
|
-
- [GetOrderQueuePositionResponse](docs/GetOrderQueuePositionResponse.md)
|
|
167
|
-
- [GetOrderResponse](docs/GetOrderResponse.md)
|
|
168
|
-
- [GetOrdersResponse](docs/GetOrdersResponse.md)
|
|
169
|
-
- [GetPositionsResponse](docs/GetPositionsResponse.md)
|
|
170
|
-
- [GetQueuePositionsRequest](docs/GetQueuePositionsRequest.md)
|
|
171
|
-
- [GetQueuePositionsResponse](docs/GetQueuePositionsResponse.md)
|
|
172
|
-
- [GetQuoteResponse](docs/GetQuoteResponse.md)
|
|
173
|
-
- [GetQuotesResponse](docs/GetQuotesResponse.md)
|
|
174
|
-
- [GetRFQResponse](docs/GetRFQResponse.md)
|
|
175
|
-
- [GetRFQsResponse](docs/GetRFQsResponse.md)
|
|
176
|
-
- [GetSeriesByTickerResponse](docs/GetSeriesByTickerResponse.md)
|
|
177
|
-
- [GetSeriesResponse](docs/GetSeriesResponse.md)
|
|
178
|
-
- [GetSettlementsResponse](docs/GetSettlementsResponse.md)
|
|
179
|
-
- [GetStructuredTargetResponse](docs/GetStructuredTargetResponse.md)
|
|
180
|
-
- [GetStructuredTargetsResponse](docs/GetStructuredTargetsResponse.md)
|
|
181
|
-
- [GetTotalRestingOrderValueResponse](docs/GetTotalRestingOrderValueResponse.md)
|
|
182
|
-
- [GetTradesResponse](docs/GetTradesResponse.md)
|
|
183
|
-
- [GetUserDataTimestampResponse](docs/GetUserDataTimestampResponse.md)
|
|
184
|
-
- [LookupBundleRequest](docs/LookupBundleRequest.md)
|
|
185
|
-
- [LookupBundleRequestBundleInner](docs/LookupBundleRequestBundleInner.md)
|
|
186
|
-
- [LookupBundleResponse](docs/LookupBundleResponse.md)
|
|
187
|
-
- [Market](docs/Market.md)
|
|
188
|
-
- [Milestone](docs/Milestone.md)
|
|
189
|
-
- [MultivariateEventCollection](docs/MultivariateEventCollection.md)
|
|
190
|
-
- [MultivariateEventCollectionEventsInner](docs/MultivariateEventCollectionEventsInner.md)
|
|
191
|
-
- [Order](docs/Order.md)
|
|
192
|
-
- [OrderGroup](docs/OrderGroup.md)
|
|
193
|
-
- [OrderbookLevel](docs/OrderbookLevel.md)
|
|
194
|
-
- [Position](docs/Position.md)
|
|
195
|
-
- [Quote](docs/Quote.md)
|
|
196
|
-
- [RFQ](docs/RFQ.md)
|
|
197
|
-
- [Series](docs/Series.md)
|
|
198
|
-
- [Settlement](docs/Settlement.md)
|
|
199
|
-
- [StructuredTarget](docs/StructuredTarget.md)
|
|
200
|
-
- [Trade](docs/Trade.md)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
<a id="documentation-for-authorization"></a>
|
|
204
|
-
## Documentation For Authorization
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
Authentication schemes defined for the API:
|
|
208
|
-
<a id="bearerAuth"></a>
|
|
209
|
-
### bearerAuth
|
|
210
41
|
|
|
211
|
-
|
|
42
|
+
## Documentation
|
|
212
43
|
|
|
44
|
+
Full documentation is available at [docs.kalshi.com](https://docs.kalshi.com)
|