mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
Commit from m3o/m3o action
This commit is contained in:
@@ -9,6 +9,7 @@ type Crypto interface {
|
||||
News(*NewsRequest) (*NewsResponse, error)
|
||||
Price(*PriceRequest) (*PriceResponse, error)
|
||||
Quote(*QuoteRequest) (*QuoteResponse, error)
|
||||
Symbols(*SymbolsRequest) (*SymbolsResponse, error)
|
||||
}
|
||||
|
||||
func NewCryptoService(token string) *CryptoService {
|
||||
@@ -55,6 +56,14 @@ func (t *CryptoService) Quote(request *QuoteRequest) (*QuoteResponse, error) {
|
||||
|
||||
}
|
||||
|
||||
// Returns the full list of supported symbols
|
||||
func (t *CryptoService) Symbols(request *SymbolsRequest) (*SymbolsResponse, error) {
|
||||
|
||||
rsp := &SymbolsResponse{}
|
||||
return rsp, t.client.Call("crypto", "Symbols", request, rsp)
|
||||
|
||||
}
|
||||
|
||||
type Article struct {
|
||||
// the date published
|
||||
Date string `json:"date"`
|
||||
@@ -133,3 +142,15 @@ type QuoteResponse struct {
|
||||
// the UTC timestamp of the quote
|
||||
Timestamp string `json:"timestamp"`
|
||||
}
|
||||
|
||||
type Symbol struct {
|
||||
Name string `json:"name"`
|
||||
Symbol string `json:"symbol"`
|
||||
}
|
||||
|
||||
type SymbolsRequest struct {
|
||||
}
|
||||
|
||||
type SymbolsResponse struct {
|
||||
Symbols []Symbol `json:"symbols"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user