Documentation ¶
Index ¶
- Constants
- type APIResponse
- type Account
- type Balance
- type CancelAllOrderRequest
- func (c *CancelAllOrderRequest) Do(ctx context.Context) (*APIResponse, error)
- func (c *CancelAllOrderRequest) GetParameters() (map[string]interface{}, error)
- func (c *CancelAllOrderRequest) GetParametersJSON() ([]byte, error)
- func (c *CancelAllOrderRequest) GetParametersQuery() (url.Values, error)
- func (c *CancelAllOrderRequest) GetQueryParameters() (url.Values, error)
- func (c *CancelAllOrderRequest) GetSlugParameters() (map[string]interface{}, error)
- func (c *CancelAllOrderRequest) GetSlugsMap() (map[string]string, error)
- func (c *CancelAllOrderRequest) Market(market string) *CancelAllOrderRequest
- type CancelOrderByClientOrderIdRequest
- func (c *CancelOrderByClientOrderIdRequest) ClientOrderId(clientOrderId string) *CancelOrderByClientOrderIdRequest
- func (c *CancelOrderByClientOrderIdRequest) Do(ctx context.Context) (*APIResponse, error)
- func (c *CancelOrderByClientOrderIdRequest) GetParameters() (map[string]interface{}, error)
- func (c *CancelOrderByClientOrderIdRequest) GetParametersJSON() ([]byte, error)
- func (c *CancelOrderByClientOrderIdRequest) GetParametersQuery() (url.Values, error)
- func (c *CancelOrderByClientOrderIdRequest) GetQueryParameters() (url.Values, error)
- func (c *CancelOrderByClientOrderIdRequest) GetSlugParameters() (map[string]interface{}, error)
- func (c *CancelOrderByClientOrderIdRequest) GetSlugsMap() (map[string]string, error)
- type CancelOrderRequest
- func (c *CancelOrderRequest) Do(ctx context.Context) (*APIResponse, 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) 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
- type Coin
- type Fill
- type GetAccountRequest
- func (g *GetAccountRequest) Do(ctx context.Context) (*Account, error)
- func (g *GetAccountRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetAccountRequest) GetParametersJSON() ([]byte, error)
- func (g *GetAccountRequest) GetParametersQuery() (url.Values, error)
- func (g *GetAccountRequest) GetQueryParameters() (url.Values, error)
- func (g *GetAccountRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetAccountRequest) GetSlugsMap() (map[string]string, error)
- type GetBalancesRequest
- func (g *GetBalancesRequest) Do(ctx context.Context) ([]Balance, 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) GetQueryParameters() (url.Values, error)
- func (g *GetBalancesRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetBalancesRequest) GetSlugsMap() (map[string]string, error)
- type GetCoinsRequest
- func (g *GetCoinsRequest) Do(ctx context.Context) ([]Coin, error)
- func (g *GetCoinsRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetCoinsRequest) GetParametersJSON() ([]byte, error)
- func (g *GetCoinsRequest) GetParametersQuery() (url.Values, error)
- func (g *GetCoinsRequest) GetQueryParameters() (url.Values, error)
- func (g *GetCoinsRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetCoinsRequest) GetSlugsMap() (map[string]string, error)
- type GetFillsRequest
- func (g *GetFillsRequest) Do(ctx context.Context) ([]Fill, error)
- func (g *GetFillsRequest) EndTime(endTime time.Time) *GetFillsRequest
- func (g *GetFillsRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetFillsRequest) GetParametersJSON() ([]byte, error)
- func (g *GetFillsRequest) GetParametersQuery() (url.Values, error)
- func (g *GetFillsRequest) GetQueryParameters() (url.Values, error)
- func (g *GetFillsRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetFillsRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetFillsRequest) Market(market string) *GetFillsRequest
- func (g *GetFillsRequest) Order(order string) *GetFillsRequest
- func (g *GetFillsRequest) OrderID(orderID int) *GetFillsRequest
- func (g *GetFillsRequest) StartTime(startTime time.Time) *GetFillsRequest
- type GetMarketRequest
- func (g *GetMarketRequest) Do(ctx context.Context) (*Market, error)
- func (g *GetMarketRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetMarketRequest) GetParametersJSON() ([]byte, error)
- func (g *GetMarketRequest) GetParametersQuery() (url.Values, error)
- func (g *GetMarketRequest) GetQueryParameters() (url.Values, error)
- func (g *GetMarketRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetMarketRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetMarketRequest) Market(market string) *GetMarketRequest
- type GetMarketsRequest
- func (g *GetMarketsRequest) Do(ctx context.Context) ([]Market, error)
- func (g *GetMarketsRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetMarketsRequest) GetParametersJSON() ([]byte, error)
- func (g *GetMarketsRequest) GetParametersQuery() (url.Values, error)
- func (g *GetMarketsRequest) GetQueryParameters() (url.Values, error)
- func (g *GetMarketsRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetMarketsRequest) GetSlugsMap() (map[string]string, error)
- type GetOpenOrdersRequest
- func (g *GetOpenOrdersRequest) Do(ctx context.Context) ([]Order, error)
- func (g *GetOpenOrdersRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetOpenOrdersRequest) GetParametersJSON() ([]byte, error)
- func (g *GetOpenOrdersRequest) GetParametersQuery() (url.Values, error)
- func (g *GetOpenOrdersRequest) GetQueryParameters() (url.Values, error)
- func (g *GetOpenOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetOpenOrdersRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetOpenOrdersRequest) Market(market string) *GetOpenOrdersRequest
- type GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) Do(ctx context.Context) ([]Order, error)
- func (g *GetOrderHistoryRequest) EndTime(endTime time.Time) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetOrderHistoryRequest) GetParametersJSON() ([]byte, error)
- func (g *GetOrderHistoryRequest) GetParametersQuery() (url.Values, error)
- func (g *GetOrderHistoryRequest) GetQueryParameters() (url.Values, error)
- func (g *GetOrderHistoryRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetOrderHistoryRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetOrderHistoryRequest) Market(market string) *GetOrderHistoryRequest
- func (g *GetOrderHistoryRequest) StartTime(startTime time.Time) *GetOrderHistoryRequest
- type GetOrderStatusRequest
- func (g *GetOrderStatusRequest) Do(ctx context.Context) (*Order, error)
- func (g *GetOrderStatusRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetOrderStatusRequest) GetParametersJSON() ([]byte, error)
- func (g *GetOrderStatusRequest) GetParametersQuery() (url.Values, error)
- func (g *GetOrderStatusRequest) GetQueryParameters() (url.Values, error)
- func (g *GetOrderStatusRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetOrderStatusRequest) GetSlugsMap() (map[string]string, error)
- func (g *GetOrderStatusRequest) OrderID(orderID uint64) *GetOrderStatusRequest
- type GetPositionsRequest
- func (g *GetPositionsRequest) Do(ctx context.Context) ([]Position, error)
- func (g *GetPositionsRequest) GetParameters() (map[string]interface{}, error)
- func (g *GetPositionsRequest) GetParametersJSON() ([]byte, error)
- func (g *GetPositionsRequest) GetParametersQuery() (url.Values, error)
- func (g *GetPositionsRequest) GetQueryParameters() (url.Values, error)
- func (g *GetPositionsRequest) GetSlugParameters() (map[string]interface{}, error)
- func (g *GetPositionsRequest) GetSlugsMap() (map[string]string, error)
- type Liquidity
- type Market
- type Order
- type OrderStatus
- type OrderType
- type PlaceOrderRequest
- func (p *PlaceOrderRequest) ClientID(clientID string) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Do(ctx context.Context) (*Order, error)
- func (p *PlaceOrderRequest) GetParameters() (map[string]interface{}, error)
- func (p *PlaceOrderRequest) GetParametersJSON() ([]byte, error)
- func (p *PlaceOrderRequest) GetParametersQuery() (url.Values, error)
- func (p *PlaceOrderRequest) GetQueryParameters() (url.Values, error)
- func (p *PlaceOrderRequest) GetSlugParameters() (map[string]interface{}, error)
- func (p *PlaceOrderRequest) GetSlugsMap() (map[string]string, error)
- func (p *PlaceOrderRequest) Ioc(ioc bool) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Market(market string) *PlaceOrderRequest
- func (p *PlaceOrderRequest) OrderType(orderType OrderType) *PlaceOrderRequest
- func (p *PlaceOrderRequest) PostOnly(postOnly bool) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Price(price fixedpoint.Value) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Side(side Side) *PlaceOrderRequest
- func (p *PlaceOrderRequest) Size(size fixedpoint.Value) *PlaceOrderRequest
- type Position
- type RestClient
- func (c *RestClient) Auth(key, secret, subAccount string)
- func (c *RestClient) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, ...) (*http.Request, error)
- func (c *RestClient) NewCancelAllOrderRequest() *CancelAllOrderRequest
- func (c *RestClient) NewCancelOrderByClientOrderIdRequest(clientOrderId string) *CancelOrderByClientOrderIdRequest
- func (c *RestClient) NewCancelOrderRequest(orderID string) *CancelOrderRequest
- func (c *RestClient) NewGetAccountRequest() *GetAccountRequest
- func (c *RestClient) NewGetBalancesRequest() *GetBalancesRequest
- func (c *RestClient) NewGetCoinsRequest() *GetCoinsRequest
- func (c *RestClient) NewGetFillsRequest() *GetFillsRequest
- func (c *RestClient) NewGetMarketRequest(market string) *GetMarketRequest
- func (c *RestClient) NewGetMarketsRequest() *GetMarketsRequest
- func (c *RestClient) NewGetOpenOrdersRequest(market string) *GetOpenOrdersRequest
- func (c *RestClient) NewGetOrderHistoryRequest(market string) *GetOrderHistoryRequest
- func (c *RestClient) NewGetOrderStatusRequest(orderID uint64) *GetOrderStatusRequest
- func (c *RestClient) NewGetPositionsRequest() *GetPositionsRequest
- func (c *RestClient) NewPlaceOrderRequest() *PlaceOrderRequest
- func (c *RestClient) NewRequest(ctx context.Context, method, refURL string, params url.Values, ...) (*http.Request, error)
- func (c *RestClient) SendRequest(req *http.Request) (*requestgen.Response, error)
- type Side
Constants ¶
const RestBaseURL = "https://ftx.com/api"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIResponse ¶
type APIResponse struct { Success bool `json:"success"` Result json.RawMessage `json:"result,omitempty"` HasMoreData bool `json:"hasMoreData,omitempty"` }
type Account ¶
type Account struct { BackstopProvider bool `json:"backstopProvider"` Collateral fixedpoint.Value `json:"collateral"` FreeCollateral fixedpoint.Value `json:"freeCollateral"` Leverage fixedpoint.Value `json:"leverage"` InitialMarginRequirement fixedpoint.Value `json:"initialMarginRequirement"` MaintenanceMarginRequirement fixedpoint.Value `json:"maintenanceMarginRequirement"` Liquidating bool `json:"liquidating"` MakerFee fixedpoint.Value `json:"makerFee"` MarginFraction fixedpoint.Value `json:"marginFraction"` OpenMarginFraction fixedpoint.Value `json:"openMarginFraction"` TakerFee fixedpoint.Value `json:"takerFee"` TotalAccountValue fixedpoint.Value `json:"totalAccountValue"` TotalPositionSize fixedpoint.Value `json:"totalPositionSize"` Username string `json:"username"` Positions []Position `json:"positions"` }
type Balance ¶
type Balance struct { Coin string `json:"coin"` Free fixedpoint.Value `json:"free"` SpotBorrow fixedpoint.Value `json:"spotBorrow"` Total fixedpoint.Value `json:"total"` UsdValue fixedpoint.Value `json:"usdValue"` AvailableWithoutBorrow fixedpoint.Value `json:"availableWithoutBorrow"` }
type CancelAllOrderRequest ¶
type CancelAllOrderRequest struct {
// contains filtered or unexported fields
}
func (*CancelAllOrderRequest) Do ¶
func (c *CancelAllOrderRequest) Do(ctx context.Context) (*APIResponse, error)
func (*CancelAllOrderRequest) GetParameters ¶
func (c *CancelAllOrderRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*CancelAllOrderRequest) GetParametersJSON ¶
func (c *CancelAllOrderRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*CancelAllOrderRequest) GetParametersQuery ¶
func (c *CancelAllOrderRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*CancelAllOrderRequest) GetQueryParameters ¶
func (c *CancelAllOrderRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*CancelAllOrderRequest) GetSlugParameters ¶
func (c *CancelAllOrderRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*CancelAllOrderRequest) GetSlugsMap ¶
func (c *CancelAllOrderRequest) GetSlugsMap() (map[string]string, error)
func (*CancelAllOrderRequest) Market ¶
func (c *CancelAllOrderRequest) Market(market string) *CancelAllOrderRequest
type CancelOrderByClientOrderIdRequest ¶
type CancelOrderByClientOrderIdRequest struct {
// contains filtered or unexported fields
}
func (*CancelOrderByClientOrderIdRequest) ClientOrderId ¶
func (c *CancelOrderByClientOrderIdRequest) ClientOrderId(clientOrderId string) *CancelOrderByClientOrderIdRequest
func (*CancelOrderByClientOrderIdRequest) Do ¶
func (c *CancelOrderByClientOrderIdRequest) Do(ctx context.Context) (*APIResponse, error)
func (*CancelOrderByClientOrderIdRequest) GetParameters ¶
func (c *CancelOrderByClientOrderIdRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*CancelOrderByClientOrderIdRequest) GetParametersJSON ¶
func (c *CancelOrderByClientOrderIdRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*CancelOrderByClientOrderIdRequest) GetParametersQuery ¶
func (c *CancelOrderByClientOrderIdRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*CancelOrderByClientOrderIdRequest) GetQueryParameters ¶
func (c *CancelOrderByClientOrderIdRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*CancelOrderByClientOrderIdRequest) GetSlugParameters ¶
func (c *CancelOrderByClientOrderIdRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*CancelOrderByClientOrderIdRequest) GetSlugsMap ¶
func (c *CancelOrderByClientOrderIdRequest) GetSlugsMap() (map[string]string, error)
type CancelOrderRequest ¶
type CancelOrderRequest struct {
// contains filtered or unexported fields
}
func (*CancelOrderRequest) Do ¶
func (c *CancelOrderRequest) Do(ctx context.Context) (*APIResponse, error)
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) 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
type Coin ¶
type Coin struct { Bep2Asset *string `json:"bep2Asset"` CanConvert bool `json:"canConvert"` CanDeposit bool `json:"canDeposit"` CanWithdraw bool `json:"canWithdraw"` Collateral bool `json:"collateral"` CollateralWeight fixedpoint.Value `json:"collateralWeight"` CreditTo *string `json:"creditTo"` Erc20Contract string `json:"erc20Contract"` Fiat bool `json:"fiat"` HasTag bool `json:"hasTag"` Id string `json:"id"` IsToken bool `json:"isToken"` Methods []string `json:"methods"` Name string `json:"name"` SplMint string `json:"splMint"` Trc20Contract string `json:"trc20Contract"` UsdFungible bool `json:"usdFungible"` }
type Fill ¶
type Fill struct { // Id is fill ID Id uint64 `json:"id"` Future string `json:"future"` Liquidity Liquidity `json:"liquidity"` Market string `json:"market"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` OrderId uint64 `json:"orderId"` TradeId uint64 `json:"tradeId"` Price fixedpoint.Value `json:"price"` Side Side `json:"side"` Size fixedpoint.Value `json:"size"` Time time.Time `json:"time"` Type string `json:"type"` // always = "order" Fee fixedpoint.Value `json:"fee"` FeeCurrency string `json:"feeCurrency"` FeeRate fixedpoint.Value `json:"feeRate"` }
type GetAccountRequest ¶
type GetAccountRequest struct {
// contains filtered or unexported fields
}
func (*GetAccountRequest) Do ¶
func (g *GetAccountRequest) Do(ctx context.Context) (*Account, error)
func (*GetAccountRequest) GetParameters ¶
func (g *GetAccountRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetAccountRequest) GetParametersJSON ¶
func (g *GetAccountRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetAccountRequest) GetParametersQuery ¶
func (g *GetAccountRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetAccountRequest) GetQueryParameters ¶
func (g *GetAccountRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetAccountRequest) GetSlugParameters ¶
func (g *GetAccountRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetAccountRequest) GetSlugsMap ¶
func (g *GetAccountRequest) GetSlugsMap() (map[string]string, error)
type GetBalancesRequest ¶
type GetBalancesRequest struct {
// contains filtered or unexported fields
}
func (*GetBalancesRequest) Do ¶
func (g *GetBalancesRequest) Do(ctx context.Context) ([]Balance, error)
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) 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 GetCoinsRequest ¶
type GetCoinsRequest struct {
// contains filtered or unexported fields
}
func (*GetCoinsRequest) GetParameters ¶
func (g *GetCoinsRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetCoinsRequest) GetParametersJSON ¶
func (g *GetCoinsRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetCoinsRequest) GetParametersQuery ¶
func (g *GetCoinsRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetCoinsRequest) GetQueryParameters ¶
func (g *GetCoinsRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetCoinsRequest) GetSlugParameters ¶
func (g *GetCoinsRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetCoinsRequest) GetSlugsMap ¶
func (g *GetCoinsRequest) GetSlugsMap() (map[string]string, error)
type GetFillsRequest ¶
type GetFillsRequest struct {
// contains filtered or unexported fields
}
func (*GetFillsRequest) EndTime ¶
func (g *GetFillsRequest) EndTime(endTime time.Time) *GetFillsRequest
func (*GetFillsRequest) GetParameters ¶
func (g *GetFillsRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetFillsRequest) GetParametersJSON ¶
func (g *GetFillsRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetFillsRequest) GetParametersQuery ¶
func (g *GetFillsRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetFillsRequest) GetQueryParameters ¶
func (g *GetFillsRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetFillsRequest) GetSlugParameters ¶
func (g *GetFillsRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetFillsRequest) GetSlugsMap ¶
func (g *GetFillsRequest) GetSlugsMap() (map[string]string, error)
func (*GetFillsRequest) Market ¶
func (g *GetFillsRequest) Market(market string) *GetFillsRequest
func (*GetFillsRequest) Order ¶
func (g *GetFillsRequest) Order(order string) *GetFillsRequest
func (*GetFillsRequest) OrderID ¶
func (g *GetFillsRequest) OrderID(orderID int) *GetFillsRequest
func (*GetFillsRequest) StartTime ¶
func (g *GetFillsRequest) StartTime(startTime time.Time) *GetFillsRequest
type GetMarketRequest ¶
type GetMarketRequest struct {
// contains filtered or unexported fields
}
func (*GetMarketRequest) GetParameters ¶
func (g *GetMarketRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetMarketRequest) GetParametersJSON ¶
func (g *GetMarketRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetMarketRequest) GetParametersQuery ¶
func (g *GetMarketRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetMarketRequest) GetQueryParameters ¶
func (g *GetMarketRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetMarketRequest) GetSlugParameters ¶
func (g *GetMarketRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetMarketRequest) GetSlugsMap ¶
func (g *GetMarketRequest) GetSlugsMap() (map[string]string, error)
func (*GetMarketRequest) Market ¶
func (g *GetMarketRequest) Market(market string) *GetMarketRequest
type GetMarketsRequest ¶
type GetMarketsRequest struct {
// contains filtered or unexported fields
}
func (*GetMarketsRequest) Do ¶
func (g *GetMarketsRequest) Do(ctx context.Context) ([]Market, error)
func (*GetMarketsRequest) GetParameters ¶
func (g *GetMarketsRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetMarketsRequest) GetParametersJSON ¶
func (g *GetMarketsRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetMarketsRequest) GetParametersQuery ¶
func (g *GetMarketsRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetMarketsRequest) GetQueryParameters ¶
func (g *GetMarketsRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetMarketsRequest) GetSlugParameters ¶
func (g *GetMarketsRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetMarketsRequest) GetSlugsMap ¶
func (g *GetMarketsRequest) GetSlugsMap() (map[string]string, error)
type GetOpenOrdersRequest ¶
type GetOpenOrdersRequest struct {
// contains filtered or unexported fields
}
func (*GetOpenOrdersRequest) Do ¶
func (g *GetOpenOrdersRequest) Do(ctx context.Context) ([]Order, error)
func (*GetOpenOrdersRequest) GetParameters ¶
func (g *GetOpenOrdersRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetOpenOrdersRequest) GetParametersJSON ¶
func (g *GetOpenOrdersRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetOpenOrdersRequest) GetParametersQuery ¶
func (g *GetOpenOrdersRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetOpenOrdersRequest) GetQueryParameters ¶
func (g *GetOpenOrdersRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetOpenOrdersRequest) GetSlugParameters ¶
func (g *GetOpenOrdersRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetOpenOrdersRequest) GetSlugsMap ¶
func (g *GetOpenOrdersRequest) GetSlugsMap() (map[string]string, error)
func (*GetOpenOrdersRequest) Market ¶
func (g *GetOpenOrdersRequest) Market(market string) *GetOpenOrdersRequest
type GetOrderHistoryRequest ¶
type GetOrderHistoryRequest struct {
// contains filtered or unexported fields
}
func (*GetOrderHistoryRequest) Do ¶
func (g *GetOrderHistoryRequest) Do(ctx context.Context) ([]Order, error)
func (*GetOrderHistoryRequest) EndTime ¶
func (g *GetOrderHistoryRequest) EndTime(endTime time.Time) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) GetParameters ¶
func (g *GetOrderHistoryRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetOrderHistoryRequest) GetParametersJSON ¶
func (g *GetOrderHistoryRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetOrderHistoryRequest) GetParametersQuery ¶
func (g *GetOrderHistoryRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetOrderHistoryRequest) GetQueryParameters ¶
func (g *GetOrderHistoryRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetOrderHistoryRequest) GetSlugParameters ¶
func (g *GetOrderHistoryRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetOrderHistoryRequest) GetSlugsMap ¶
func (g *GetOrderHistoryRequest) GetSlugsMap() (map[string]string, error)
func (*GetOrderHistoryRequest) Market ¶
func (g *GetOrderHistoryRequest) Market(market string) *GetOrderHistoryRequest
func (*GetOrderHistoryRequest) StartTime ¶
func (g *GetOrderHistoryRequest) StartTime(startTime time.Time) *GetOrderHistoryRequest
type GetOrderStatusRequest ¶
type GetOrderStatusRequest struct {
// contains filtered or unexported fields
}
func (*GetOrderStatusRequest) Do ¶
func (g *GetOrderStatusRequest) Do(ctx context.Context) (*Order, error)
func (*GetOrderStatusRequest) GetParameters ¶
func (g *GetOrderStatusRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetOrderStatusRequest) GetParametersJSON ¶
func (g *GetOrderStatusRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetOrderStatusRequest) GetParametersQuery ¶
func (g *GetOrderStatusRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetOrderStatusRequest) GetQueryParameters ¶
func (g *GetOrderStatusRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetOrderStatusRequest) GetSlugParameters ¶
func (g *GetOrderStatusRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetOrderStatusRequest) GetSlugsMap ¶
func (g *GetOrderStatusRequest) GetSlugsMap() (map[string]string, error)
func (*GetOrderStatusRequest) OrderID ¶
func (g *GetOrderStatusRequest) OrderID(orderID uint64) *GetOrderStatusRequest
type GetPositionsRequest ¶
type GetPositionsRequest struct {
// contains filtered or unexported fields
}
func (*GetPositionsRequest) Do ¶
func (g *GetPositionsRequest) Do(ctx context.Context) ([]Position, error)
func (*GetPositionsRequest) GetParameters ¶
func (g *GetPositionsRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*GetPositionsRequest) GetParametersJSON ¶
func (g *GetPositionsRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*GetPositionsRequest) GetParametersQuery ¶
func (g *GetPositionsRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*GetPositionsRequest) GetQueryParameters ¶
func (g *GetPositionsRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*GetPositionsRequest) GetSlugParameters ¶
func (g *GetPositionsRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*GetPositionsRequest) GetSlugsMap ¶
func (g *GetPositionsRequest) GetSlugsMap() (map[string]string, error)
type Market ¶
type Market struct { Name string `json:"name"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` QuoteVolume24H fixedpoint.Value `json:"quoteVolume24h"` Change1H fixedpoint.Value `json:"change1h"` Change24H fixedpoint.Value `json:"change24h"` ChangeBod fixedpoint.Value `json:"changeBod"` VolumeUsd24H fixedpoint.Value `json:"volumeUsd24h"` HighLeverageFeeExempt bool `json:"highLeverageFeeExempt"` MinProvideSize fixedpoint.Value `json:"minProvideSize"` Type string `json:"type"` Underlying string `json:"underlying"` Enabled bool `json:"enabled"` Ask fixedpoint.Value `json:"ask"` Bid fixedpoint.Value `json:"bid"` Last fixedpoint.Value `json:"last"` PostOnly bool `json:"postOnly"` Price fixedpoint.Value `json:"price"` PriceIncrement fixedpoint.Value `json:"priceIncrement"` SizeIncrement fixedpoint.Value `json:"sizeIncrement"` Restricted bool `json:"restricted"` }
type Order ¶
type Order struct { CreatedAt time.Time `json:"createdAt"` Future string `json:"future"` Id int64 `json:"id"` Market string `json:"market"` Price fixedpoint.Value `json:"price"` AvgFillPrice fixedpoint.Value `json:"avgFillPrice"` Size fixedpoint.Value `json:"size"` RemainingSize fixedpoint.Value `json:"remainingSize"` FilledSize fixedpoint.Value `json:"filledSize"` Side Side `json:"side"` Status OrderStatus `json:"status"` Type OrderType `json:"type"` ReduceOnly bool `json:"reduceOnly"` Ioc bool `json:"ioc"` PostOnly bool `json:"postOnly"` ClientId string `json:"clientId"` }
type OrderStatus ¶
type OrderStatus string
const ( OrderStatusNew OrderStatus = "new" OrderStatusOpen OrderStatus = "open" OrderStatusClosed OrderStatus = "closed" )
type PlaceOrderRequest ¶
type PlaceOrderRequest struct {
// contains filtered or unexported fields
}
func (*PlaceOrderRequest) ClientID ¶
func (p *PlaceOrderRequest) ClientID(clientID string) *PlaceOrderRequest
func (*PlaceOrderRequest) GetParameters ¶
func (p *PlaceOrderRequest) GetParameters() (map[string]interface{}, error)
GetParameters builds and checks the parameters and return the result in a map object
func (*PlaceOrderRequest) GetParametersJSON ¶
func (p *PlaceOrderRequest) GetParametersJSON() ([]byte, error)
GetParametersJSON converts the parameters from GetParameters into the JSON format
func (*PlaceOrderRequest) GetParametersQuery ¶
func (p *PlaceOrderRequest) GetParametersQuery() (url.Values, error)
GetParametersQuery converts the parameters from GetParameters into the url.Values format
func (*PlaceOrderRequest) GetQueryParameters ¶
func (p *PlaceOrderRequest) GetQueryParameters() (url.Values, error)
GetQueryParameters builds and checks the query parameters and returns url.Values
func (*PlaceOrderRequest) GetSlugParameters ¶
func (p *PlaceOrderRequest) GetSlugParameters() (map[string]interface{}, error)
GetSlugParameters builds and checks the slug parameters and return the result in a map object
func (*PlaceOrderRequest) GetSlugsMap ¶
func (p *PlaceOrderRequest) GetSlugsMap() (map[string]string, error)
func (*PlaceOrderRequest) Ioc ¶
func (p *PlaceOrderRequest) Ioc(ioc bool) *PlaceOrderRequest
func (*PlaceOrderRequest) Market ¶
func (p *PlaceOrderRequest) Market(market string) *PlaceOrderRequest
func (*PlaceOrderRequest) OrderType ¶
func (p *PlaceOrderRequest) OrderType(orderType OrderType) *PlaceOrderRequest
func (*PlaceOrderRequest) PostOnly ¶
func (p *PlaceOrderRequest) PostOnly(postOnly bool) *PlaceOrderRequest
func (*PlaceOrderRequest) Price ¶
func (p *PlaceOrderRequest) Price(price fixedpoint.Value) *PlaceOrderRequest
func (*PlaceOrderRequest) Side ¶
func (p *PlaceOrderRequest) Side(side Side) *PlaceOrderRequest
func (*PlaceOrderRequest) Size ¶
func (p *PlaceOrderRequest) Size(size fixedpoint.Value) *PlaceOrderRequest
type Position ¶
type Position struct { Cost fixedpoint.Value `json:"cost"` EntryPrice fixedpoint.Value `json:"entryPrice"` Future string `json:"future"` InitialMarginRequirement fixedpoint.Value `json:"initialMarginRequirement"` LongOrderSize fixedpoint.Value `json:"longOrderSize"` MaintenanceMarginRequirement fixedpoint.Value `json:"maintenanceMarginRequirement"` NetSize fixedpoint.Value `json:"netSize"` OpenSize fixedpoint.Value `json:"openSize"` ShortOrderSize fixedpoint.Value `json:"shortOrderSize"` Side string `json:"side"` Size fixedpoint.Value `json:"size"` RealizedPnl fixedpoint.Value `json:"realizedPnl"` UnrealizedPnl fixedpoint.Value `json:"unrealizedPnl"` }
type RestClient ¶
type RestClient struct { BaseURL *url.URL Key, Secret string // contains filtered or unexported fields }
func NewClient ¶
func NewClient() *RestClient
func (*RestClient) Auth ¶
func (c *RestClient) Auth(key, secret, subAccount string)
func (*RestClient) NewAuthenticatedRequest ¶
func (c *RestClient) NewAuthenticatedRequest(ctx context.Context, method, refURL string, params url.Values, payload interface{}) (*http.Request, error)
newAuthenticatedRequest creates new http request for authenticated routes.
func (*RestClient) NewCancelAllOrderRequest ¶
func (c *RestClient) NewCancelAllOrderRequest() *CancelAllOrderRequest
func (*RestClient) NewCancelOrderByClientOrderIdRequest ¶
func (c *RestClient) NewCancelOrderByClientOrderIdRequest(clientOrderId string) *CancelOrderByClientOrderIdRequest
func (*RestClient) NewCancelOrderRequest ¶
func (c *RestClient) NewCancelOrderRequest(orderID string) *CancelOrderRequest
func (*RestClient) NewGetAccountRequest ¶
func (c *RestClient) NewGetAccountRequest() *GetAccountRequest
func (*RestClient) NewGetBalancesRequest ¶
func (c *RestClient) NewGetBalancesRequest() *GetBalancesRequest
func (*RestClient) NewGetCoinsRequest ¶
func (c *RestClient) NewGetCoinsRequest() *GetCoinsRequest
func (*RestClient) NewGetFillsRequest ¶
func (c *RestClient) NewGetFillsRequest() *GetFillsRequest
func (*RestClient) NewGetMarketRequest ¶
func (c *RestClient) NewGetMarketRequest(market string) *GetMarketRequest
func (*RestClient) NewGetMarketsRequest ¶
func (c *RestClient) NewGetMarketsRequest() *GetMarketsRequest
func (*RestClient) NewGetOpenOrdersRequest ¶
func (c *RestClient) NewGetOpenOrdersRequest(market string) *GetOpenOrdersRequest
func (*RestClient) NewGetOrderHistoryRequest ¶
func (c *RestClient) NewGetOrderHistoryRequest(market string) *GetOrderHistoryRequest
func (*RestClient) NewGetOrderStatusRequest ¶
func (c *RestClient) NewGetOrderStatusRequest(orderID uint64) *GetOrderStatusRequest
func (*RestClient) NewGetPositionsRequest ¶
func (c *RestClient) NewGetPositionsRequest() *GetPositionsRequest
func (*RestClient) NewPlaceOrderRequest ¶
func (c *RestClient) NewPlaceOrderRequest() *PlaceOrderRequest
func (*RestClient) NewRequest ¶
func (c *RestClient) NewRequest(ctx context.Context, method, refURL string, params url.Values, payload interface{}) (*http.Request, error)
NewRequest create new API request. Relative url can be provided in refURL.
func (*RestClient) SendRequest ¶
func (c *RestClient) SendRequest(req *http.Request) (*requestgen.Response, error)
sendRequest sends the request to the API server and handle the response
Source Files ¶
- account.go
- cancel_all_order_request_requestgen.go
- cancel_order_by_client_order_id_request_requestgen.go
- cancel_order_request_requestgen.go
- client.go
- coin.go
- get_account_request_requestgen.go
- get_balances_request_requestgen.go
- get_coins_request_requestgen.go
- get_fills_request_requestgen.go
- get_market_request_requestgen.go
- get_markets_request_requestgen.go
- get_open_orders_request_requestgen.go
- get_order_history_request_requestgen.go
- get_order_status_request_requestgen.go
- get_positions_request_requestgen.go
- market.go
- place_order_request_requestgen.go
- trade.go
- types.go