Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-02-28 17:55:46 +00:00
parent 41f154c15d
commit e259f67996
27 changed files with 1486 additions and 1423 deletions

View File

@@ -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"`
}