Documentation ¶
Overview ¶
Package cw allows sdk users to easily get Cryptowatch objects without doing any extra work.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CWClient ¶
type CWClient struct {
// contains filtered or unexported fields
}
CWClient is a convenience tool for getting Cryptowatch objects from the api. Instead of having to create a REST client, CWClient makes one internally based on the config settings.
func NewCWClient ¶
func NewCWClient(opt *CWClientParams) *CWClient
NewCWClient creates a new instance of CWClient. It will use the default RESTClient.
func (*CWClient) GetMarket ¶
func (cw *CWClient) GetMarket(opt GetMarketParams) (common.Market, error)
GetMarket uses the REST API to get a market by exchange + base + quote. This method is not thread-safe.
func (*CWClient) MustGetAsset ¶
func (cw *CWClient) MustGetAsset(opt GetAssetParams) common.Asset
func (*CWClient) MustGetMarket ¶
func (cw *CWClient) MustGetMarket(opt GetMarketParams) common.Market
type CWClientParams ¶
CWClientParams allows you to control the RESTClient in CWClient.
type GetAssetParams ¶
type GetAssetParams struct { Symbol common.AssetSymbol ID common.AssetID }
GetAssetParams is the parameter type to GetAsset which allows you to get an asset by Symbol or ID. Only one needs to be present.
type GetMarketParams ¶
type GetMarketParams struct { Symbol common.MarketSymbol ID common.MarketID }
GetMarketParams is the parameter type to GetMarket which allows you to get a market by Symbol OR ID. Only one needs to be present.
type Interface ¶
type Interface interface { GetMarket(GetMarketParams) (common.Market, error) MustGetMarket(GetMarketParams) common.Market GetAsset(GetAssetParams) (common.Asset, error) MustGetAsset(GetAssetParams) common.Asset }