@newyorkcompute/kalshi-tui 0.1.0 → 0.3.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.
Files changed (113) hide show
  1. package/README.md +35 -0
  2. package/dist/App.d.ts +2 -1
  3. package/dist/App.d.ts.map +1 -1
  4. package/dist/App.js +43 -36
  5. package/dist/App.js.map +1 -1
  6. package/dist/cache.d.ts +34 -0
  7. package/dist/cache.d.ts.map +1 -0
  8. package/dist/cache.js +60 -0
  9. package/dist/cache.js.map +1 -0
  10. package/dist/cache.test.d.ts +2 -0
  11. package/dist/cache.test.d.ts.map +1 -0
  12. package/dist/cache.test.js +73 -0
  13. package/dist/cache.test.js.map +1 -0
  14. package/dist/cli.d.ts +2 -2
  15. package/dist/cli.js +31 -35
  16. package/dist/cli.js.map +1 -1
  17. package/dist/components/ErrorBoundary.d.ts +20 -0
  18. package/dist/components/ErrorBoundary.d.ts.map +1 -0
  19. package/dist/components/ErrorBoundary.js +28 -0
  20. package/dist/components/ErrorBoundary.js.map +1 -0
  21. package/dist/components/Footer.d.ts +6 -0
  22. package/dist/components/Footer.d.ts.map +1 -0
  23. package/dist/components/Footer.js +10 -0
  24. package/dist/components/Footer.js.map +1 -0
  25. package/dist/components/Header.d.ts +10 -2
  26. package/dist/components/Header.d.ts.map +1 -1
  27. package/dist/components/Header.js +18 -9
  28. package/dist/components/Header.js.map +1 -1
  29. package/dist/components/Markets.d.ts +21 -0
  30. package/dist/components/Markets.d.ts.map +1 -0
  31. package/dist/components/Markets.js +25 -0
  32. package/dist/components/Markets.js.map +1 -0
  33. package/dist/components/Orderbook.d.ts +18 -5
  34. package/dist/components/Orderbook.d.ts.map +1 -1
  35. package/dist/components/Orderbook.js +25 -36
  36. package/dist/components/Orderbook.js.map +1 -1
  37. package/dist/components/Positions.d.ts +13 -2
  38. package/dist/components/Positions.d.ts.map +1 -1
  39. package/dist/components/Positions.js +10 -17
  40. package/dist/components/Positions.js.map +1 -1
  41. package/dist/components/PriceChart.d.ts +18 -0
  42. package/dist/components/PriceChart.d.ts.map +1 -0
  43. package/dist/components/PriceChart.js +103 -0
  44. package/dist/components/PriceChart.js.map +1 -0
  45. package/dist/components/index.d.ts +10 -10
  46. package/dist/components/index.d.ts.map +1 -1
  47. package/dist/components/index.js +10 -11
  48. package/dist/components/index.js.map +1 -1
  49. package/dist/hooks/index.d.ts +4 -4
  50. package/dist/hooks/index.d.ts.map +1 -1
  51. package/dist/hooks/index.js +4 -4
  52. package/dist/hooks/index.js.map +1 -1
  53. package/dist/hooks/useKalshi.d.ts +30 -12
  54. package/dist/hooks/useKalshi.d.ts.map +1 -1
  55. package/dist/hooks/useKalshi.js +249 -19
  56. package/dist/hooks/useKalshi.js.map +1 -1
  57. package/dist/utils.d.ts +33 -0
  58. package/dist/utils.d.ts.map +1 -0
  59. package/dist/utils.js +88 -0
  60. package/dist/utils.js.map +1 -0
  61. package/dist/utils.test.d.ts +2 -0
  62. package/dist/utils.test.d.ts.map +1 -0
  63. package/dist/utils.test.js +115 -0
  64. package/dist/utils.test.js.map +1 -0
  65. package/package.json +8 -8
  66. package/dist/components/HelpModal.d.ts +0 -5
  67. package/dist/components/HelpModal.d.ts.map +0 -1
  68. package/dist/components/HelpModal.js +0 -19
  69. package/dist/components/HelpModal.js.map +0 -1
  70. package/dist/components/MarketList.d.ts +0 -5
  71. package/dist/components/MarketList.d.ts.map +0 -1
  72. package/dist/components/MarketList.js +0 -68
  73. package/dist/components/MarketList.js.map +0 -1
  74. package/dist/components/OrderEntry.d.ts +0 -9
  75. package/dist/components/OrderEntry.d.ts.map +0 -1
  76. package/dist/components/OrderEntry.js +0 -77
  77. package/dist/components/OrderEntry.js.map +0 -1
  78. package/dist/components/SearchBar.d.ts +0 -5
  79. package/dist/components/SearchBar.d.ts.map +0 -1
  80. package/dist/components/SearchBar.js +0 -27
  81. package/dist/components/SearchBar.js.map +0 -1
  82. package/dist/components/StatusBar.d.ts +0 -5
  83. package/dist/components/StatusBar.d.ts.map +0 -1
  84. package/dist/components/StatusBar.js +0 -9
  85. package/dist/components/StatusBar.js.map +0 -1
  86. package/dist/components/ui/Box.d.ts +0 -14
  87. package/dist/components/ui/Box.d.ts.map +0 -1
  88. package/dist/components/ui/Box.js +0 -9
  89. package/dist/components/ui/Box.js.map +0 -1
  90. package/dist/components/ui/Sparkline.d.ts +0 -11
  91. package/dist/components/ui/Sparkline.d.ts.map +0 -1
  92. package/dist/components/ui/Sparkline.js +0 -32
  93. package/dist/components/ui/Sparkline.js.map +0 -1
  94. package/dist/hooks/useMarkets.d.ts +0 -13
  95. package/dist/hooks/useMarkets.d.ts.map +0 -1
  96. package/dist/hooks/useMarkets.js +0 -89
  97. package/dist/hooks/useMarkets.js.map +0 -1
  98. package/dist/hooks/useOrderbook.d.ts +0 -13
  99. package/dist/hooks/useOrderbook.d.ts.map +0 -1
  100. package/dist/hooks/useOrderbook.js +0 -81
  101. package/dist/hooks/useOrderbook.js.map +0 -1
  102. package/dist/hooks/usePortfolio.d.ts +0 -18
  103. package/dist/hooks/usePortfolio.d.ts.map +0 -1
  104. package/dist/hooks/usePortfolio.js +0 -84
  105. package/dist/hooks/usePortfolio.js.map +0 -1
  106. package/dist/stores/app-store.d.ts +0 -17
  107. package/dist/stores/app-store.d.ts.map +0 -1
  108. package/dist/stores/app-store.js +0 -21
  109. package/dist/stores/app-store.js.map +0 -1
  110. package/dist/theme.d.ts +0 -31
  111. package/dist/theme.d.ts.map +0 -1
  112. package/dist/theme.js +0 -37
  113. package/dist/theme.js.map +0 -1
