Documentation ¶
Index ¶
- Constants
- func BuildNonceWithPayload(authData authdata.AuthData, endpoint string) (sig, payload string)
- type AuthConfig
- type Client
- func (c Client) PriceFeed(ctx context.Context) (*PriceFeedResponse, error)
- func (c *Client) SetHttpTimeout(timeout time.Duration) *Client
- func (c Client) SymbolDetails(ctx context.Context, symbol string) (*SymbolDetailsResponse, error)
- func (c Client) Symbols(ctx context.Context) (*SymbolsResponse, error)
- func (c Client) Ticker(ctx context.Context, symbol string) (*TickerResponse, error)
- func (c Client) TickerV2(ctx context.Context, symbol string) (*TickerV2Response, error)
- type Config
- type NoncePayload
- type NotificationsConfig
- type OrderBookStatus
- type PriceFeedData
- type PriceFeedResponse
- type SpotPriceNotificationsConfig
- type SubscribeTradesResponse
- type SymbolDetailsResponse
- type SymbolsResponse
- type TickerResponse
- type TickerV2Response
- type TickerVolume
- type TradeEvent
- type WebsocketResponse
Constants ¶
View Source
const (
DefaultPollInterval = 30 * time.Second
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthConfig ¶
type AuthConfig struct { ApiKey string `json:"api_key" yaml:"api_key"` ApiSecret string `json:"api_secret" yaml:"api_secret"` }
func (AuthConfig) Account ¶
func (c AuthConfig) Account() string
func (AuthConfig) Key ¶
func (c AuthConfig) Key() string
func (AuthConfig) Secret ¶
func (c AuthConfig) Secret() string
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a superficial wrapper around API functions in this package, allowing users to call those functions without passing an authdata.AuthData object for every call.
func (Client) PriceFeed ¶
func (c Client) PriceFeed(ctx context.Context) (*PriceFeedResponse, error)
func (*Client) SetHttpTimeout ¶
SetHttpTimeout sets the timeout of the Client's http.Client instance. By default, this is set to 10 seconds.
func (Client) SymbolDetails ¶
type Config ¶
type Config struct { Auth *AuthConfig `json:"auth,omitempty" yaml:"auth,omitempty" toml:"Auth"` Notifications NotificationsConfig `json:"notifications" yaml:"notifications" toml:"Notifications"` PollInterval time.Duration `json:"poll_interval" yaml:"poll_interval" toml:"PollInterval"` }
func DefaultConfig ¶
func DefaultConfig() *Config
func LoadConfig ¶
LoadConfig reads configuration data from the file at the passed path and returns it as a fully loaded Config. `confPath` is expected to be an absolute file path. Supported file types: json, yaml, toml
type NoncePayload ¶
func (NoncePayload) Encode ¶
func (np NoncePayload) Encode() (encoded []byte)
func (NoncePayload) EncodeString ¶
func (np NoncePayload) EncodeString() (encoded string)
func (NoncePayload) HashHmac ¶
func (np NoncePayload) HashHmac(key string) (sig string)
func (NoncePayload) Serialize ¶
func (np NoncePayload) Serialize() []byte
type NotificationsConfig ¶
type NotificationsConfig struct {
SpotPrice []SpotPriceNotificationsConfig `json:"spot_price,omitempty" yaml:"spot_price,omitempty" toml:"SpotPrice,omitempty"`
}
type OrderBookStatus ¶
type OrderBookStatus string
const ( Open OrderBookStatus = "open" Closed OrderBookStatus = "closed" CancelOnly OrderBookStatus = "cancel_only" PostOnly OrderBookStatus = "post_only" LimitOnly OrderBookStatus = "limit_only" )
type PriceFeedData ¶
type PriceFeedResponse ¶
type PriceFeedResponse []PriceFeedData
type SpotPriceNotificationsConfig ¶
type SpotPriceNotificationsConfig struct { Symbol *string `json:"symbol,omitempty" yaml:"symbol,omitempty" toml:"Symbol,omitempty"` BaseAmount *decimal.Decimal `json:"base_amount,omitempty" yaml:"base_amount,omitempty" toml:"BaseAmount,omitempty"` BaseCurrency string `json:"base_currency" yaml:"base_currency" toml:"BaseCurrency"` QuoteCurrency string `json:"quote_currency" yaml:"quote_currency" toml:"QuoteCurrency"` }
func (SpotPriceNotificationsConfig) BaseAmt ¶
func (c SpotPriceNotificationsConfig) BaseAmt() decimal.Decimal
func (SpotPriceNotificationsConfig) CurrencySymbol ¶
func (c SpotPriceNotificationsConfig) CurrencySymbol() string
type SubscribeTradesResponse ¶
type SubscribeTradesResponse struct { Events []TradeEvent `json:"events"` WebsocketResponse }
type SymbolDetailsResponse ¶
type SymbolDetailsResponse struct { Symbol string `json:"symbol"` BaseCurrency string `json:"base_currency"` QuoteCurrency string `json:"quote_currency"` TickSize decimal.Decimal `json:"tick_size"` QuoteIncrement decimal.Decimal `json:"quote_increment"` MinOrderSize decimal.Decimal `json:"min_order_size"` Status OrderBookStatus `json:"status"` WrapEnabled bool `json:"wrap_enabled"` }
func SymbolDetails ¶
type SymbolsResponse ¶
type SymbolsResponse []string
type TickerResponse ¶
type TickerV2Response ¶
type TickerV2Response struct { Symbol string `json:"symbol"` Open decimal.Decimal `json:"open"` High decimal.Decimal `json:"high"` Low decimal.Decimal `json:"low"` Close decimal.Decimal `json:"close"` Bid decimal.Decimal `json:"bid"` Ask decimal.Decimal `json:"ask"` Changes []decimal.Decimal `json:"changes"` }
type TickerVolume ¶
type TickerVolume struct { Timestamp time.Time `json:"timestamp"` // contains filtered or unexported fields }
func (*TickerVolume) UnmarshalJSON ¶
func (tv *TickerVolume) UnmarshalJSON(data []byte) error
type TradeEvent ¶
Click to show internal directories.
Click to hide internal directories.