@liberfi.io/react-predict 0.1.15 → 0.1.16
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/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -11
- package/dist/index.mjs.map +1 -1
- package/dist/{server-9UGzVqNH.d.mts → server-C52oqeh8.d.mts} +12 -12
- package/dist/{server-9UGzVqNH.d.ts → server-C52oqeh8.d.ts} +12 -12
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +10 -10
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +10 -10
- package/dist/server.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -40,8 +40,8 @@ var PredictClient = class {
|
|
|
40
40
|
* Maps to `GET /api/v1/events/:slug?source=...`.
|
|
41
41
|
*
|
|
42
42
|
* @param slug - Canonical event slug (e.g. "will-trump-win-2024" for Polymarket
|
|
43
|
-
* or "KXBTCD-25FEB-T68000" for
|
|
44
|
-
* @param source - Upstream provider (`"
|
|
43
|
+
* or "KXBTCD-25FEB-T68000" for Kalshi).
|
|
44
|
+
* @param source - Upstream provider (`"kalshi"` or `"polymarket"`).
|
|
45
45
|
* @returns The matching event.
|
|
46
46
|
* @throws When the server responds with 404 or any other non-2xx status.
|
|
47
47
|
*/
|
|
@@ -69,7 +69,7 @@ var PredictClient = class {
|
|
|
69
69
|
* Maps to `GET /api/v1/markets/:slug?source=...`.
|
|
70
70
|
*
|
|
71
71
|
* @param slug - Canonical market slug.
|
|
72
|
-
* @param source - Upstream provider (`"
|
|
72
|
+
* @param source - Upstream provider (`"kalshi"` or `"polymarket"`).
|
|
73
73
|
* @returns The matching market.
|
|
74
74
|
* @throws When the server responds with 404 or any other non-2xx status.
|
|
75
75
|
*/
|
|
@@ -124,7 +124,7 @@ var PredictClient = class {
|
|
|
124
124
|
*
|
|
125
125
|
* Maps to `GET /api/v1/balance?source=...&user=...`.
|
|
126
126
|
*
|
|
127
|
-
* @param source - Provider source (`"
|
|
127
|
+
* @param source - Provider source (`"kalshi"` for Solana, `"polymarket"` for Polygon).
|
|
128
128
|
* @param user - Wallet address.
|
|
129
129
|
*/
|
|
130
130
|
async getBalance(source, user) {
|
|
@@ -177,14 +177,14 @@ var PredictClient = class {
|
|
|
177
177
|
// -------------------------------------------------------------------------
|
|
178
178
|
// DFlow trading
|
|
179
179
|
// -------------------------------------------------------------------------
|
|
180
|
-
/** Maps to `POST /api/v1/orders/
|
|
180
|
+
/** Maps to `POST /api/v1/orders/kalshi/quote`. */
|
|
181
181
|
async createDFlowQuote(body) {
|
|
182
|
-
const url = `${this.endpoint}/api/v1/orders/
|
|
182
|
+
const url = `${this.endpoint}/api/v1/orders/kalshi/quote`;
|
|
183
183
|
return await httpPost(url, body);
|
|
184
184
|
}
|
|
185
|
-
/** Maps to `POST /api/v1/orders/
|
|
185
|
+
/** Maps to `POST /api/v1/orders/kalshi/submit`. */
|
|
186
186
|
async submitDFlowTransaction(body) {
|
|
187
|
-
const url = `${this.endpoint}/api/v1/orders/
|
|
187
|
+
const url = `${this.endpoint}/api/v1/orders/kalshi/submit`;
|
|
188
188
|
return await httpPost(url, body);
|
|
189
189
|
}
|
|
190
190
|
// -------------------------------------------------------------------------
|
|
@@ -193,11 +193,11 @@ var PredictClient = class {
|
|
|
193
193
|
/**
|
|
194
194
|
* Check DFlow KYC verification status for a wallet address.
|
|
195
195
|
*
|
|
196
|
-
* Maps to `GET /api/v1/kyc/
|
|
196
|
+
* Maps to `GET /api/v1/kyc/kalshi?wallet_address=...`.
|
|
197
197
|
*/
|
|
198
198
|
async checkDFlowKYC(walletAddress) {
|
|
199
199
|
const query = buildQuery({ wallet_address: walletAddress });
|
|
200
|
-
const url = `${this.endpoint}/api/v1/kyc/
|
|
200
|
+
const url = `${this.endpoint}/api/v1/kyc/kalshi${query}`;
|
|
201
201
|
return await httpGet(url);
|
|
202
202
|
}
|
|
203
203
|
// -------------------------------------------------------------------------
|
|
@@ -1344,7 +1344,7 @@ function useRealtimeTrades({
|
|
|
1344
1344
|
if (!old) return old;
|
|
1345
1345
|
const syntheticTrade = {
|
|
1346
1346
|
id: trade.trade_id ?? `ws-${msg.ts}`,
|
|
1347
|
-
source: "
|
|
1347
|
+
source: "kalshi",
|
|
1348
1348
|
side: trade.side,
|
|
1349
1349
|
outcome: trade.outcome ?? "",
|
|
1350
1350
|
outcome_index: 0,
|