@@ -1,14 +1,23 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import { formatCurrency } from "@newyorkcompute/kalshi-core";
4
- import { usePortfolio } from "../hooks/usePortfolio.js";
5
- import { useAppStore } from "../stores/app-store.js";
6
2
  /**
7
- * Header component with branding and balance
3
+ * Header Component
4
+ * Displays branding, balance, and connection status
8
5
  */
9
- export function Header() {
10
- const { balance } = usePortfolio();
11
- const isConnected = useAppStore((state) => state.isConnected);
12
- return (_jsxs(Box, { borderStyle: "single", borderColor: "gray", paddingX: 1, justifyContent: "space-between", children: [_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { color: "green", bold: true, children: "\u2593" }), _jsx(Text, { bold: true, children: " KALSHI" })] }), _jsx(Text, { color: "gray", dimColor: true, children: "NEW YORK COMPUTE" })] }), _jsxs(Box, { flexDirection: "column", alignItems: "flex-end", children: [_jsxs(Box, { children: [_jsx(Text, { children: "Balance: " }), _jsx(Text, { color: "white", bold: true, children: balance ? formatCurrency(balance.balance) : "" })] }), _jsxs(Box, { children: [_jsx(Text, { color: isConnected ? "green" : "red", children: isConnected ? "◉" : "○" }), _jsxs(Text, { color: "gray", dimColor: true, children: [" ", isConnected ? "connected" : "disconnected"] })] })] })] }));
6
+ import { Box, Text } from 'ink';
7
+ export function Header({ balance, isConnected, isRateLimited, error }) {
8
+ const formatCurrency = (cents) => `$${(cents / 100).toFixed(2)}`;
9
+ const balanceText = balance !== null ? formatCurrency(balance) : '';
10
+ // Determine connection status display
11
+ const getStatusDisplay = () => {
12
+ if (isRateLimited) {
13
+ return { color: 'yellow', icon: '◐', text: 'rate limited' };
14
+ }
15
+ if (isConnected) {
16
+ return { color: 'green', icon: '●', text: 'connected' };
17
+ }
18
+ return { color: 'red', icon: '○', text: 'disconnected' };
19
+ };
20
+ const status = getStatusDisplay();
21
+ return (_jsxs(Box, { flexDirection: "row", justifyContent: "space-between", borderStyle: "single", borderColor: "gray", paddingX: 1, height: 3, width: "100%", children: [_jsxs(Box, { flexDirection: "column", flexGrow: 1, children: [_jsx(Text, { color: "green", bold: true, children: "\u2588 KALSHI" }), _jsx(Text, { color: "gray", children: "NEW YORK COMPUTE" })] }), _jsxs(Box, { flexDirection: "column", alignItems: "flex-end", children: [_jsxs(Text, { children: ["Balance: ", _jsx(Text, { bold: true, children: balanceText })] }), _jsxs(Box, { children: [_jsx(Text, { color: status.color, children: status.icon }), _jsxs(Text, { color: "gray", children: [" ", status.text] })] }), error && (_jsx(Text, { color: "yellow", dimColor: true, wrap: "truncate", children: error.slice(0, 40) }))] })] }));
13
22
  }
