@newyorkcompute/kalshi-tui 0.1.0 → 0.2.0
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 +35 -0
- package/dist/App.d.ts +2 -1
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +38 -36
- package/dist/App.js.map +1 -1
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +28 -33
- package/dist/cli.js.map +1 -1
- package/dist/components/Footer.d.ts +6 -0
- package/dist/components/Footer.d.ts.map +1 -0
- package/dist/components/Footer.js +10 -0
- package/dist/components/Footer.js.map +1 -0
- package/dist/components/Header.d.ts +9 -2
- package/dist/components/Header.d.ts.map +1 -1
- package/dist/components/Header.js +7 -9
- package/dist/components/Header.js.map +1 -1
- package/dist/components/Markets.d.ts +21 -0
- package/dist/components/Markets.d.ts.map +1 -0
- package/dist/components/Markets.js +24 -0
- package/dist/components/Markets.js.map +1 -0
- package/dist/components/Orderbook.d.ts +18 -5
- package/dist/components/Orderbook.d.ts.map +1 -1
- package/dist/components/Orderbook.js +25 -36
- package/dist/components/Orderbook.js.map +1 -1
- package/dist/components/Positions.d.ts +13 -2
- package/dist/components/Positions.d.ts.map +1 -1
- package/dist/components/Positions.js +10 -17
- package/dist/components/Positions.js.map +1 -1
- package/dist/components/index.d.ts +8 -10
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +8 -11
- package/dist/components/index.js.map +1 -1
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +4 -4
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useKalshi.d.ts +21 -12
- package/dist/hooks/useKalshi.d.ts.map +1 -1
- package/dist/hooks/useKalshi.js +139 -19
- package/dist/hooks/useKalshi.js.map +1 -1
- package/dist/utils.d.ts +32 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +74 -0
- package/dist/utils.js.map +1 -0
- package/dist/utils.test.d.ts +2 -0
- package/dist/utils.test.d.ts.map +1 -0
- package/dist/utils.test.js +101 -0
- package/dist/utils.test.js.map +1 -0
- package/package.json +6 -8
- package/dist/components/HelpModal.d.ts +0 -5
- package/dist/components/HelpModal.d.ts.map +0 -1
- package/dist/components/HelpModal.js +0 -19
- package/dist/components/HelpModal.js.map +0 -1
- package/dist/components/MarketList.d.ts +0 -5
- package/dist/components/MarketList.d.ts.map +0 -1
- package/dist/components/MarketList.js +0 -68
- package/dist/components/MarketList.js.map +0 -1
- package/dist/components/OrderEntry.d.ts +0 -9
- package/dist/components/OrderEntry.d.ts.map +0 -1
- package/dist/components/OrderEntry.js +0 -77
- package/dist/components/OrderEntry.js.map +0 -1
- package/dist/components/SearchBar.d.ts +0 -5
- package/dist/components/SearchBar.d.ts.map +0 -1
- package/dist/components/SearchBar.js +0 -27
- package/dist/components/SearchBar.js.map +0 -1
- package/dist/components/StatusBar.d.ts +0 -5
- package/dist/components/StatusBar.d.ts.map +0 -1
- package/dist/components/StatusBar.js +0 -9
- package/dist/components/StatusBar.js.map +0 -1
- package/dist/components/ui/Box.d.ts +0 -14
- package/dist/components/ui/Box.d.ts.map +0 -1
- package/dist/components/ui/Box.js +0 -9
- package/dist/components/ui/Box.js.map +0 -1
- package/dist/components/ui/Sparkline.d.ts +0 -11
- package/dist/components/ui/Sparkline.d.ts.map +0 -1
- package/dist/components/ui/Sparkline.js +0 -32
- package/dist/components/ui/Sparkline.js.map +0 -1
- package/dist/hooks/useMarkets.d.ts +0 -13
- package/dist/hooks/useMarkets.d.ts.map +0 -1
- package/dist/hooks/useMarkets.js +0 -89
- package/dist/hooks/useMarkets.js.map +0 -1
- package/dist/hooks/useOrderbook.d.ts +0 -13
- package/dist/hooks/useOrderbook.d.ts.map +0 -1
- package/dist/hooks/useOrderbook.js +0 -81
- package/dist/hooks/useOrderbook.js.map +0 -1
- package/dist/hooks/usePortfolio.d.ts +0 -18
- package/dist/hooks/usePortfolio.d.ts.map +0 -1
- package/dist/hooks/usePortfolio.js +0 -84
- package/dist/hooks/usePortfolio.js.map +0 -1
- package/dist/stores/app-store.d.ts +0 -17
- package/dist/stores/app-store.d.ts.map +0 -1
- package/dist/stores/app-store.js +0 -21
- package/dist/stores/app-store.js.map +0 -1
- package/dist/theme.d.ts +0 -31
- package/dist/theme.d.ts.map +0 -1
- package/dist/theme.js +0 -37
- package/dist/theme.js.map +0 -1
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Box, Text } from "ink";
|
|
3
|
-
import { formatCurrency, truncate } from "@newyorkcompute/kalshi-core";
|
|
4
|
-
import { usePortfolio } from "../hooks/usePortfolio.js";
|
|
5
|
-
import { useAppStore } from "../stores/app-store.js";
|
|
6
2
|
/**
|
|
7
|
-
* Positions
|
|
3
|
+
* Positions Component
|
|
4
|
+
* Displays open positions with P&L
|
|
8
5
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const quantity = Math.abs(position.position);
|
|
18
|
-
const exposure = position.market_exposure;
|
|
19
|
-
return (_jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { color: "white", children: truncate(position.ticker, 18) }), _jsxs(Box, { children: [_jsxs(Text, { color: side === "YES" ? "green" : "red", children: [side === "YES" ? "+" : "-", quantity] }), _jsxs(Text, { color: "gray", children: [" ", side] })] }), _jsx(Text, { color: "white", children: formatCurrency(exposure) })] }, position.ticker));
|
|
20
|
-
}), positions.length > 0 && (_jsxs(Box, { marginTop: 1, justifyContent: "space-between", children: [_jsx(Text, { color: "gray", children: "Total Exposure:" }), _jsx(Text, { color: "white", bold: true, children: formatCurrency(totalExposure) })] }))] })] }));
|
|
6
|
+
import { Box, Text } from 'ink';
|
|
7
|
+
export function Positions({ positions, height }) {
|
|
8
|
+
const formatCurrency = (cents) => `$${(cents / 100).toFixed(2)}`;
|
|
9
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", height: height, width: "100%", children: [_jsx(Box, { paddingX: 1, children: _jsx(Text, { bold: true, children: " POSITIONS " }) }), _jsx(Box, { flexDirection: "column", paddingX: 1, flexGrow: 1, children: positions.length === 0 ? (_jsx(Text, { color: "gray", children: "No open positions" })) : (positions.slice(0, height - 3).map((pos) => {
|
|
10
|
+
const side = pos.position > 0 ? 'YES' : 'NO';
|
|
11
|
+
const sideColor = pos.position > 0 ? 'green' : 'red';
|
|
12
|
+
return (_jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { children: pos.ticker.slice(0, 18) }), _jsxs(Box, { children: [_jsxs(Text, { color: sideColor, children: [Math.abs(pos.position), " ", side] }), _jsxs(Text, { children: [" ", formatCurrency(pos.market_exposure)] })] })] }, pos.ticker));
|
|
13
|
+
})) })] }));
|
|
21
14
|
}
|
|
22
15
|
//# sourceMappingURL=Positions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Positions.js","sourceRoot":"","sources":["../../src/components/Positions.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Positions.js","sourceRoot":"","sources":["../../src/components/Positions.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAahC,MAAM,UAAU,SAAS,CAAC,EAAE,SAAS,EAAE,MAAM,EAAkB;IAC7D,MAAM,cAAc,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;IAEzE,OAAO,CACL,MAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,WAAW,EAAC,QAAQ,EACpB,WAAW,EAAC,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,KAAK,EAAC,MAAM,aAGZ,KAAC,GAAG,IAAC,QAA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/Box.js";
|
|
10
|
-
export { Sparkline } from "./ui/Sparkline.js";
|
|
1
|
+
/**
|
|
2
|
+
* Component exports
|
|
3
|
+
*/
|
|
4
|
+
export { Header } from './Header.js';
|
|
5
|
+
export { Markets } from './Markets.js';
|
|
6
|
+
export { Orderbook } from './Orderbook.js';
|
|
7
|
+
export { Positions } from './Positions.js';
|
|
8
|
+
export { Footer } from './Footer.js';
|
|
11
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/components/index.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
// UI components
|
|
10
|
-
export { Panel } from "./ui/Box.js";
|
|
11
|
-
export { Sparkline } from "./ui/Sparkline.js";
|
|
1
|
+
/**
|
|
2
|
+
* Component exports
|
|
3
|
+
*/
|
|
4
|
+
export { Header } from './Header.js';
|
|
5
|
+
export { Markets } from './Markets.js';
|
|
6
|
+
export { Orderbook } from './Orderbook.js';
|
|
7
|
+
export { Positions } from './Positions.js';
|
|
8
|
+
export { Footer } from './Footer.js';
|
|
12
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
1
|
+
/**
|
|
2
|
+
* Hook exports
|
|
3
|
+
*/
|
|
4
|
+
export { useKalshi } from './useKalshi.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export {
|
|
1
|
+
/**
|
|
2
|
+
* Hook exports
|
|
3
|
+
*/
|
|
4
|
+
export { useKalshi } from './useKalshi.js';
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
import { type KalshiConfig } from "@newyorkcompute/kalshi-core";
|
|
2
|
-
import type { MarketApi, PortfolioApi, OrdersApi } from "kalshi-typescript";
|
|
3
|
-
interface UseKalshiResult {
|
|
4
|
-
config: KalshiConfig | null;
|
|
5
|
-
marketApi: MarketApi | null;
|
|
6
|
-
portfolioApi: PortfolioApi | null;
|
|
7
|
-
ordersApi: OrdersApi | null;
|
|
8
|
-
isConfigured: boolean;
|
|
9
|
-
configError: string | null;
|
|
10
|
-
}
|
|
11
1
|
/**
|
|
12
|
-
* Hook
|
|
2
|
+
* useKalshi Hook
|
|
3
|
+
* Manages connection to Kalshi API and data fetching
|
|
13
4
|
*/
|
|
14
|
-
|
|
5
|
+
import { type MarketDisplay, type OrderbookDisplay } from '@newyorkcompute/kalshi-core';
|
|
6
|
+
interface Position {
|
|
7
|
+
ticker: string;
|
|
8
|
+
position: number;
|
|
9
|
+
market_exposure: number;
|
|
10
|
+
}
|
|
11
|
+
interface MarketWithHistory extends MarketDisplay {
|
|
12
|
+
previousYesBid?: number;
|
|
13
|
+
}
|
|
14
|
+
interface UseKalshiReturn {
|
|
15
|
+
markets: MarketWithHistory[];
|
|
16
|
+
orderbook: OrderbookDisplay | null;
|
|
17
|
+
balance: number | null;
|
|
18
|
+
positions: Position[];
|
|
19
|
+
isConnected: boolean;
|
|
20
|
+
error: string | null;
|
|
21
|
+
selectMarket: (ticker: string) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare function useKalshi(): UseKalshiReturn;
|
|
15
24
|
export {};
|
|
16
25
|
//# sourceMappingURL=useKalshi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKalshi.d.ts","sourceRoot":"","sources":["../../src/hooks/useKalshi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useKalshi.d.ts","sourceRoot":"","sources":["../../src/hooks/useKalshi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACtB,MAAM,6BAA6B,CAAC;AAGrC,UAAU,QAAQ;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB;AAGD,UAAU,iBAAkB,SAAQ,aAAa;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,eAAe;IACvB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACnC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC;AAED,wBAAgB,SAAS,IAAI,eAAe,CAoK3C"}
|
package/dist/hooks/useKalshi.js
CHANGED
|
@@ -1,31 +1,151 @@
|
|
|
1
|
-
import { useState, useEffect, useMemo } from "react";
|
|
2
|
-
import { getKalshiConfig, createMarketApi, createPortfolioApi, createOrdersApi, } from "@newyorkcompute/kalshi-core";
|
|
3
1
|
/**
|
|
4
|
-
* Hook
|
|
2
|
+
* useKalshi Hook
|
|
3
|
+
* Manages connection to Kalshi API and data fetching
|
|
5
4
|
*/
|
|
5
|
+
import { useState, useEffect, useCallback, useRef } from 'react';
|
|
6
|
+
import { createMarketApi, createPortfolioApi, getKalshiConfig, } from '@newyorkcompute/kalshi-core';
|
|
6
7
|
export function useKalshi() {
|
|
7
|
-
const [
|
|
8
|
-
const [
|
|
8
|
+
const [markets, setMarkets] = useState([]);
|
|
9
|
+
const [orderbook, setOrderbook] = useState(null);
|
|
10
|
+
const [balance, setBalance] = useState(null);
|
|
11
|
+
const [positions, setPositions] = useState([]);
|
|
12
|
+
const [isConnected, setIsConnected] = useState(false);
|
|
13
|
+
const [error, setError] = useState(null);
|
|
14
|
+
const [selectedTicker, setSelectedTicker] = useState(null);
|
|
15
|
+
// API clients
|
|
16
|
+
const marketApiRef = useRef(null);
|
|
17
|
+
const portfolioApiRef = useRef(null);
|
|
18
|
+
// Store previous prices for change detection
|
|
19
|
+
const previousPricesRef = useRef(new Map());
|
|
20
|
+
// Initialize API clients
|
|
9
21
|
useEffect(() => {
|
|
10
22
|
try {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
23
|
+
const config = getKalshiConfig();
|
|
24
|
+
marketApiRef.current = createMarketApi(config);
|
|
25
|
+
portfolioApiRef.current = createPortfolioApi(config);
|
|
26
|
+
setIsConnected(true);
|
|
27
|
+
setError(null);
|
|
14
28
|
}
|
|
15
|
-
catch (
|
|
16
|
-
|
|
29
|
+
catch (err) {
|
|
30
|
+
setError(err instanceof Error ? err.message : 'Failed to initialize');
|
|
31
|
+
setIsConnected(false);
|
|
17
32
|
}
|
|
18
33
|
}, []);
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
34
|
+
// Fetch markets
|
|
35
|
+
const fetchMarkets = useCallback(async () => {
|
|
36
|
+
if (!marketApiRef.current)
|
|
37
|
+
return;
|
|
38
|
+
try {
|
|
39
|
+
const response = await marketApiRef.current.getMarkets(100, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, 'open');
|
|
40
|
+
const marketData = (response.data.markets || []).map((m) => {
|
|
41
|
+
const ticker = m.ticker || '';
|
|
42
|
+
const currentYesBid = m.yes_bid;
|
|
43
|
+
const previousYesBid = previousPricesRef.current.get(ticker);
|
|
44
|
+
// Store current price for next comparison
|
|
45
|
+
if (currentYesBid !== undefined) {
|
|
46
|
+
previousPricesRef.current.set(ticker, currentYesBid);
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
ticker,
|
|
50
|
+
title: m.title || '',
|
|
51
|
+
status: (m.status || 'open'),
|
|
52
|
+
yes_bid: currentYesBid,
|
|
53
|
+
yes_ask: m.yes_ask,
|
|
54
|
+
no_bid: m.no_bid,
|
|
55
|
+
no_ask: m.no_ask,
|
|
56
|
+
volume: m.volume,
|
|
57
|
+
open_interest: m.open_interest,
|
|
58
|
+
close_time: m.close_time,
|
|
59
|
+
previousYesBid,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
setMarkets(marketData);
|
|
63
|
+
setIsConnected(true);
|
|
64
|
+
}
|
|
65
|
+
catch {
|
|
66
|
+
// Silently fail, will retry
|
|
67
|
+
}
|
|
68
|
+
}, []);
|
|
69
|
+
// Fetch orderbook for selected market
|
|
70
|
+
const fetchOrderbook = useCallback(async (ticker) => {
|
|
71
|
+
if (!marketApiRef.current || !ticker)
|
|
72
|
+
return;
|
|
73
|
+
try {
|
|
74
|
+
const response = await marketApiRef.current.getMarketOrderbook(ticker, 10);
|
|
75
|
+
const ob = response.data.orderbook;
|
|
76
|
+
if (ob) {
|
|
77
|
+
const parseLevel = (entry) => [
|
|
78
|
+
parseFloat(entry[0] || '0'),
|
|
79
|
+
parseInt(entry[1] || '0', 10),
|
|
80
|
+
];
|
|
81
|
+
setOrderbook({
|
|
82
|
+
yes: (ob.yes_dollars || []).map(parseLevel),
|
|
83
|
+
no: (ob.no_dollars || []).map(parseLevel),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
// Silently fail
|
|
89
|
+
}
|
|
90
|
+
}, []);
|
|
91
|
+
// Fetch portfolio data
|
|
92
|
+
const fetchPortfolio = useCallback(async () => {
|
|
93
|
+
if (!portfolioApiRef.current)
|
|
94
|
+
return;
|
|
95
|
+
try {
|
|
96
|
+
const [balanceRes, positionsRes] = await Promise.all([
|
|
97
|
+
portfolioApiRef.current.getBalance(),
|
|
98
|
+
portfolioApiRef.current.getPositions(undefined, 100, 'position'),
|
|
99
|
+
]);
|
|
100
|
+
setBalance(balanceRes.data.balance || 0);
|
|
101
|
+
setPositions((positionsRes.data.market_positions || []).map((p) => ({
|
|
102
|
+
ticker: p.ticker || '',
|
|
103
|
+
position: p.position || 0,
|
|
104
|
+
market_exposure: p.market_exposure || 0,
|
|
105
|
+
})));
|
|
106
|
+
setIsConnected(true);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// Silently fail
|
|
110
|
+
}
|
|
111
|
+
}, []);
|
|
112
|
+
// Select market and fetch orderbook
|
|
113
|
+
const selectMarket = useCallback((ticker) => {
|
|
114
|
+
setSelectedTicker(ticker);
|
|
115
|
+
fetchOrderbook(ticker);
|
|
116
|
+
}, [fetchOrderbook]);
|
|
117
|
+
// Initial data fetch
|
|
118
|
+
useEffect(() => {
|
|
119
|
+
if (!isConnected)
|
|
120
|
+
return;
|
|
121
|
+
// Fetch immediately
|
|
122
|
+
fetchMarkets();
|
|
123
|
+
fetchPortfolio();
|
|
124
|
+
// Set up polling
|
|
125
|
+
const marketsInterval = setInterval(fetchMarkets, 60000);
|
|
126
|
+
const portfolioInterval = setInterval(fetchPortfolio, 30000);
|
|
127
|
+
return () => {
|
|
128
|
+
clearInterval(marketsInterval);
|
|
129
|
+
clearInterval(portfolioInterval);
|
|
130
|
+
};
|
|
131
|
+
}, [isConnected, fetchMarkets, fetchPortfolio]);
|
|
132
|
+
// Poll orderbook for selected market
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
if (!selectedTicker)
|
|
135
|
+
return;
|
|
136
|
+
const orderbookInterval = setInterval(() => {
|
|
137
|
+
fetchOrderbook(selectedTicker);
|
|
138
|
+
}, 30000);
|
|
139
|
+
return () => clearInterval(orderbookInterval);
|
|
140
|
+
}, [selectedTicker, fetchOrderbook]);
|
|
22
141
|
return {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
142
|
+
markets,
|
|
143
|
+
orderbook,
|
|
144
|
+
balance,
|
|
145
|
+
positions,
|
|
146
|
+
isConnected,
|
|
147
|
+
error,
|
|
148
|
+
selectMarket,
|
|
29
149
|
};
|
|
30
150
|
}
|
|
31
151
|
//# sourceMappingURL=useKalshi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKalshi.js","sourceRoot":"","sources":["../../src/hooks/useKalshi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"useKalshi.js","sourceRoot":"","sources":["../../src/hooks/useKalshi.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EACL,eAAe,EACf,kBAAkB,EAClB,eAAe,GAGhB,MAAM,6BAA6B,CAAC;AAwBrC,MAAM,UAAU,SAAS;IACvB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAsB,EAAE,CAAC,CAAC;IAChE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAA0B,IAAI,CAAC,CAAC;IAC1E,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAC5D,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAa,EAAE,CAAC,CAAC;IAC3D,MAAM,CAAC,WAA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AAG,EAAE;YACzC,cAAc,CAAC,cAAc,CAAC,CAAC;QACjC,CAAC,EAAE,KAAK,CAAC,CAAC;QAEV,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;IAChD,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,CAAC;IAErC,OAAO;QACL,OAAO;QACP,SAAS;QACT,OAAO;QACP,SAAS;QACT,WAAW;QACX,KAAK;QACL,YAAY;KACb,CAAC;AACJ,CAAC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI Utility Functions
|
|
3
|
+
* Formatting and display helpers
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Format close time as relative time (e.g., "2d 14h", "3h 45m", "45m")
|
|
7
|
+
*/
|
|
8
|
+
export declare function formatExpiry(closeTime?: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* Get price change indicator and color
|
|
11
|
+
*/
|
|
12
|
+
export declare function getPriceChange(current?: number, previous?: number): {
|
|
13
|
+
text: string;
|
|
14
|
+
color: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Format volume with K/M suffix
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatVolume(volume?: number): string;
|
|
20
|
+
/**
|
|
21
|
+
* Format price in cents
|
|
22
|
+
*/
|
|
23
|
+
export declare function formatPrice(cents?: number): string;
|
|
24
|
+
/**
|
|
25
|
+
* Format price with decimals
|
|
26
|
+
*/
|
|
27
|
+
export declare function formatPriceDecimal(cents: number): string;
|
|
28
|
+
/**
|
|
29
|
+
* Calculate spread from best bid and ask
|
|
30
|
+
*/
|
|
31
|
+
export declare function calculateSpread(bestBid: number | null, bestAsk: number | null): number | null;
|
|
32
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,wBAAgB,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAsBvD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAUnG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAExD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAG7F"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI Utility Functions
|
|
3
|
+
* Formatting and display helpers
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Format close time as relative time (e.g., "2d 14h", "3h 45m", "45m")
|
|
7
|
+
*/
|
|
8
|
+
export function formatExpiry(closeTime) {
|
|
9
|
+
if (!closeTime)
|
|
10
|
+
return '';
|
|
11
|
+
const now = new Date();
|
|
12
|
+
const close = new Date(closeTime);
|
|
13
|
+
const diffMs = close.getTime() - now.getTime();
|
|
14
|
+
if (diffMs <= 0)
|
|
15
|
+
return 'CLOSED';
|
|
16
|
+
const diffMins = Math.floor(diffMs / (1000 * 60));
|
|
17
|
+
const diffHours = Math.floor(diffMs / (1000 * 60 * 60));
|
|
18
|
+
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
|
|
19
|
+
if (diffDays > 0) {
|
|
20
|
+
const remainingHours = diffHours % 24;
|
|
21
|
+
return `${diffDays}d ${remainingHours}h`;
|
|
22
|
+
}
|
|
23
|
+
if (diffHours > 0) {
|
|
24
|
+
const remainingMins = diffMins % 60;
|
|
25
|
+
return `${diffHours}h ${remainingMins}m`;
|
|
26
|
+
}
|
|
27
|
+
return `${diffMins}m`;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get price change indicator and color
|
|
31
|
+
*/
|
|
32
|
+
export function getPriceChange(current, previous) {
|
|
33
|
+
if (current === undefined || previous === undefined || current === previous) {
|
|
34
|
+
return { text: '━', color: 'gray' };
|
|
35
|
+
}
|
|
36
|
+
const diff = current - previous;
|
|
37
|
+
if (diff > 0) {
|
|
38
|
+
return { text: '▲', color: 'green' };
|
|
39
|
+
}
|
|
40
|
+
return { text: '▼', color: 'red' };
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Format volume with K/M suffix
|
|
44
|
+
*/
|
|
45
|
+
export function formatVolume(volume) {
|
|
46
|
+
if (!volume)
|
|
47
|
+
return '';
|
|
48
|
+
if (volume >= 1000000)
|
|
49
|
+
return `${(volume / 1000000).toFixed(1)}M`;
|
|
50
|
+
if (volume >= 1000)
|
|
51
|
+
return `${(volume / 1000).toFixed(1)}K`;
|
|
52
|
+
return `${volume}`;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Format price in cents
|
|
56
|
+
*/
|
|
57
|
+
export function formatPrice(cents) {
|
|
58
|
+
return cents !== undefined ? `${cents}¢` : '—';
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Format price with decimals
|
|
62
|
+
*/
|
|
63
|
+
export function formatPriceDecimal(cents) {
|
|
64
|
+
return `${cents.toFixed(2)}¢`;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Calculate spread from best bid and ask
|
|
68
|
+
*/
|
|
69
|
+
export function calculateSpread(bestBid, bestAsk) {
|
|
70
|
+
if (bestBid === null || bestAsk === null)
|
|
71
|
+
return null;
|
|
72
|
+
return bestAsk - bestBid;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,SAAkB;IAC7C,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,CAAC;IAE1B,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC;IAE/C,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,QAAQ,CAAC;IAEjC,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAE5D,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACjB,MAAM,cAAc,GAAG,SAAS,GAAG,EAAE,CAAC;QACtC,OAAO,GAAG,QAAQ,KAAK,cAAc,GAAG,CAAC;IAC3C,CAAC;IACD,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;QAClB,MAAM,aAAa,GAAG,QAAQ,GAAG,EAAE,CAAC;QACpC,OAAO,GAAG,SAAS,KAAK,aAAa,GAAG,CAAC;IAC3C,CAAC;IACD,OA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AU,eAAe,CAAC,OAAsB,EAAE,OAAsB;IAC5E,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACtD,OAAO,OAAO,GAAG,OAAO,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.test.d.ts","sourceRoot":"","sources":["../src/utils.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import { formatExpiry, getPriceChange, formatVolume, formatPrice, formatPriceDecimal, calculateSpread, } from './utils.js';
|
|
3
|
+
describe('formatExpiry', () => {
|
|
4
|
+
beforeEach(() => {
|
|
5
|
+
// Mock current time to 2025-01-01 12:00:00 UTC
|
|
6
|
+
vi.useFakeTimers();
|
|
7
|
+
vi.setSystemTime(new Date('2025-01-01T12:00:00Z'));
|
|
8
|
+
});
|
|
9
|
+
afterEach(() => {
|
|
10
|
+
vi.useRealTimers();
|
|
11
|
+
});
|
|
12
|
+
it('returns empty string for undefined', () => {
|
|
13
|
+
expect(formatExpiry(undefined)).toBe('');
|
|
14
|
+
});
|
|
15
|
+
it('returns CLOSED for past dates', () => {
|
|
16
|
+
expect(formatExpiry('2025-01-01T11:00:00Z')).toBe('CLOSED');
|
|
17
|
+
expect(formatExpiry('2024-12-31T00:00:00Z')).toBe('CLOSED');
|
|
18
|
+
});
|
|
19
|
+
it('formats days and hours for dates > 24h away', () => {
|
|
20
|
+
expect(formatExpiry('2025-01-03T12:00:00Z')).toBe('2d 0h');
|
|
21
|
+
expect(formatExpiry('2025-01-04T02:00:00Z')).toBe('2d 14h');
|
|
22
|
+
});
|
|
23
|
+
it('formats hours and minutes for dates < 24h away', () => {
|
|
24
|
+
expect(formatExpiry('2025-01-01T15:30:00Z')).toBe('3h 30m');
|
|
25
|
+
expect(formatExpiry('2025-01-01T14:00:00Z')).toBe('2h 0m');
|
|
26
|
+
});
|
|
27
|
+
it('formats minutes only for dates < 1h away', () => {
|
|
28
|
+
expect(formatExpiry('2025-01-01T12:45:00Z')).toBe('45m');
|
|
29
|
+
expect(formatExpiry('2025-01-01T12:05:00Z')).toBe('5m');
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
describe('getPriceChange', () => {
|
|
33
|
+
it('returns gray dash for undefined values', () => {
|
|
34
|
+
expect(getPriceChange(undefined, undefined)).toEqual({ text: '━', color: 'gray' });
|
|
35
|
+
expect(getPriceChange(50, undefined)).toEqual({ text: '━', color: 'gray' });
|
|
36
|
+
expect(getPriceChange(undefined, 50)).toEqual({ text: '━', color: 'gray' });
|
|
37
|
+
});
|
|
38
|
+
it('returns gray dash for equal values', () => {
|
|
39
|
+
expect(getPriceChange(50, 50)).toEqual({ text: '━', color: 'gray' });
|
|
40
|
+
expect(getPriceChange(0, 0)).toEqual({ text: '━', color: 'gray' });
|
|
41
|
+
});
|
|
42
|
+
it('returns green up arrow for price increase', () => {
|
|
43
|
+
expect(getPriceChange(55, 50)).toEqual({ text: '▲', color: 'green' });
|
|
44
|
+
expect(getPriceChange(100, 1)).toEqual({ text: '▲', color: 'green' });
|
|
45
|
+
});
|
|
46
|
+
it('returns red down arrow for price decrease', () => {
|
|
47
|
+
expect(getPriceChange(45, 50)).toEqual({ text: '▼', color: 'red' });
|
|
48
|
+
expect(getPriceChange(1, 100)).toEqual({ text: '▼', color: 'red' });
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
describe('formatVolume', () => {
|
|
52
|
+
it('returns empty string for undefined/zero', () => {
|
|
53
|
+
expect(formatVolume(undefined)).toBe('');
|
|
54
|
+
expect(formatVolume(0)).toBe('');
|
|
55
|
+
});
|
|
56
|
+
it('formats millions with M suffix', () => {
|
|
57
|
+
expect(formatVolume(1500000)).toBe('1.5M');
|
|
58
|
+
expect(formatVolume(10000000)).toBe('10.0M');
|
|
59
|
+
});
|
|
60
|
+
it('formats thousands with K suffix', () => {
|
|
61
|
+
expect(formatVolume(1500)).toBe('1.5K');
|
|
62
|
+
expect(formatVolume(50000)).toBe('50.0K');
|
|
63
|
+
});
|
|
64
|
+
it('leaves small numbers as-is', () => {
|
|
65
|
+
expect(formatVolume(500)).toBe('500');
|
|
66
|
+
expect(formatVolume(42)).toBe('42');
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
describe('formatPrice', () => {
|
|
70
|
+
it('formats cents with cent symbol', () => {
|
|
71
|
+
expect(formatPrice(45)).toBe('45¢');
|
|
72
|
+
expect(formatPrice(99)).toBe('99¢');
|
|
73
|
+
expect(formatPrice(0)).toBe('0¢');
|
|
74
|
+
});
|
|
75
|
+
it('returns dash for undefined', () => {
|
|
76
|
+
expect(formatPrice(undefined)).toBe('—');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
describe('formatPriceDecimal', () => {
|
|
80
|
+
it('formats price with two decimal places', () => {
|
|
81
|
+
expect(formatPriceDecimal(45)).toBe('45.00¢');
|
|
82
|
+
expect(formatPriceDecimal(99.5)).toBe('99.50¢');
|
|
83
|
+
expect(formatPriceDecimal(0.01)).toBe('0.01¢');
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
describe('calculateSpread', () => {
|
|
87
|
+
it('returns null if either value is null', () => {
|
|
88
|
+
expect(calculateSpread(null, null)).toBeNull();
|
|
89
|
+
expect(calculateSpread(50, null)).toBeNull();
|
|
90
|
+
expect(calculateSpread(null, 55)).toBeNull();
|
|
91
|
+
});
|
|
92
|
+
it('calculates spread correctly', () => {
|
|
93
|
+
expect(calculateSpread(50, 55)).toBe(5);
|
|
94
|
+
expect(calculateSpread(45, 47)).toBe(2);
|
|
95
|
+
expect(calculateSpread(99, 100)).toBe(1);
|
|
96
|
+
});
|
|
97
|
+
it('handles zero spread', () => {
|
|
98
|
+
expect(calculateSpread(50, 50)).toBe(0);
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
//# sourceMappingURL=utils.test.js.map
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