-
-
+
)
}
\ No newline at end of file
diff --git a/src/styles/globals.css b/src/styles/globals.css
index bd6213e..22660d7 100644
--- a/src/styles/globals.css
+++ b/src/styles/globals.css
@@ -1,3 +1,42 @@
@tailwind base;
@tailwind components;
-@tailwind utilities;
\ No newline at end of file
+@tailwind utilities;
+
+:root {
+ --color-base: #ebe6df; /* Latte base color */
+ --color-mantle: #e2ddd6;
+ --color-crust: #f5f4ed;
+ --color-surface0: #f2e7dc;
+ --color-surface1: #ece5df;
+ --color-surface2: #f4ede8;
+ --color-overlay0: #dad5d0;
+ --color-overlay1: #e3ded8;
+ --color-overlay2: #edebe7;
+ --color-text: #4c4f52;
+ --color-subtext1: #55595e;
+ --color-subtext0: #5f6368;
+ --background: var(--color-base);
+ --foreground: var(--color-text);
+ }
+
+ .dark {
+ --color-base: #1e1e2e; /* Mocha base color */
+ --color-mantle: #181825;
+ --color-crust: #13111e;
+ --color-surface0: #313244;
+ --color-surface1: #3a3c51;
+ --color-surface2: #4e4f68;
+ --color-overlay0: #6c6f85;
+ --color-overlay1: #898ba5;
+ --color-overlay2: #aabbcc;
+ --color-text: #cdd6f4;
+ --color-subtext1: #bac2de;
+ --color-subtext0: #a6adc8;
+ --background: var(--color-base);
+ --foreground: var(--color-text);
+ }
+
+ body {
+ background-color: var(--background);
+ color: var(--foreground);
+ }
\ No newline at end of file
diff --git a/src/utils/sparkle.ts b/src/utils/sparkle.ts
index 1126fc6..fc446a5 100644
--- a/src/utils/sparkle.ts
+++ b/src/utils/sparkle.ts
@@ -1,7 +1,7 @@
const SPARKLE_BASE_URL = process.env.NEXT_PUBLIC_SPARKLE_BASE_URL;
export const fetchQuote = async (symbol: string) => {
- const url = `${SPARKLE_BASE_URL}/quote?symbol=${symbol}`
+ const url = `${SPARKLE_BASE_URL}/api/v1/quote?symbol=${symbol}`
const res = await fetch(url)
if (!res.ok) {
throw new Error('Error fetching quote')
@@ -10,10 +10,19 @@ export const fetchQuote = async (symbol: string) => {
}
export const fetchSymbols = async (symbol: string) => {
- const url = `${SPARKLE_BASE_URL}/search?query=${symbol}`
+ const url = `${SPARKLE_BASE_URL}/api/v1/search?query=${symbol}`
const res = await fetch(url)
if (!res.ok) {
throw new Error('Error fetching quote')
}
return res.json()
+ }
+
+ export const startWebSocket = async () => {
+ const url = `${SPARKLE_BASE_URL}/ws/start-websocket`
+ const res = await fetch(url)
+ if (!res.ok) {
+ throw new Error('Error starting WebSocket')
+ }
+ return res.json()
}
\ No newline at end of file
diff --git a/src/utils/tradeConditions.ts b/src/utils/tradeConditions.ts
new file mode 100644
index 0000000..427cf90
--- /dev/null
+++ b/src/utils/tradeConditions.ts
@@ -0,0 +1,43 @@
+export const tradeConditions: Record
= {
+ 1: "Regular",
+ 2: "Acquisition",
+ 3: "Average Price Trade",
+ 4: "Bunched",
+ 5: "Cash Sale",
+ 6: "Distribution",
+ 7: "Automatic Execution",
+ 8: "Intermarket Sweep Order",
+ 9: "Bunched Sold",
+ 10: "Price Variation Trade",
+ 11: "Cap Election",
+ 12: "Odd Lot Trade",
+ 13: "Rule 127",
+ 14: "Rule 155",
+ 15: "Sold last",
+ 16: "Market Center Official Close",
+ 17: "Next day",
+ 18: "Market Center Opening Trade",
+ 19: "Opening Prints",
+ 20: "Market Center Official Open",
+ 21: "Prior Reference Price",
+ 22: "Seller",
+ 23: "Split Trade",
+ 24: "Form-T Trade",
+ 25: "Extended Hours (Sold Out of Sequence)",
+ 26: "Contingent Trade",
+ 27: "Stock Option Trade",
+ 28: "Cross Trade",
+ 29: "Yellow Flag",
+ 30: "Sold (Out of Sequence)",
+ 31: "Stopped Stock",
+ 32: "Derivatively Priced",
+ 33: "Market Center Re-opening Trade",
+ 34: "Re-opening Prints",
+ 35: "Market Center Closing Trade",
+ 36: "Closing Prints",
+ 37: "Qualified Contingent Trade",
+ 38: "Placeholder for 611 Exempt",
+ 39: "Corrected Consolidated Close",
+ 40: "Opened",
+ 41: "Trade Through Exempt (TTE)",
+ };
\ No newline at end of file
diff --git a/tailwind.config.ts b/tailwind.config.ts
index 021c393..ab50aa0 100644
--- a/tailwind.config.ts
+++ b/tailwind.config.ts
@@ -1,19 +1,64 @@
-import type { Config } from "tailwindcss";
+import type { Config } from 'tailwindcss'
+
+const latte = {
+ base: '#ebe6df',
+ mantle: '#e2ddd6',
+ crust: '#f5f4ed',
+ surface0: '#f2e7dc',
+ surface1: '#ece5df',
+ surface2: '#f4ede8',
+ overlay0: '#dad5d0',
+ overlay1: '#e3ded8',
+ overlay2: '#edebe7',
+ text: '#4c4f52',
+ subtext1: '#55595e',
+ subtext0: '#5f6368'
+}
+
+const mocha = {
+ base: '#1e1e2e',
+ mantle: '#181825',
+ crust: '#13111e',
+ surface0: '#313244',
+ surface1: '#3a3c51',
+ surface2: '#4e4f68',
+ overlay0: '#6c6f85',
+ overlay1: '#898ba5',
+ overlay2: '#aabbcc',
+ text: '#cdd6f4',
+ subtext1: '#bac2de',
+ subtext0: '#a6adc8'
+}
const config: Config = {
content: [
- "./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
- "./src/components/**/*.{js,ts,jsx,tsx,mdx}",
- "./src/app/**/*.{js,ts,jsx,tsx,mdx}",
+ './src/pages/**/*.{js,ts,jsx,tsx,mdx}',
+ './src/components/**/*.{js,ts,jsx,tsx,mdx}',
+ './src/app/**/*.{js,ts,jsx,tsx,mdx}'
],
+ darkMode: 'class',
theme: {
extend: {
colors: {
- background: "var(--background)",
- foreground: "var(--foreground)",
- },
- },
+ background: 'var(--background)',
+ foreground: 'var(--foreground)',
+ base: 'var(--color-base)',
+ mantle: 'var(--color-mantle)',
+ crust: 'var(--color-crust)',
+ surface0: 'var(--color-surface0)',
+ surface1: 'var(--color-surface1)',
+ surface2: 'var(--color-surface2)',
+ overlay0: 'var(--color-overlay0)',
+ overlay1: 'var(--color-overlay1)',
+ overlay2: 'var(--color-overlay2)',
+ text: 'var(--color-text)',
+ subtext1: 'var(--color-subtext1)',
+ latte,
+ mocha
+ }
+ }
},
- plugins: [],
-};
-export default config;
+ plugins: []
+}
+
+export default config
\ No newline at end of file