14
23
  //# sourceMappingURL=Header.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;GAEG;AACH,MAAM,UAAU,MAAM;IACpB,MAAM,EAAE,OAAO,EAAE,GAAG,YAAY,EAAE,CAAC;IACnC,MAAM,WAAW,GAAG,WAAW,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAE9D,OAAO,CACL,MAAC,GAAG,IACF,WAAW,EAAC,QAAQ,EACpB,WAAW,EAAC,MAAM,EAClB,QAAQ,EAAE,CAAC,EACX,cAAc,EAAC,eAAe,aAG9B,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,6BAEjB,EACP,KAAC,IAAI,IAAC,IAAI,8BAAe,IACrB,EACN,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,EAAC,QAAQ,uCAEpB,IACH,EAGN,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,UAAU,EAAC,UAAU,aAC/C,MAAC,GAAG,eACF,KAAC,IAAI,4BAAiB,EACtB,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,kBACrB,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CA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AAE,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;IACpE,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC;IAElC,OAAO,CACL,MAAC,GAAG,IACF,aAAa,EAAC,KAAK,EACnB,cAAc,EAAC,eAAe,EAC9B,WAAW,EAAC,QAAQ,EACpB,WAAW,EAAC,MAAM,EAClB,QAAQ,EAAE,CAAC,EACX,MAAM,EAAE,CAAC,EACT,KAAK,EAAC,MAAM,aAGZ,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,aACrC,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,EAAC,IAAI,oCAAgB,EACxC,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,iCAAwB,IACtC,EAGN,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,UAAU,EAAC,UAAU,aAC/C,MAAC,IAAI,4BACM,KAAC,IAAI,IAAC,IAAI,kBAAE,WAAW,GAAQ,IACnC,EACP,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,YACtB,MAAM,CAAC,IAAI,GACP,EACP,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,kBAAG,MAAM,CAAC,IAAI,IAAQ,IACpC,EACL,KAAK,IAAI,CACR,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,QAAQ,QAAC,IAAI,EAAC,UAAU,YAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAQ,CAC1E,IACG,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Markets Component
3
+ * Displays a scrollable list of markets with selection
4
+ */
5
+ interface Market {
6
+ ticker: string;
7
+ title: string;
8
+ yes_bid?: number;
9
+ yes_ask?: number;
10
+ volume?: number;
11
+ close_time?: string;
12
+ previousYesBid?: number;
13
+ }
14
+ interface MarketsProps {
15
+ markets: Market[];
16
+ selectedIndex: number;
17
+ height: number;
18
+ }
19
+ export declare function Markets({ markets, selectedIndex, height }: MarketsProps): import("react/jsx-runtime").JSX.Element;
20
+ export {};
21
+ //# sourceMappingURL=Markets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Markets.d.ts","sourceRoot":"","sources":["../../src/components/Markets.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,UAAU,MAAM;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,YAAY;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,OAAO,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,YAAY,2CAsFvE"}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Markets Component
4
+ * Displays a scrollable list of markets with selection
5
+ */
6
+ import { Box, Text } from 'ink';
7
+ import { formatExpiry, getPriceChange, formatPrice, formatVolume } from '../utils.js';
8
+ export function Markets({ markets, selectedIndex, height }) {
9
+ // Calculate visible window (scroll with selection)
10
+ const visibleRows = height - 4; // Border + title + padding
11
+ const halfWindow = Math.floor(visibleRows / 2);
12
+ let startIndex = Math.max(0, selectedIndex - halfWindow);
13
+ const maxStart = Math.max(0, markets.length - visibleRows);
14
+ startIndex = Math.min(startIndex, maxStart);
15
+ const visibleMarkets = markets.slice(startIndex, startIndex + visibleRows);
16
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "green", height: height, width: "100%", children: [_jsxs(Box, { paddingX: 1, justifyContent: "space-between", children: [_jsx(Text, { color: "green", bold: true, children: " MARKETS " }), _jsx(Text, { color: "gray", dimColor: true, children: "sorted by volume" })] }), _jsx(Box, { flexDirection: "column", paddingX: 1, flexGrow: 1, children: markets.length === 0 ? (_jsx(Text, { color: "gray", children: "Loading markets..." })) : (visibleMarkets.map((market, i) => {
17
+ const actualIndex = startIndex + i;
18
+ const isSelected = actualIndex === selectedIndex;
19
+ const priceChange = getPriceChange(market.yes_bid, market.previousYesBid);
20
+ const expiry = formatExpiry(market.close_time);
21
+ const volume = formatVolume(market.volume);
22
+ return (_jsxs(Box, { justifyContent: "space-between", children: [_jsxs(Box, { children: [_jsx(Text, { color: isSelected ? 'green' : 'gray', children: isSelected ? '▶ ' : ' ' }), _jsx(Text, { color: isSelected ? 'green' : 'white', bold: isSelected, children: market.ticker.slice(0, 20) })] }), _jsxs(Box, { children: [volume && (_jsx(Text, { color: "cyan", dimColor: true, children: volume.padStart(6) })), expiry && (_jsx(Text, { color: "gray", dimColor: true, children: expiry.padStart(8) })), _jsx(Text, { color: isSelected ? 'green' : 'white', children: formatPrice(market.yes_bid).padStart(5) }), _jsxs(Text, { color: priceChange.color, children: [" ", priceChange.text] })] })] }, market.ticker));
23
+ })) }), markets.length > 0 && (_jsx(Box, { justifyContent: "center", paddingX: 1, children: _jsxs(Text, { color: "gray", children: [selectedIndex + 1, " of ", markets.length] }) }))] }));
24
+ }
25
+ //# sourceMappingURL=Markets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Markets.js","sourceRoot":"","sources":["../../src/components/Markets.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAmBtF,MAAM,UAAU,OAAO,CAAC,EAAE,O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,IACtD,KA/BE,MAAM,CAAC,MAAM,CAgCjB,CACP,CAAC;gBACJ,CAAC,CAAC,CACH,GACG,EAGL,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CACrB,KAAC,GAAG,IAAC,cAAc,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,YACtC,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,aACf,aAAa,GAAG,CAAC,UAAM,OAAO,CAAC,MAAM,IACjC,GACH,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -1,9 +1,22 @@
1
- interface OrderbookProps {
2
- ticker: string | null;
3
- }
4
1
  /**
5
- * Orderbook visualization with depth bars
2
+ * Orderbook Component
3
+ * Visual depth chart showing bids and asks with spread indicator
6
4
  */
