Skip to content

Commit

Permalink
feat: add list exchange symbols
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Cermak <[email protected]>
  • Loading branch information
CermakM committed Dec 6, 2024
1 parent b5c2074 commit 30ab2fc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
7 changes: 4 additions & 3 deletions market/quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
)

const (
GetFullPricePath = "/api/v3/quote/:symbol"
GetPriceChangePath = "/api/v3/stock-price-target/:symbol"
BatchGetFullPricePath = "/api/v3/quote/:symbols"
ListExchangeSymbolsPath = "/api/v3/symbol/:exchange"
GetFullPricePath = "/api/v3/quote/:symbol"
GetPriceChangePath = "/api/v3/stock-price-target/:symbol"
BatchGetFullPricePath = "/api/v3/quote/:symbols"

GetRealtimeQuotePath = "/api/v3/stock/full/real-time-price/:symbol"
BatchGetRealtimeQuotePath = "/api/v3/stock/full/real-time-price/:symbols"
Expand Down
6 changes: 6 additions & 0 deletions market/ticker.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,9 @@ func (tc *TickerClient) ListMostActiveTickers(ctx context.Context, opts ...model
_, err := tc.Call(ctx, http.MethodGet, ListMostActiveTickersPath, nil, &res, opts...)
return res, err
}

func (qc *TickerClient) ListExchangeSymbols(ctx context.Context, params *model.ListExchangeSymbolsParams, opts ...model.RequestOption) (model.ListExchangeSymbolsResponse, error) {
var res model.ListExchangeSymbolsResponse
_, err := qc.Call(ctx, http.MethodGet, ListExchangeSymbolsPath, params, &res, opts...)
return res, err
}
6 changes: 6 additions & 0 deletions model/quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ type TickerQuote struct {

type ListAllRealtimeQuotesResponse = []TickerQuote

type ListExchangeSymbolsParams struct {
Exchange string `path:"exchange,required"`
}

type ListExchangeSymbolsResponse = []TickerPrice

type GetFullPriceParams struct {
Symbol string `path:"symbol,required"`
}
Expand Down

0 comments on commit 30ab2fc

Please sign in to comment.