Skip to content

Commit

Permalink
Refactor marketData.ts and remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
117 committed Mar 25, 2024
1 parent 6422d37 commit e5ef624
Show file tree
Hide file tree
Showing 4 changed files with 306 additions and 1,475 deletions.
52 changes: 26 additions & 26 deletions api/marketData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BaseAPI, ClientContext } from "../factory/createClient.ts";
import { ClientContext } from "../factory/createClient.ts";

export interface CorporateActionsQueryParams {
symbols: string;
Expand Down Expand Up @@ -319,30 +319,30 @@ export interface OptionExchangeMapping {
}

export interface LatestQuotesResponse {
quotes: {
[symbol: string]: {
t: string; // Timestamp in RFC-3339 format
ax: string; // Ask exchange
ap: number; // Ask price
as: number; // Ask size
bx: string; // Bid exchange
bp: number; // Bid price
bs: number; // Bid size
c: string; // Condition
};
};
// quotes: {
// [symbol: string]: {
// t: string; // Timestamp in RFC-3339 format
// ax: string; // Ask exchange
// ap: number; // Ask price
// as: number; // Ask size
// bx: string; // Bid exchange
// bp: number; // Bid price
// bs: number; // Bid size
// c: string; // Condition
// };
// };
}

export interface LatestTradesResponse {
trades: {
[symbol: string]: {
t: string; // Timestamp in RFC-3339 format
x: string; // Exchange code
p: number; // Trade price
s: number; // Trade size
c: string; // Condition
};
};
// trades: {
// [symbol: string]: {
// t: string; // Timestamp in RFC-3339 format
// x: string; // Exchange code
// p: number; // Trade price
// s: number; // Trade size
// c: string; // Condition
// };
// };
}

export interface HistoricalTradesResponse {
Expand Down Expand Up @@ -485,9 +485,9 @@ export interface LatestQuotesParams {
}

export interface LatestQuotesResponse {
quotes: {
[symbol: string]: LatestQuote;
};
// quotes: {
// [symbol: string]: LatestQuote;
// };
}

export interface LatestQuote {
Expand Down Expand Up @@ -622,7 +622,7 @@ export interface HistoricalAuctionsParams {

export type MarketDataEventMap = any;

export default ({ request }: ClientContext): BaseAPI<any, any> => ({
export default ({ request }: ClientContext) => ({
rest: {
v1beta1: {
corporateActions: (queryParams: CorporateActionsQueryParams) =>
Expand Down
52 changes: 0 additions & 52 deletions api/temp.ts

This file was deleted.

Loading

0 comments on commit e5ef624

Please sign in to comment.