7
- export declare function Orderbook({ ticker }: OrderbookProps): import("react/jsx-runtime").JSX.Element;
5
+ interface OrderbookData {
6
+ yes: [number, number][];
7
+ no: [number, number][];
8
+ }
9
+ interface SelectedMarket {
10
+ ticker: string;
11
+ title: string;
12
+ close_time?: string;
13
+ volume?: number;
14
+ }
15
+ interface OrderbookProps {
16
+ market: SelectedMarket | null;
17
+ orderbook: OrderbookData | null;
18
+ height: number;
19
+ }
20
+ export declare function Orderbook({ market, orderbook, height }: OrderbookProps): import("react/jsx-runtime").JSX.Element;
8
21
  export {};
9
22
  //# sourceMappingURL=Orderbook.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Orderbook.d.ts","sourceRoot":"","sources":["../../src/components/Orderbook.tsx"],"names":[],"mappings":"AAMA,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,cAAc,2CA0HnD"}
1
+ {"version":3,"file":"Orderbook.d.ts","sourceRoot":"","sources":["../../src/components/Orderbook.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,UAAU,aAAa;IACrB,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACxB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CACxB;AAED,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,UAAU,cAAc;IACtB,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B,SAAS,EAAE,aAAa,GAAG,IAAI,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,cAAc,2CAiHtE"}
@@ -1,43 +1,32 @@
1
- import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { Box, Text } from "ink";
3
- import { formatPrice } from "@newyorkcompute/kalshi-core";
4
- import { useOrderbook } from "../hooks/useOrderbook.js";
5
- import { useAppStore } from "../stores/app-store.js";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
6
2
  /**
7
- * Orderbook visualization with depth bars
3
+ * Orderbook Component
4
+ * Visual depth chart showing bids and asks with spread indicator
8
5
  */
9
- export function Orderbook({ ticker }) {
10
- const { orderbook, isLoading, error } = useOrderbook(ticker);
11
- const activePanel = useAppStore((state) => state.activePanel);
12
- const isActive = activePanel === "orderbook";
13
- // Calculate max quantity for bar scaling
14
- const yesQtys = orderbook?.yes?.map((level) => level[1]) || [];
15
- const noQtys = orderbook?.no?.map((level) => level[1]) || [];
16
- const allQuantities = [...yesQtys, ...noQtys];
17
- const maxQty = Math.max(...allQuantities, 1);
18
- // Render a depth bar
19
- const renderBar = (quantity, side, maxWidth = 20) => {
20
- const barWidth = Math.round((quantity / maxQty) * maxWidth);
21
- const bar = "█".repeat(barWidth);
22
- const padding = " ".repeat(maxWidth - barWidth);
23
- if (side === "ask") {
24
- return (_jsxs(Text, { color: "red", children: [padding, bar] }));
25
- }
26
- else {
27
- return _jsx(Text, { color: "green", children: bar });
28
- }
29
- };
30
- // Get asks (sorted high to low) and bids (sorted high to low)
31
- const asks = (orderbook?.no || [])
6
+ import { Box, Text } from 'ink';
7
+ import { formatExpiry, formatVolume, formatPriceDecimal, calculateSpread } from '../utils.js';
8
+ export function Orderbook({ market, orderbook, height }) {
9
+ // Parse orderbook into asks (no side, converted to YES equivalent) and bids (yes side)
10
+ const asks = (orderbook?.no ?? [])
32
11
  .slice(0, 5)
33
- .sort((a, b) => b[0] - a[0]);
34
- const bids = (orderbook?.yes || [])
12
+ .map(([price, qty]) => ({ price: 100 - price, quantity: qty }))
13
+ .sort((a, b) => b.price - a.price);
14
+ const bids = (orderbook?.yes ?? [])
35
15
  .slice(0, 5)
36
- .sort((a, b) => b[0] - a[0]);
16
+ .map(([price, qty]) => ({ price, quantity: qty }))
17
+ .sort((a, b) => b.price - a.price);
37
18
  // Calculate spread
38
- const bestAsk = asks.length > 0 ? asks[asks.length - 1][0] : null;
39
- const bestBid = bids.length > 0 ? bids[0][0] : null;
40
- const spread = bestAsk && bestBid ? bestAsk - bestBid : null;
41
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: isActive ? "green" : "gray", flexGrow: 1, children: [_jsxs(Box, { paddingX: 1, justifyContent: "space-between", children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, color: isActive ? "green" : "white", children: "ORDERBOOK" }), ticker && (_jsxs(Text, { color: "gray", dimColor: true, children: [": ", ticker] }))] }), _jsx(Text, { color: "gray", dimColor: true, children: "[F2]" })] }), _jsx(Box, { paddingX: 1, children: _jsx(Text, { color: "gray", children: "─".repeat(40) }) }), _jsxs(Box, { flexDirection: "column", paddingX: 1, flexGrow: 1, children: [!ticker && (_jsx(Text, { color: "gray", children: "Select a market to view orderbook" })), ticker && isLoading && (_jsx(Text, { color: "gray", children: "Loading orderbook..." })), ticker && error && _jsx(Text, { color: "red", children: error }), ticker && orderbook && !isLoading && (_jsxs(_Fragment, { children: [asks.map(([price, qty], index) => (_jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { color: "gray", children: "ASK" }), renderBar(qty, "ask"), _jsx(Text, { color: "red", children: formatPrice(100 - price) }), _jsxs(Text, { color: "gray", dimColor: true, children: ["(", qty, ")"] })] }, `ask-${index}`))), _jsx(Box, { justifyContent: "center", marginY: 1, children: _jsxs(Text, { color: "gray", children: ["─── SPREAD: ", spread !== null ? `${spread}¢` : "—", " ───"] }) }), bids.map(([price, qty], index) => (_jsxs(Box, { justifyContent: "space-between", children: [_jsx(Text, { color: "gray", children: "BID" }), renderBar(qty, "bid"), _jsx(Text, { color: "green", children: formatPrice(price) }), _jsxs(Text, { color: "gray", dimColor: true, children: ["(", qty, ")"] })] }, `bid-${index}`)))] }))] })] }));
19
+ const bestAsk = asks.length > 0 ? Math.min(...asks.map(a => a.price)) : null;
20
+ const bestBid = bids.length > 0 ? Math.max(...bids.map(b => b.price)) : null;
21
+ const spread = calculateSpread(bestBid, bestAsk);
22
+ // Calculate max quantity for bar scaling
23
+ const maxQty = Math.max(...asks.map(l => l.quantity), ...bids.map(l => l.quantity), 1);
24
+ const renderBar = (qty, color, maxWidth = 20) => {
25
+ const barLength = Math.min(Math.floor((qty / maxQty) * maxWidth), maxWidth);
26
+ return _jsx(Text, { color: color, children: '█'.repeat(barLength) });
27
+ };
28
+ const expiry = formatExpiry(market?.close_time);
29
+ const volume = formatVolume(market?.volume);
30
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "gray", height: height, width: "100%", children: [_jsxs(Box, { paddingX: 1, flexDirection: "column", children: [_jsxs(Box, { children: [_jsx(Text, { bold: true, children: " ORDERBOOK" }), _jsxs(Text, { color: "gray", children: [": ", market?.ticker || 'Select a market'] })] }), market?.title && (_jsxs(Text, { color: "cyan", wrap: "truncate", children: [market.title.slice(0, 50), market.title.length > 50 ? '…' : ''] })), market && (_jsxs(Box, { children: [expiry && (_jsxs(Text, { color: "yellow", children: ["\u23F1 ", expiry] })), volume && (_jsxs(Text, { color: "gray", children: [" Vol: ", volume] }))] }))] }), _jsx(Box, { flexDirection: "column", paddingX: 1, flexGrow: 1, children: !orderbook ? (_jsx(Text, { color: "gray", children: "Select a market to view orderbook" })) : (_jsxs(_Fragment, { children: [asks.map((level, i) => (_jsxs(Box, { justifyContent: "space-between", children: [_jsxs(Box, { children: [_jsx(Text, { color: "gray", children: "ASK " }), renderBar(level.quantity, 'red')] }), _jsxs(Box, { children: [_jsx(Text, { color: "red", children: formatPriceDecimal(level.price) }), _jsxs(Text, { color: "gray", children: [" (", level.quantity, ")"] })] })] }, `ask-${i}`))), _jsxs(Box, { marginY: 1, justifyContent: "space-between", children: [_jsx(Text, { color: "gray", children: '─'.repeat(30) }), spread !== null && (_jsxs(Text, { color: "yellow", bold: true, children: ["SPREAD: ", spread.toFixed(2), "\u00A2"] }))] }), bids.map((level, i) => (_jsxs(Box, { justifyContent: "space-between", children: [_jsxs(Box, { children: [_jsx(Text, { color: "gray", children: "BID " }), renderBar(level.quantity, 'green')] }), _jsxs(Box, { children: [_jsx(Text, { color: "green", children: formatPriceDecimal(level.price) }), _jsxs(Text, { color: "gray", children: [" (", level.quantity, ")"] })] })] }, `bid-${i}`)))] })) })] }));
42
31
  }
