Documentation
¶
Index ¶
- Constants
- type Balance
- type BalanceSnapshot
- type CancelAllOrdersRequest
- func (c *CancelAllOrdersRequest) Do(ctx context.Context) (CancelAllOrdersResponse, error)
- func (c *CancelAllOrdersRequest) GetParameters() (map[string]interface{}, error)
- func (c *CancelAllOrdersRequest) GetParametersJSON() ([]byte, error)
- func (c *CancelAllOrdersRequest) GetParametersQuery() (url.Values, error)
- func (c *CancelAllOrdersRequest) GetPath() string
- func (c *CancelAllOrdersRequest) GetQueryParameters() (url.Values, error)
- func (c *CancelAllOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
- func (c *CancelAllOrdersRequest) GetSlugsMap() (map[string]string, error)
- func (c *CancelAllOrdersRequest) ProductID(productID string) *CancelAllOrdersRequest
- func (c *CancelAllOrdersRequest) ProfileID(profileID string) *CancelAllOrdersRequest
- type CancelAllOrdersResponse
- type CancelOrderRequest
- func (c *CancelOrderRequest) Do(ctx context.Context) (*CancelOrderResponse, error)
- func (c *CancelOrderRequest) GetParameters() (map[string]interface{}, error)
- func (c *CancelOrderRequest) GetParametersJSON() ([]byte, error)
- func (c *CancelOrderRequest) GetParametersQuery() (url.Values, error)
- func (c *CancelOrderRequest) GetPath() string
- func (c *CancelOrderRequest) GetQueryParameters() (url.Values, error)
- func (c *CancelOrderRequest) GetSlugParameters() (map[string]interface{}, error)
- func (c *CancelOrderRequest) GetSlugsMap() (map[string]string, error)
- func (c *CancelOrderRequest) OrderID(orderID string) *CancelOrderRequest
- func (c *CancelOrderRequest) ProductID(productID string) *CancelOrderRequest
- func (c *CancelOrderRequest) ProfileID(profileID string) *CancelOrderRequest
- type CancelOrderResponse
- type Candle
- type CreateOrderRequest
- func (c *CreateOrderRequest) CancelAfter(cancelAfter string) *CreateOrderRequest
- func (c *CreateOrderRequest) ClientOrderID(clientOrderID string) *CreateOrderRequest
- func (c *CreateOrderRequest) Do(ctx context.Context) (*CreateOrderResponse, error)
- func (c *CreateOrderRequest) Funds(funds fixedpoint.Value) *CreateOrderRequest
- func (c *CreateOrderRequest) GetParameters() (map[string]interface{}, error)
- func (c *CreateOrderRequest) GetParametersJSON() ([]byte, error)
- func (c *CreateOrderRequest) GetParametersQuery() (url.Values, error)
- func (c *CreateOrderRequest) GetPath() string
- func (c *CreateOrderRequest) GetQueryParameters() (url.Values, error)
- func (c *CreateOrderRequest) GetSlugParameters() (map[string]interface{}, error)
- func (c *CreateOrderRequest) GetSlugsMap() (map[string]string, error)
- func (c *CreateOrderRequest) MaxFloor(maxFloor string) *CreateOrderRequest
- func (c *CreateOrderRequest) OrderType(orderType string) *CreateOrderRequest
- func (c *CreateOrderRequest) PostOnly(postOnly bool) *CreateOrderRequest
- func (c *CreateOrderRequest) Price(price fixedpoint.Value) *CreateOrderRequest
- func (c *CreateOrderRequest) ProductID(productID string) *CreateOrderRequest
- func (c *CreateOrderRequest) ProfileID(profileID string) *CreateOrderRequest
- func (c *CreateOrderRequest) Side(side string) *CreateOrderRequest
- func (c *CreateOrderRequest) Size(size fixedpoint.Value) *CreateOrderRequest
- func (c *CreateOrderRequest) Stop(stop string) *CreateOrderRequest
- func (c *CreateOrderRequest) StopLimitPrice(stopLimitPrice fixedpoint.Value) *CreateOrderRequest
- func (c *CreateOrderRequest) StopPrice(stopPrice fixedpoint.Value) *CreateOrderRequest
- func (c *CreateOrderRequest) Stp(stp string) *CreateOrderRequest
- func (c *CreateOrderRequest) TimeInForce(timeInForce string) *CreateOrderRequest
- type CreateOrderResponse
- type GetBalancesRequest
- func (g *GetBalancesRequest) Do(ctx context.Context) (BalanceSnapshot, error)
- func (g *GetBalancesRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetBalancesRequest) GetParametersJSON() ([]byte, error)
- func (g *GetBalancesRequest) GetParametersQuery() (url.Values, error)
- func (g *GetBalancesRequest) GetPath() string
- func (g *GetBalancesRequest) GetQueryParameters() (url.Values, error)
- func (g *GetBalancesRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetBalancesRequest) GetSlugsMap() (map[string]string, error)
- type GetCandlesRequest
- func (g *GetCandlesRequest) Do(ctx context.Context) (GetCandlesResponse, error)
- func (g *GetCandlesRequest) End(end time.Time) *GetCandlesRequest
- func (g *GetCandlesRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetCandlesRequest) GetParametersJSON() ([]byte, error)
- func (g *GetCandlesRequest) GetParametersQuery() (url.Values, error)
- func (g *GetCandlesRequest) GetPath() string
- func (g *GetCandlesRequest) GetQueryParameters() (url.Values, error)
- func (g *GetCandlesRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetCandlesRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetCandlesRequest) Granularity(granularity string) *GetCandlesRequest
- func (g *GetCandlesRequest) ProductID(productID string) *GetCandlesRequest
- func (g *GetCandlesRequest) Start(start time.Time) *GetCandlesRequest
- type GetCandlesResponse
- type GetMarketInfoRequest
- func (g *GetMarketInfoRequest) Do(ctx context.Context) (MarketInfoResponse, error)
- func (g *GetMarketInfoRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetMarketInfoRequest) GetParametersJSON() ([]byte, error)
- func (g *GetMarketInfoRequest) GetParametersQuery() (url.Values, error)
- func (g *GetMarketInfoRequest) GetPath() string
- func (g *GetMarketInfoRequest) GetQueryParameters() (url.Values, error)
- func (g *GetMarketInfoRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetMarketInfoRequest) GetSlugsMap() (map[string]string, error)
- type GetOrderTradesRequest
- func (g *GetOrderTradesRequest) After(after int) *GetOrderTradesRequest
- func (g *GetOrderTradesRequest) Before(before int) *GetOrderTradesRequest
- func (g *GetOrderTradesRequest) Do(ctx context.Context) (TradeSnapshot, error)
- func (g *GetOrderTradesRequest) EndDate(endDate string) *GetOrderTradesRequest
- func (g *GetOrderTradesRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetOrderTradesRequest) GetParametersJSON() ([]byte, error)
- func (g *GetOrderTradesRequest) GetParametersQuery() (url.Values, error)
- func (g *GetOrderTradesRequest) GetPath() string
- func (g *GetOrderTradesRequest) GetQueryParameters() (url.Values, error)
- func (g *GetOrderTradesRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetOrderTradesRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetOrderTradesRequest) Limit(limit int) *GetOrderTradesRequest
- func (g *GetOrderTradesRequest) MarketType(marketType MarketType) *GetOrderTradesRequest
- func (g *GetOrderTradesRequest) OrderID(orderID string) *GetOrderTradesRequest
- func (g *GetOrderTradesRequest) ProductID(productID string) *GetOrderTradesRequest
- func (g *GetOrderTradesRequest) StartDate(startDate string) *GetOrderTradesRequest
- type GetOrdersRequest
- func (g *GetOrdersRequest) After(after time.Time) *GetOrdersRequest
- func (g *GetOrdersRequest) Before(before time.Time) *GetOrdersRequest
- func (g *GetOrdersRequest) Do(ctx context.Context) (OrderSnapshot, error)
- func (g *GetOrdersRequest) EndDate(endDate time.Time) *GetOrdersRequest
- func (g *GetOrdersRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetOrdersRequest) GetParametersJSON() ([]byte, error)
- func (g *GetOrdersRequest) GetParametersQuery() (url.Values, error)
- func (g *GetOrdersRequest) GetPath() string
- func (g *GetOrdersRequest) GetQueryParameters() (url.Values, error)
- func (g *GetOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetOrdersRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetOrdersRequest) Limit(limit int) *GetOrdersRequest
- func (g *GetOrdersRequest) ProductID(productID string) *GetOrdersRequest
- func (g *GetOrdersRequest) ProfileID(profileID string) *GetOrdersRequest
- func (g *GetOrdersRequest) SortedBy(sortedBy string) *GetOrdersRequest
- func (g *GetOrdersRequest) Sorting(sorting string) *GetOrdersRequest
- func (g *GetOrdersRequest) StartDate(startDate time.Time) *GetOrdersRequest
- func (g *GetOrdersRequest) Status(status []string) *GetOrdersRequest
- type GetSingleOrderRequest
- func (g *GetSingleOrderRequest) Do(ctx context.Context) (*Order, error)
- func (g *GetSingleOrderRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetSingleOrderRequest) GetParametersJSON() ([]byte, error)
- func (g *GetSingleOrderRequest) GetParametersQuery() (url.Values, error)
- func (g *GetSingleOrderRequest) GetPath() string
- func (g *GetSingleOrderRequest) GetQueryParameters() (url.Values, error)
- func (g *GetSingleOrderRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetSingleOrderRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetSingleOrderRequest) OrderID(orderID string) *GetSingleOrderRequest
- type GetTickerRequest
- func (g *GetTickerRequest) Do(ctx context.Context) (*Ticker, error)
- func (g *GetTickerRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetTickerRequest) GetParametersJSON() ([]byte, error)
- func (g *GetTickerRequest) GetParametersQuery() (url.Values, error)
- func (g *GetTickerRequest) GetPath() string
- func (g *GetTickerRequest) GetQueryParameters() (url.Values, error)
- func (g *GetTickerRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetTickerRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetTickerRequest) ProductID(productID string) *GetTickerRequest
- type Liquidity
- type MarketInfo
- type MarketInfoResponse
- type MarketStatus
- type MarketType
- type Order
- type OrderSnapshot
- type OrderStatus
- type OrderStopType
- type OrderType
- type RawCandle
- type RestAPIClient
- func (client *RestAPIClient) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, ...) (*http.Request, error)
- func (c *RestAPIClient) NewCancelAllOrdersRequest() *CancelAllOrdersRequest
- func (c *RestAPIClient) NewCancelOrderRequest() *CancelOrderRequest
- func (client *RestAPIClient) NewCreateOrderRequest() *CreateOrderRequest
- func (c *RestAPIClient) NewGetBalancesRequest() *GetBalancesRequest
- func (client *RestAPIClient) NewGetCandlesRequest() *GetCandlesRequest
- func (c *RestAPIClient) NewGetMarketInfoRequest() *GetMarketInfoRequest
- func (c *RestAPIClient) NewGetOrderTradesRequest() *GetOrderTradesRequest
- func (client *RestAPIClient) NewGetOrdersRequest() *GetOrdersRequest
- func (client *RestAPIClient) NewGetTickerRequest() *GetTickerRequest
- func (client *RestAPIClient) NewSingleOrderRequst() *GetSingleOrderRequest
- type SideType
- type Ticker
- type TimeInForceType
- type Trade
- type TradeSnapshot
Constants ¶
const ( DefaultHTTPTimeout = 15 * time.Second ProductionAPIURL = "https://api.exchange.coinbase.com" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Balance ¶
type Balance struct {
ID string `json:"id"`
Currency string `json:"currency"`
Balance fixedpoint.Value `json:"balance"`
Hold fixedpoint.Value `json:"hold"`
Available fixedpoint.Value `json:"available"`
ProfileID string `json:"profile_id"`
TradingEnabled bool `json:"trading_enabled"`
}
type BalanceSnapshot ¶
type BalanceSnapshot []Balance
type CancelAllOrdersRequest ¶
type CancelAllOrdersRequest struct {
// contains filtered or unexported fields
}
func (*CancelAllOrdersRequest) Do ¶
func (c *CancelAllOrdersRequest) Do(ctx context.Context) (CancelAllOrdersResponse, error)
Do generates the request object and send the request object to the API endpoint
func (*CancelAllOrdersRequest) GetParameters ¶
func (c *CancelAllOrdersRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*CancelAllOrdersRequest) GetParametersJSON ¶
func (c *CancelAllOrdersRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*CancelAllOrdersRequest) GetParametersQuery ¶
func (c *CancelAllOrdersRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*CancelAllOrdersRequest) GetPath ¶
func (c *CancelAllOrdersRequest) GetPath() string
GetPath returns the request path of the API
func (*CancelAllOrdersRequest) GetQueryParameters ¶
func (c *CancelAllOrdersRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*CancelAllOrdersRequest) GetSlugParameters ¶
func (c *CancelAllOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*CancelAllOrdersRequest) GetSlugsMap ¶
func (c *CancelAllOrdersRequest) GetSlugsMap() (map[string]string, error)
func (*CancelAllOrdersRequest) ProductID ¶
func (c *CancelAllOrdersRequest) ProductID(productID string) *CancelAllOrdersRequest
func (*CancelAllOrdersRequest) ProfileID ¶
func (c *CancelAllOrdersRequest) ProfileID(profileID string) *CancelAllOrdersRequest
type CancelAllOrdersResponse ¶
type CancelAllOrdersResponse []string
type CancelOrderRequest ¶
type CancelOrderRequest struct {
// contains filtered or unexported fields
}
func (*CancelOrderRequest) Do ¶
func (c *CancelOrderRequest) Do(ctx context.Context) (*CancelOrderResponse, error)
Do generates the request object and send the request object to the API endpoint
func (*CancelOrderRequest) GetParameters ¶
func (c *CancelOrderRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*CancelOrderRequest) GetParametersJSON ¶
func (c *CancelOrderRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*CancelOrderRequest) GetParametersQuery ¶
func (c *CancelOrderRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*CancelOrderRequest) GetPath ¶
func (c *CancelOrderRequest) GetPath() string
GetPath returns the request path of the API
func (*CancelOrderRequest) GetQueryParameters ¶
func (c *CancelOrderRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*CancelOrderRequest) GetSlugParameters ¶
func (c *CancelOrderRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*CancelOrderRequest) GetSlugsMap ¶
func (c *CancelOrderRequest) GetSlugsMap() (map[string]string, error)
func (*CancelOrderRequest) OrderID ¶
func (c *CancelOrderRequest) OrderID(orderID string) *CancelOrderRequest
func (*CancelOrderRequest) ProductID ¶
func (c *CancelOrderRequest) ProductID(productID string) *CancelOrderRequest
func (*CancelOrderRequest) ProfileID ¶
func (c *CancelOrderRequest) ProfileID(profileID string) *CancelOrderRequest
type CancelOrderResponse ¶
type CancelOrderResponse string
type Candle ¶
type Candle struct {
Time types.Time `json:"time"`
Low fixedpoint.Value `json:"low"`
High fixedpoint.Value `json:"high"`
Open fixedpoint.Value `json:"open"`
Close fixedpoint.Value `json:"close"`
Volume fixedpoint.Value `json:"volume"`
}
type CreateOrderRequest ¶
type CreateOrderRequest struct {
// contains filtered or unexported fields
}
func (*CreateOrderRequest) CancelAfter ¶
func (c *CreateOrderRequest) CancelAfter(cancelAfter string) *CreateOrderRequest
func (*CreateOrderRequest) ClientOrderID ¶
func (c *CreateOrderRequest) ClientOrderID(clientOrderID string) *CreateOrderRequest
func (*CreateOrderRequest) Do ¶
func (c *CreateOrderRequest) Do(ctx context.Context) (*CreateOrderResponse, error)
Do generates the request object and send the request object to the API endpoint
func (*CreateOrderRequest) Funds ¶
func (c *CreateOrderRequest) Funds(funds fixedpoint.Value) *CreateOrderRequest
func (*CreateOrderRequest) GetParameters ¶
func (c *CreateOrderRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*CreateOrderRequest) GetParametersJSON ¶
func (c *CreateOrderRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*CreateOrderRequest) GetParametersQuery ¶
func (c *CreateOrderRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*CreateOrderRequest) GetPath ¶
func (c *CreateOrderRequest) GetPath() string
GetPath returns the request path of the API
func (*CreateOrderRequest) GetQueryParameters ¶
func (c *CreateOrderRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*CreateOrderRequest) GetSlugParameters ¶
func (c *CreateOrderRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*CreateOrderRequest) GetSlugsMap ¶
func (c *CreateOrderRequest) GetSlugsMap() (map[string]string, error)
func (*CreateOrderRequest) MaxFloor ¶
func (c *CreateOrderRequest) MaxFloor(maxFloor string) *CreateOrderRequest
func (*CreateOrderRequest) OrderType ¶
func (c *CreateOrderRequest) OrderType(orderType string) *CreateOrderRequest
func (*CreateOrderRequest) PostOnly ¶
func (c *CreateOrderRequest) PostOnly(postOnly bool) *CreateOrderRequest
func (*CreateOrderRequest) Price ¶
func (c *CreateOrderRequest) Price(price fixedpoint.Value) *CreateOrderRequest
func (*CreateOrderRequest) ProductID ¶
func (c *CreateOrderRequest) ProductID(productID string) *CreateOrderRequest
func (*CreateOrderRequest) ProfileID ¶
func (c *CreateOrderRequest) ProfileID(profileID string) *CreateOrderRequest
func (*CreateOrderRequest) Side ¶
func (c *CreateOrderRequest) Side(side string) *CreateOrderRequest
func (*CreateOrderRequest) Size ¶
func (c *CreateOrderRequest) Size(size fixedpoint.Value) *CreateOrderRequest
func (*CreateOrderRequest) Stop ¶
func (c *CreateOrderRequest) Stop(stop string) *CreateOrderRequest
func (*CreateOrderRequest) StopLimitPrice ¶
func (c *CreateOrderRequest) StopLimitPrice(stopLimitPrice fixedpoint.Value) *CreateOrderRequest
func (*CreateOrderRequest) StopPrice ¶
func (c *CreateOrderRequest) StopPrice(stopPrice fixedpoint.Value) *CreateOrderRequest
func (*CreateOrderRequest) Stp ¶
func (c *CreateOrderRequest) Stp(stp string) *CreateOrderRequest
func (*CreateOrderRequest) TimeInForce ¶
func (c *CreateOrderRequest) TimeInForce(timeInForce string) *CreateOrderRequest
type CreateOrderResponse ¶
type CreateOrderResponse struct {
ID string `json:"id"`
Price fixedpoint.Value `json:"price,omitempty"`
Size fixedpoint.Value `json:"size,omitempty"`
ProductID string `json:"product_id"`
ProfileID string `json:"profile_id,omitempty"`
Side SideType `json:"side"`
Funds fixedpoint.Value `json:"funds,omitempty"`
SpecifiedFunds fixedpoint.Value `json:"specified_funds,omitempty"`
Type OrderType `json:"type"`
TimeInForce TimeInForceType `json:"time_in_force,omitempty"`
ExpireTime types.Time `json:"expire_time,omitempty"`
PostOnly bool `json:"post_only"`
CreatedAt types.Time `json:"created_at"`
DoneAt types.Time `json:"done_at,omitempty"`
DoneReason string `json:"done_reason,omitempty"`
RejectReason string `json:"reject_reason,omitempty"`
FillFees fixedpoint.Value `json:"fill_fees"`
FilledSize fixedpoint.Value `json:"filled_size"`
ExecutedValue fixedpoint.Value `json:"executed_value,omitempty"`
Status OrderStatus `json:"status"`
Settled bool `json:"settled"`
Stop OrderStopType `json:"stop,omitempty"`
StopPrice fixedpoint.Value `json:"stop_price,omitempty"`
FundingAmount string `json:"funding_amount,omitempty"`
ClientOrderID string `json:"client_oid,omitempty"`
MarketType string `json:"market_type,omitempty"`
MaxFloor string `json:"max_floor,omitempty"`
SecondaryOrderID string `json:"secondary_order_id,omitempty"`
StopLimitPrice fixedpoint.Value `json:"stop_limit_price,omitempty"`
}
type GetBalancesRequest ¶
type GetBalancesRequest struct {
// contains filtered or unexported fields
}
func (*GetBalancesRequest) Do ¶
func (g *GetBalancesRequest) Do(ctx context.Context) (BalanceSnapshot, error)
Do generates the request object and send the request object to the API endpoint
func (*GetBalancesRequest) GetParameters ¶
func (g *GetBalancesRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetBalancesRequest) GetParametersJSON ¶
func (g *GetBalancesRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetBalancesRequest) GetParametersQuery ¶
func (g *GetBalancesRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetBalancesRequest) GetPath ¶
func (g *GetBalancesRequest) GetPath() string
GetPath returns the request path of the API
func (*GetBalancesRequest) GetQueryParameters ¶
func (g *GetBalancesRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetBalancesRequest) GetSlugParameters ¶
func (g *GetBalancesRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetBalancesRequest) GetSlugsMap ¶
func (g *GetBalancesRequest) GetSlugsMap() (map[string]string, error)
type GetCandlesRequest ¶
type GetCandlesRequest struct {
// contains filtered or unexported fields
}
https://docs.cdp.coinbase.com/exchange/reference/exchangerestapi_getproductcandles
func (*GetCandlesRequest) Do ¶
func (g *GetCandlesRequest) Do(ctx context.Context) (GetCandlesResponse, error)
Do generates the request object and send the request object to the API endpoint
func (*GetCandlesRequest) End ¶
func (g *GetCandlesRequest) End(end time.Time) *GetCandlesRequest
func (*GetCandlesRequest) GetParameters ¶
func (g *GetCandlesRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetCandlesRequest) GetParametersJSON ¶
func (g *GetCandlesRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetCandlesRequest) GetParametersQuery ¶
func (g *GetCandlesRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetCandlesRequest) GetPath ¶
func (g *GetCandlesRequest) GetPath() string
GetPath returns the request path of the API
func (*GetCandlesRequest) GetQueryParameters ¶
func (g *GetCandlesRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetCandlesRequest) GetSlugParameters ¶
func (g *GetCandlesRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetCandlesRequest) GetSlugsMap ¶
func (g *GetCandlesRequest) GetSlugsMap() (map[string]string, error)
func (*GetCandlesRequest) Granularity ¶
func (g *GetCandlesRequest) Granularity(granularity string) *GetCandlesRequest
func (*GetCandlesRequest) ProductID ¶
func (g *GetCandlesRequest) ProductID(productID string) *GetCandlesRequest
func (*GetCandlesRequest) Start ¶
func (g *GetCandlesRequest) Start(start time.Time) *GetCandlesRequest
type GetCandlesResponse ¶
type GetCandlesResponse []RawCandle
type GetMarketInfoRequest ¶
type GetMarketInfoRequest struct {
// contains filtered or unexported fields
}
https://docs.cdp.coinbase.com/exchange/reference/exchangerestapi_getproducts
func (*GetMarketInfoRequest) Do ¶
func (g *GetMarketInfoRequest) Do(ctx context.Context) (MarketInfoResponse, error)
Do generates the request object and send the request object to the API endpoint
func (*GetMarketInfoRequest) GetParameters ¶
func (g *GetMarketInfoRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetMarketInfoRequest) GetParametersJSON ¶
func (g *GetMarketInfoRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetMarketInfoRequest) GetParametersQuery ¶
func (g *GetMarketInfoRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetMarketInfoRequest) GetPath ¶
func (g *GetMarketInfoRequest) GetPath() string
GetPath returns the request path of the API
func (*GetMarketInfoRequest) GetQueryParameters ¶
func (g *GetMarketInfoRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetMarketInfoRequest) GetSlugParameters ¶
func (g *GetMarketInfoRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetMarketInfoRequest) GetSlugsMap ¶
func (g *GetMarketInfoRequest) GetSlugsMap() (map[string]string, error)
type GetOrderTradesRequest ¶
type GetOrderTradesRequest struct {
// contains filtered or unexported fields
}
func (*GetOrderTradesRequest) After ¶
func (g *GetOrderTradesRequest) After(after int) *GetOrderTradesRequest
func (*GetOrderTradesRequest) Before ¶
func (g *GetOrderTradesRequest) Before(before int) *GetOrderTradesRequest
func (*GetOrderTradesRequest) Do ¶
func (g *GetOrderTradesRequest) Do(ctx context.Context) (TradeSnapshot, error)
Do generates the request object and send the request object to the API endpoint
func (*GetOrderTradesRequest) EndDate ¶
func (g *GetOrderTradesRequest) EndDate(endDate string) *GetOrderTradesRequest
func (*GetOrderTradesRequest) GetParameters ¶
func (g *GetOrderTradesRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetOrderTradesRequest) GetParametersJSON ¶
func (g *GetOrderTradesRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetOrderTradesRequest) GetParametersQuery ¶
func (g *GetOrderTradesRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetOrderTradesRequest) GetPath ¶
func (g *GetOrderTradesRequest) GetPath() string
GetPath returns the request path of the API
func (*GetOrderTradesRequest) GetQueryParameters ¶
func (g *GetOrderTradesRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetOrderTradesRequest) GetSlugParameters ¶
func (g *GetOrderTradesRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetOrderTradesRequest) GetSlugsMap ¶
func (g *GetOrderTradesRequest) GetSlugsMap() (map[string]string, error)
func (*GetOrderTradesRequest) Limit ¶
func (g *GetOrderTradesRequest) Limit(limit int) *GetOrderTradesRequest
func (*GetOrderTradesRequest) MarketType ¶
func (g *GetOrderTradesRequest) MarketType(marketType MarketType) *GetOrderTradesRequest
func (*GetOrderTradesRequest) OrderID ¶
func (g *GetOrderTradesRequest) OrderID(orderID string) *GetOrderTradesRequest
func (*GetOrderTradesRequest) ProductID ¶
func (g *GetOrderTradesRequest) ProductID(productID string) *GetOrderTradesRequest
func (*GetOrderTradesRequest) StartDate ¶
func (g *GetOrderTradesRequest) StartDate(startDate string) *GetOrderTradesRequest
type GetOrdersRequest ¶
type GetOrdersRequest struct {
// contains filtered or unexported fields
}
func (*GetOrdersRequest) After ¶
func (g *GetOrdersRequest) After(after time.Time) *GetOrdersRequest
func (*GetOrdersRequest) Before ¶
func (g *GetOrdersRequest) Before(before time.Time) *GetOrdersRequest
func (*GetOrdersRequest) Do ¶
func (g *GetOrdersRequest) Do(ctx context.Context) (OrderSnapshot, error)
Do generates the request object and send the request object to the API endpoint
func (*GetOrdersRequest) EndDate ¶
func (g *GetOrdersRequest) EndDate(endDate time.Time) *GetOrdersRequest
func (*GetOrdersRequest) GetParameters ¶
func (g *GetOrdersRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetOrdersRequest) GetParametersJSON ¶
func (g *GetOrdersRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetOrdersRequest) GetParametersQuery ¶
func (g *GetOrdersRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetOrdersRequest) GetPath ¶
func (g *GetOrdersRequest) GetPath() string
GetPath returns the request path of the API
func (*GetOrdersRequest) GetQueryParameters ¶
func (g *GetOrdersRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetOrdersRequest) GetSlugParameters ¶
func (g *GetOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetOrdersRequest) GetSlugsMap ¶
func (g *GetOrdersRequest) GetSlugsMap() (map[string]string, error)
func (*GetOrdersRequest) Limit ¶
func (g *GetOrdersRequest) Limit(limit int) *GetOrdersRequest
func (*GetOrdersRequest) ProductID ¶
func (g *GetOrdersRequest) ProductID(productID string) *GetOrdersRequest
func (*GetOrdersRequest) ProfileID ¶
func (g *GetOrdersRequest) ProfileID(profileID string) *GetOrdersRequest
func (*GetOrdersRequest) SortedBy ¶
func (g *GetOrdersRequest) SortedBy(sortedBy string) *GetOrdersRequest
func (*GetOrdersRequest) Sorting ¶
func (g *GetOrdersRequest) Sorting(sorting string) *GetOrdersRequest
func (*GetOrdersRequest) StartDate ¶
func (g *GetOrdersRequest) StartDate(startDate time.Time) *GetOrdersRequest
func (*GetOrdersRequest) Status ¶
func (g *GetOrdersRequest) Status(status []string) *GetOrdersRequest
type GetSingleOrderRequest ¶
type GetSingleOrderRequest struct {
// contains filtered or unexported fields
}
func (*GetSingleOrderRequest) Do ¶
func (g *GetSingleOrderRequest) Do(ctx context.Context) (*Order, error)
Do generates the request object and send the request object to the API endpoint
func (*GetSingleOrderRequest) GetParameters ¶
func (g *GetSingleOrderRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetSingleOrderRequest) GetParametersJSON ¶
func (g *GetSingleOrderRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetSingleOrderRequest) GetParametersQuery ¶
func (g *GetSingleOrderRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetSingleOrderRequest) GetPath ¶
func (g *GetSingleOrderRequest) GetPath() string
GetPath returns the request path of the API
func (*GetSingleOrderRequest) GetQueryParameters ¶
func (g *GetSingleOrderRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetSingleOrderRequest) GetSlugParameters ¶
func (g *GetSingleOrderRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetSingleOrderRequest) GetSlugsMap ¶
func (g *GetSingleOrderRequest) GetSlugsMap() (map[string]string, error)
func (*GetSingleOrderRequest) OrderID ¶
func (g *GetSingleOrderRequest) OrderID(orderID string) *GetSingleOrderRequest
type GetTickerRequest ¶
type GetTickerRequest struct {
// contains filtered or unexported fields
}
func (*GetTickerRequest) Do ¶
func (g *GetTickerRequest) Do(ctx context.Context) (*Ticker, error)
Do generates the request object and send the request object to the API endpoint
func (*GetTickerRequest) GetParameters ¶
func (g *GetTickerRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetTickerRequest) GetParametersJSON ¶
func (g *GetTickerRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetTickerRequest) GetParametersQuery ¶
func (g *GetTickerRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetTickerRequest) GetPath ¶
func (g *GetTickerRequest) GetPath() string
GetPath returns the request path of the API
func (*GetTickerRequest) GetQueryParameters ¶
func (g *GetTickerRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetTickerRequest) GetSlugParameters ¶
func (g *GetTickerRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetTickerRequest) GetSlugsMap ¶
func (g *GetTickerRequest) GetSlugsMap() (map[string]string, error)
func (*GetTickerRequest) ProductID ¶
func (g *GetTickerRequest) ProductID(productID string) *GetTickerRequest
type MarketInfo ¶
type MarketInfo struct {
ID string `json:"id"`
BaseCurrency string `json:"base_currency"`
QuoteCurrency string `json:"quote_currency"`
QuoteIncrement fixedpoint.Value `json:"quote_increment"`
BaseIncrement fixedpoint.Value `json:"base_increment"`
DisplayName string `json:"display_name"`
MinMarketFunds fixedpoint.Value `json:"min_market_funds"`
MarginEnabled bool `json:"margin_enabled"`
PostOnly bool `json:"post_only"`
LimitOnly bool `json:"limit_only"`
CancelOnly bool `json:"cancel_only"`
Status MarketStatus `json:"status"`
StatusMessage string `json:"status_message"`
AuctionMode bool `json:"auction_mode"`
TradingDisabled bool `json:"trading_disabled,omitempty"`
FxStablecoin bool `json:"fx_stablecoin,omitempty"`
MaxSlippagePercentage string `json:"max_slippage_percentage,omitempty"`
HighBidLimitPercentage string `json:"high_bid_limit_percentage,omitempty"`
}
type MarketInfoResponse ¶
type MarketInfoResponse []MarketInfo
type MarketStatus ¶
type MarketStatus string
const ( MarketStatusOnline MarketStatus = "online" MarketStatusOffline MarketStatus = "offline" MarketStatusInternal MarketStatus = "internal" MarketStatusDelisted MarketStatus = "delisted" )
type MarketType ¶
type MarketType string
const ( MarketTypeSpot MarketType = "spot" MarketTypeRfq MarketType = "rfq" )
type Order ¶
type Order struct {
Type string `json:"type"`
Size fixedpoint.Value `json:"size"`
Side SideType `json:"side"`
ProductID string `json:"product_id"`
// ClientOID must be uuid
ClientOID string `json:"client_oid"`
Stop string `json:"stop"`
StopPrice fixedpoint.Value `json:"stop_price"`
// Limit Order
Price fixedpoint.Value `json:"price"`
TimeInForce TimeInForceType `json:"time_in_force"`
PostOnly bool `json:"post_only"`
CancelAfter string `json:"cancel_after"`
// Market Order
Funds fixedpoint.Value `json:"funds"`
SpecifiedFunds fixedpoint.Value `json:"specified_funds"`
// Response Fields
ID string `json:"id"`
Status OrderStatus `json:"status"`
Settled bool `json:"settled"`
DoneReason string `json:"done_reason"`
DoneAt types.Time `json:"done_at"`
CreatedAt types.Time `json:"created_at"`
FillFees fixedpoint.Value `json:"fill_fees"`
FilledSize fixedpoint.Value `json:"filled_size"`
ExecutedValue fixedpoint.Value `json:"executed_value"`
}
type OrderSnapshot ¶
type OrderSnapshot []Order
type OrderStatus ¶
type OrderStatus string
const ( OrderStatusReceived OrderStatus = "received" OrderStatusPending OrderStatus = "pending" OrderStatusOpen OrderStatus = "open" OrderStatusRejected OrderStatus = "rejected" OrderStatusDone OrderStatus = "done" OrderStatusActive OrderStatus = "active" // query only status OrderStatusAll OrderStatus = "all" // query only status )
type OrderStopType ¶
type OrderStopType string
const ( OrderStopTypeLoss OrderStopType = "loss" OrderStopTypeEntry OrderStopType = "entry" )
type RawCandle ¶
type RawCandle []fixedpoint.Value
an array of [ time, low, high, open, close, volume ] `time` is the timestamp of the start time of the bucket, which is the seconds since epoch.
type RestAPIClient ¶
type RestAPIClient struct {
requestgen.BaseAPIClient
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient( key, secret, passphrase string, timeout time.Duration, ) *RestAPIClient
func (*RestAPIClient) NewAuthenticatedRequest ¶
func (client *RestAPIClient) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, payload interface{}) (*http.Request, error)
Implements AuthenticatedAPIClient
func (*RestAPIClient) NewCancelAllOrdersRequest ¶
func (c *RestAPIClient) NewCancelAllOrdersRequest() *CancelAllOrdersRequest
func (*RestAPIClient) NewCancelOrderRequest ¶
func (c *RestAPIClient) NewCancelOrderRequest() *CancelOrderRequest
func (*RestAPIClient) NewCreateOrderRequest ¶
func (client *RestAPIClient) NewCreateOrderRequest() *CreateOrderRequest
func (*RestAPIClient) NewGetBalancesRequest ¶
func (c *RestAPIClient) NewGetBalancesRequest() *GetBalancesRequest
func (*RestAPIClient) NewGetCandlesRequest ¶
func (client *RestAPIClient) NewGetCandlesRequest() *GetCandlesRequest
func (*RestAPIClient) NewGetMarketInfoRequest ¶
func (c *RestAPIClient) NewGetMarketInfoRequest() *GetMarketInfoRequest
func (*RestAPIClient) NewGetOrderTradesRequest ¶
func (c *RestAPIClient) NewGetOrderTradesRequest() *GetOrderTradesRequest
func (*RestAPIClient) NewGetOrdersRequest ¶
func (client *RestAPIClient) NewGetOrdersRequest() *GetOrdersRequest
func (*RestAPIClient) NewGetTickerRequest ¶
func (client *RestAPIClient) NewGetTickerRequest() *GetTickerRequest
func (*RestAPIClient) NewSingleOrderRequst ¶
func (client *RestAPIClient) NewSingleOrderRequst() *GetSingleOrderRequest
type Ticker ¶
type Ticker struct {
TradeID int `json:"trade_id"`
Ask fixedpoint.Value `json:"ask"`
Bid fixedpoint.Value `json:"bid"`
Volume fixedpoint.Value `json:"volume"`
Price fixedpoint.Value `json:"price"`
Size fixedpoint.Value `json:"size"`
Time types.Time `json:"time"`
RfqVolume string `json:"rfq_volume"`
ConversionsVolume string `json:"conversions_volume"`
}
type TimeInForceType ¶
type TimeInForceType string
const ( TimeInForceGTC TimeInForceType = "GTC" TimeInForceGTT TimeInForceType = "GTT" TimeInForceIOC TimeInForceType = "IOC" TimeInForceFOK TimeInForceType = "FOK" )
type Trade ¶
type Trade struct {
TradeID int `json:"trade_id"`
ProductID string `json:"product_id"`
OrderID string `json:"order_id"`
UserID string `json:"user_id"`
ProfileID string `json:"profile_id"`
Liquidity Liquidity `json:"liquidity"`
Price fixedpoint.Value `json:"price"`
Size fixedpoint.Value `json:"size"`
Fee fixedpoint.Value `json:"fee"`
CreatedAt types.Time `json:"created_at"`
Side SideType `json:"side"`
Settled bool `json:"settled"`
UsdVolume string `json:"usd_volume"`
FundingCurrency string `json:"funding_currency"`
}
type TradeSnapshot ¶
type TradeSnapshot []Trade
Source Files
¶
- api_client.go
- cancel_all_orders_request_requestgen.go
- cancel_order_request.go
- cancel_order_request_requestgen.go
- constants.go
- create_order_request.go
- create_order_request_requestgen.go
- get_balances_request.go
- get_balances_request_requestgen.go
- get_candles_request.go
- get_candles_request_requestgen.go
- get_market_info_request.go
- get_market_info_request_requestgen.go
- get_order_trades_request.go
- get_order_trades_request_requestgen.go
- get_orders_request.go
- get_orders_request_requestgen.go
- get_single_order_request_requestgen.go
- get_ticker_request.go
- get_ticker_request_requestgen.go