summaryrefslogtreecommitdiff
path: root/frontend/types/api.ts
blob: 679ada9bec2f2f6b83829fe1f360027c5ecd7ce3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
export type SearchResult = {
  symbol: string;
  name: string;
  exchange?: string | null;
};

export type Quote = {
  price?: number | null;
  prev_close?: number | null;
  change?: number | null;
  change_pct?: number | null;
};

export type MarketIndex = {
  name: string;
  price?: number | null;
  change_pct?: number | null;
};

export type Signal = {
  key: string;
  state: "pos" | "warn" | "neg" | "neu";
  value: string;
  description: string;
};

export type TickerOverview = {
  profile: {
    symbol: string;
    name: string;
    sector?: string | null;
    industry?: string | null;
    exchange?: string | null;
    website?: string | null;
    summary?: string | null;
  };
  quote: Quote;
  signals: Signal[];
  stats: {
    market_cap?: number | null;
    trailing_pe?: number | null;
    trailing_eps?: number | null;
    volume?: number | null;
    average_volume?: number | null;
    beta?: number | null;
  };
  range_52w: {
    low?: number | null;
    high?: number | null;
    price?: number | null;
  };
  short_interest: {
    short_percent_of_float?: number | null;
    short_ratio?: number | null;
    shares_short?: number | null;
    shares_short_prior_month?: number | null;
    shares_short_delta_pct?: number | null;
  };
  meta: {
    status: "complete" | "partial";
    is_partial: boolean;
    field_availability: Record<string, boolean>;
    sources: Record<string, string>;
  };
};

export type HistoryPoint = {
  date: string;
  open?: number | null;
  high?: number | null;
  low?: number | null;
  close?: number | null;
  volume?: number | null;
};

export type WatchlistItem = {
  symbol: string;
  created_at: string;
  quote?: Quote | null;
};

export type WatchlistResponse = {
  items: WatchlistItem[];
  limit: number;
};