43
32
  //# sourceMappingURL=Orderbook.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Orderbook.js","sourceRoot":"","sources":["../../src/components/Orderbook.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,MAAM,EAAk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I,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CACtB,MAAC,GAAG,IAAkB,cAAc,EAAC,eAAe,aAClD,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,qBAAY,EAC7B,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,IAC/B,EACN,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAAE,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,GAAQ,EAC5D,MAAC,IAAI,IAAC,KAAK,EAAC,MAAM,mBAAI,KAAK,CAAC,QAAQ,SAAS,IACzC,KARE,OAAO,CAAC,EAAE,CASd,CACP,CAAC,IACD,CACJ,GACG,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,5 +1,16 @@
1
1
  /**
2
- * Positions panel showing current holdings
2
+ * Positions Component
3
+ * Displays open positions with P&L
3
4
  */
4
- export declare function Positions(): import("react/jsx-runtime").JSX.Element;
5
+ interface Position {
6
+ ticker: string;
7
+ position: number;
8
+ market_exposure: number;
9
+ }
10
+ interface PositionsProps {
11
+ positions: Position[];
12
+ height: number;
13
+ }
14
+ export declare function Positions({ positions, height }: PositionsProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
5
16
  //# sourceMappingURL=Positions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Positions.d.ts","sourceRoot":"","sources":["../../src/components/Positions.tsx"],"names":[],"mappings":"AAMA;;GAEG;AACH,wBAAgB,SAAS,4CA6ExB"}
1
+ {"version":3,"file":"Positions.d.ts","sourceRoot":"","sources":["../../src/components/Positions.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,UAAU,QAAQ;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,cAAc;IACtB,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,SAAS,CAAC,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,cAAc,2CAyC9D"}
@@ -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 panel showing current holdings
3
+ * Positions Component
4
+ * Displays open positions with P&L
8
5
  */
9
- export function Positions() {
10
- const { positions, isLoading, error } = usePortfolio();
11
- const activePanel = useAppStore((state) => state.activePanel);
12
- const isActive = activePanel === "positions";
13
- // Calculate total exposure
14
- const totalExposure = positions.reduce((sum, pos) => sum + pos.market_exposure, 0);
15
- return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: isActive ? "green" : "gray", height: 10, children: [_jsxs(Box, { paddingX: 1, justifyContent: "space-between", children: [_jsx(Text, { bold: true, color: isActive ? "green" : "white", children: "POSITIONS" }), _jsx(Text, { color: "gray", dimColor: true, children: "[F3]" })] }), _jsx(Box, { paddingX: 1, children: _jsx(Text, { color: "gray", children: "─".repeat(40) }) }), _jsxs(Box, { flexDirection: "column", paddingX: 1, flexGrow: 1, children: [isLoading && _jsx(Text, { color: "gray", children: "Loading positions..." }), error && _jsx(Text, { color: "red", children: error }), !isLoading && !error && positions.length === 0 && (_jsx(Text, { color: "gray", children: "No open positions" })), positions.slice(0, 4).map((position) => {
16
- const side = position.position > 0 ? "YES" : "NO";
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":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EA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,cAAE,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAQ,EACtC,MAAC,GAAG,eACF,MAAC,IAAI,IAAC,KAAK,EAAE,SAAS,aACnB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAG,IAAI,IACzB,EACP,MAAC,IAAI,oBAAG,cAAc,CAAC,GAAG,CAAC,eAAe,CAAC,IAAQ,IAC/C,KAPE,GAAG,CAAC,MAAM,CAQd,CACP,CAAC;gBACJ,CAAC,CAAC,CACH,GACG,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Price Chart Component
3
+ * ASCII chart showing historical YES prices
4
+ */
5
+ interface TradePoint {
6
+ timestamp: number;
7
+ price: number;
8
+ volume: number;
9
+ }
10
+ interface PriceChartProps {
11
+ ticker: string | null;
12
+ priceHistory: TradePoint[];
13
+ height: number;
14
+ width: number;
15
+ }
16
+ export declare function PriceChart({ ticker, priceHistory, height, width }: PriceChartProps): import("react/jsx-runtime").JSX.Element;
17
+ export {};
18
+ //# sourceMappingURL=PriceChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriceChart.d.ts","sourceRoot":"","sources":["../../src/components/PriceChart.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,UAAU,UAAU;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,eAAe;IACvB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,YAAY,EAAE,UAAU,EAAE,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAqED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,eAAe,2CAmGlF"}
@@ -0,0 +1,103 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Price Chart Component
4
+ * ASCII chart showing historical YES prices
5
+ */
6
+ import { Box, Text } from 'ink';
7
+ import asciichart from 'asciichart';
8
+ /**
9
+ * Spread trade points evenly across the chart width
10
+ * This fills the entire width regardless of time gaps
11
+ */
12
+ function spreadPrices(trades, targetPoints) {
13
+ if (trades.length === 0)
14
+ return [];
15
+ if (trades.length === 1) {
16
+ // Single point - fill the width with the same value
17
+ return Array(targetPoints).fill(trades[0].price);
18
+ }
19
+ // If we have fewer trades than target points, interpolate
20
+ if (trades.length <= targetPoints) {
21
+ const result = [];
22
+ const step = (trades.length - 1) / (targetPoints - 1);
23
+ for (let i = 0; i < targetPoints; i++) {
24
+ const tradeIndex = i * step;
25
+ const lowerIndex = Math.floor(tradeIndex);
26
+ const upperIndex = Math.min(Math.ceil(tradeIndex), trades.length - 1);
27
+ if (lowerIndex === upperIndex) {
28
+ result.push(trades[lowerIndex].price);
29
+ }
30
+ else {
31
+ // Linear interpolation between points
32
+ const fraction = tradeIndex - lowerIndex;
33
+ const interpolated = trades[lowerIndex].price +
34
+ (trades[upperIndex].price - trades[lowerIndex].price) * fraction;
35
+ result.push(interpolated);
36
+ }
37
+ }
38
+ return result;
39
+ }
40
+ // If we have more trades than target points, sample/aggregate
41
+ const result = [];
42
+ const step = trades.length / targetPoints;
43
+ for (let i = 0; i < targetPoints; i++) {
44
+ const startIdx = Math.floor(i * step);
45
+ const endIdx = Math.floor((i + 1) * step);
46
+ // Average the prices in this bucket
47
+ let sum = 0;
48
+ let count = 0;
49
+ for (let j = startIdx; j < endIdx && j < trades.length; j++) {
50
+ sum += trades[j].price;
51
+ count++;
52
+ }
53
+ result.push(count > 0 ? sum / count : trades[startIdx].price);
54
+ }
55
+ return result;
56
+ }
57
+ /**
58
+ * Format timestamp to readable time
59
+ */
60
+ function formatTime(timestamp) {
61
+ const date = new Date(timestamp);
62
+ return date.toLocaleTimeString('en-US', {
63
+ hour: '2-digit',
64
+ minute: '2-digit',
65
+ hour12: false
66
+ });
67
+ }
68
+ export function PriceChart({ ticker, priceHistory, height, width }) {
69
+ // Calculate chart dimensions
70
+ const chartHeight = Math.max(height - 8, 5); // Leave room for labels
71
+ const chartWidth = Math.max(width - 15, 20); // Leave room for Y-axis labels
72
+ // Spread prices across the full chart width
73
+ const prices = spreadPrices(priceHistory, chartWidth);
74
+ // Calculate stats
75
+ const currentPrice = prices.length > 0 ? prices[prices.length - 1] : null;
76
+ const startPrice = prices.length > 0 ? prices[0] : null;
77
+ const priceChange = currentPrice && startPrice
78
+ ? ((currentPrice - startPrice) / startPrice * 100).toFixed(2)
79
+ : null;
80
+ const minPrice = prices.length > 0 ? Math.min(...prices) : null;
81
+ const maxPrice = prices.length > 0 ? Math.max(...prices) : null;
82
+ // Generate chart
83
+ let chartOutput = '';
84
+ if (prices.length >= 2) {
85
+ try {
86
+ chartOutput = asciichart.plot(prices, {
87
+ height: chartHeight,
88
+ format: (x) => x.toFixed(0).padStart(3) + '¢',
89
+ colors: [asciichart.green],
90
+ });
91
+ }
92
+ catch {
93
+ chartOutput = 'Unable to render chart';
94
+ }
95
+ }
96
+ // Time labels
97
+ const startTime = priceHistory.length > 0 ? formatTime(priceHistory[0].timestamp) : '';
98
+ const endTime = priceHistory.length > 0 ? formatTime(priceHistory[priceHistory.length - 1].timestamp) : '';
99
+ return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", height: height, width: "100%", children: [_jsxs(Box, { paddingX: 1, justifyContent: "space-between", children: [_jsxs(Box, { children: [_jsx(Text, { color: "cyan", bold: true, children: " PRICE CHART" }), _jsxs(Text, { color: "gray", children: [": ", ticker || 'Select a market'] })] }), currentPrice !== null && priceChange !== null && (_jsxs(Box, { children: [_jsxs(Text, { color: "white", bold: true, children: [currentPrice.toFixed(0), "\u00A2"] }), _jsxs(Text, { color: parseFloat(priceChange) >= 0 ? 'green' : 'red', children: [' ', "(", parseFloat(priceChange) >= 0 ? '+' : '', priceChange, "%)"] })] }))] }), prices.length > 0 && (_jsx(Box, { paddingX: 1, children: _jsxs(Text, { color: "gray", children: ["Low: ", _jsxs(Text, { color: "red", children: [minPrice?.toFixed(0), "\u00A2"] }), ' ', " High: ", _jsxs(Text, { color: "green", children: [maxPrice?.toFixed(0), "\u00A2"] }), ' ', " Trades: ", _jsx(Text, { color: "yellow", children: priceHistory.length })] }) })), _jsx(Box, { flexDirection: "column", paddingX: 1, flexGrow: 1, children: prices.length < 2 ? (_jsxs(Box, { flexDirection: "column", justifyContent: "center", alignItems: "center", flexGrow: 1, children: [_jsx(Text, { color: "gray", children: priceHistory.length === 0
100
+ ? 'No trade history available'
101
+ : 'Not enough data points for chart' }), _jsx(Text, { color: "gray", dimColor: true, children: "Select a market with recent trades" })] })) : (_jsx(Text, { children: chartOutput })) }), prices.length >= 2 && (_jsxs(Box, { paddingX: 1, justifyContent: "space-between", children: [_jsx(Text, { color: "gray", children: startTime }), _jsx(Text, { color: "gray", children: "\u2500 24h \u2500" }), _jsx(Text, { color: "gray", children: endTime })] }))] }));
102
+ }
103
+ //# sourceMappingURL=PriceChart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriceChart.js","sourceRoot":"","sources":["../../src/components/PriceChart.tsx"],"names":[],"mappings":";AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,UAAU,MAAM,YAAY,CAAC;AAepC;;;GAGG;AACH,SAAS,YAAY,CAAC,MAAoB,EAAE,YAAoB;IAC9D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,oDAAoD;QACpD,OAAO,KAAK,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;IAED,0DAA0D;IAC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AAK,EAAC,MAAM,kCAAe,EACjC,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,OAAO,GAAQ,IAC/B,CACP,IAEG,CACP,CAAC;AACJ,CAAC"}
@@ -1,11 +1,11 @@
1
- export { Header } from "./Header.js";
2
- export { MarketList } from "./MarketList.js";
3
- export { Orderbook } from "./Orderbook.js";
4
- export { Positions } from "./Positions.js";
5
- export { OrderEntry } from "./OrderEntry.js";
6
- export { StatusBar } from "./StatusBar.js";
7
- export { HelpModal } from "./HelpModal.js";
8
- export { SearchBar } from "./SearchBar.js";
9
- export { Panel } from "./ui/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';
9
+ export { PriceChart } from './PriceChart.js';
10
+ export { ErrorBoundary } from './ErrorBoundary.js';
11
11
  //# 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,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
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;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,12 +1,11 @@
1
- export { Header } from "./Header.js";
2
- export { MarketList } from "./MarketList.js";
3
- export { Orderbook } from "./Orderbook.js";
4
- export { Positions } from "./Positions.js";
5
- export { OrderEntry } from "./OrderEntry.js";
6
- export { StatusBar } from "./StatusBar.js";
7
- export { HelpModal } from "./HelpModal.js";
8
- export { SearchBar } from "./SearchBar.js";
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';
9
+ export { PriceChart } from './PriceChart.js';
10
+ export { ErrorBoundary } from './ErrorBoundary.js';
12
11
  //# 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,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,gBAAgB;AAChB,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
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;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1,5 +1,5 @@
1
- export { useKalshi } from "./useKalshi.js";
2
- export { useMarkets } from "./useMarkets.js";
3
- export { useOrderbook } from "./useOrderbook.js";
4
- export { usePortfolio } from "./usePortfolio.js";
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;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,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"}
@@ -1,5 +1,5 @@
1
- export { useKalshi } from "./useKalshi.js";
2
- export { useMarkets } from "./useMarkets.js";
3
- export { useOrderbook } from "./useOrderbook.js";
4
- export { usePortfolio } from "./usePortfolio.js";
1
+ /**
2
+ * Hook exports
3
+ */
4
+ export { useKalshi } from './useKalshi.js';
5
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,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"}