adv

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

README

Advanced Trade Go SDK README

GoDoc Go Report Card

Overview

The Advanced Trade Go SDK is a sample library that demonstrates the structure of a Coinbase Advanced Trade driver for the REST APIs.

License

The Advanced Trade Go SDK sample library is free and open source and released under the Apache License, Version 2.0.

The application and code are only available for demonstration purposes.

Usage

To use the Advanced Trade Go SDK, initialize the Credentials struct and create a new client. The Credentials struct is JSON enabled. Ensure that Advanced Trade API credentials are stored in a secure manner.

credentials := &adv.Credentials{}
if err := json.Unmarshal([]byte(os.Getenv("ADV_CREDENTIALS")), credentials); err != nil {
    return nil, fmt.Errorf("unable to deserialize advanced trade credentials JSON: %w", err)
}

client := adv.NewClient(credentials, http.Client{})

There are convenience functions to read the credentials as an environment variable (adv.ReadEnvCredentials) and to deserialize the JSON structure (adv.UnmarshalCredentials) if pulled from a different source. The JSON format expected by both is:

{
  "accessKey": "",
  "privatePemKey": "",
}

Coinbase Advanced Trade API credentials can be created in the CDP web portal.

Once the client is initialized, make the desired call. For example, to list portfolios, pass in the request object, check for an error, and if nil, process the response.

response, err := client.ListPortfolios(ctx, &adv.ListPortfoliosRequest{})

Build

To build the sample library, ensure that Go 1.19+ is installed and then run:

go build *.go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Uuid              string `json:"uuid"`
	Name              string `json:"name"`
	Currency          string `json:"currency"`
	AvailableBalance  Amount `json:"available_balance"`
	Default           bool   `json:"default"`
	Active            bool   `json:"active"`
	CreatedAt         string `json:"created_at"`
	UpdatedAt         string `json:"updated_at"`
	DeletedAt         string `json:"deleted_at"`
	Type              string `json:"type"`
	Ready             bool   `json:"ready"`
	Hold              Amount `json:"hold"`
	RetailPortfolioId string `json:"retail_portfolio_id"`
}

type AllocatePortfolioRequest

type AllocatePortfolioRequest struct {
	PortfolioUuid string `json:"portfolio_uuid"`
	Symbol        string `json:"string"`
	Amount        string `json:"amount"`
	Currency      string `json:"currency"`
}

type AllocatePortfolioResponse

type AllocatePortfolioResponse struct {
	Description string                    `json:"description"`
	Schema      *Schema                   `json:"schema"`
	Request     *AllocatePortfolioRequest `json:"request"`
}

type Amount

type Amount struct {
	Value    string `json:"value"`
	Currency string `json:"currency"`
}

type BalanceSummary

type BalanceSummary struct {
	FuturesBuyingPower          Amount `json:"futures_buying_power"`
	TotalUsdBalance             Amount `json:"total_usd_balance"`
	CbiUsdBalance               Amount `json:"cbi_usd_balance"`
	CfmUsdBalance               Amount `json:"cfm_usd_balance"`
	TotalOpenOrdersHoldAmount   Amount `json:"total_open_orders_hold_amount"`
	UnrealizedPnl               Amount `json:"unrealized_pnl"`
	DailyRealizedPnl            Amount `json:"daily_realized_pnl"`
	InitialMargin               Amount `json:"initial_margin"`
	AvailableMargin             Amount `json:"available_margin"`
	LiquidationThreshold        Amount `json:"liquidation_threshold"`
	LiquidationBufferAmount     Amount `json:"liquidation_buffer_amount"`
	LiquidationBufferPercentage string `json:"liquidation_buffer_percentage"`
}

type Breakdown

type Breakdown struct {
	Portfolio         Portfolio         `json:"portfolio"`
	PortfolioBalances PortfolioBalances `json:"portfolio_balances"`
	SpotPositions     []SpotPosition    `json:"spot_positions"`
	PerpPositions     []PerpPosition    `json:"perp_positions"`
	FuturesPositions  []FuturesPosition `json:"futures_positions"`
}

type BreakdownResponse

type BreakdownResponse struct {
	Breakdown Breakdown `json:"breakdown"`
}

type CancelOrdersRequest

type CancelOrdersRequest struct {
	OrderIds []string `json:"order_ids"`
}

type CancelOrdersResponse

type CancelOrdersResponse struct {
	Results []*CancelResult      `json:"results"`
	Request *CancelOrdersRequest `json:"request"`
}

type CancelPendingFuturesSweepsRequest

type CancelPendingFuturesSweepsRequest struct{}

type CancelPendingFuturesSweepsResponse

type CancelPendingFuturesSweepsResponse struct {
	Success bool                               `json:"success"`
	Request *CancelPendingFuturesSweepsRequest `json:"request"`
}

type CancelResult

type CancelResult struct {
	Success       bool   `json:"success"`
	FailureReason string `json:"failure_reason"`
	OrderId       string `json:"order_id"`
}

type Candle

type Candle struct {
	Start  string `json:"start"`
	Low    string `json:"low"`
	High   string `json:"high"`
	Open   string `json:"open"`
	Close  string `json:"close"`
	Volume string `json:"volume"`
}

type CfmFuturesPosition

type CfmFuturesPosition struct {
	ProductId         string `json:"product_id"`
	ExpirationTime    string `json:"expiration_time"`
	Side              string `json:"side"`
	NumberOfContracts string `json:"number_of_contracts"`
	CurrentPrice      string `json:"current_price"`
	AvgEntryPrice     string `json:"avg_entry_price"`
	UnrealizedPnl     string `json:"unrealized_pnl"`
	DailyRealizedPnl  string `json:"daily_realized_pnl"`
}

type Client

type Client struct {
	HttpClient  http.Client
	Credentials *Credentials
	HttpBaseUrl string
}

func NewClient

func NewClient(credentials *Credentials, httpClient http.Client) *Client

func (Client) AllocatePortfolio

func (c Client) AllocatePortfolio(
	ctx context.Context,
	request *AllocatePortfolioRequest,
) (*AllocatePortfolioResponse, error)

func (*Client) BaseUrl

func (c *Client) BaseUrl(u string) *Client

func (Client) CancelOrders

func (c Client) CancelOrders(
	ctx context.Context,
	request *CancelOrdersRequest,
) (*CancelOrdersResponse, error)

func (Client) CancelPendingFuturesSweeps

func (c Client) CancelPendingFuturesSweeps(
	ctx context.Context,
	request *CancelPendingFuturesSweepsRequest,
) (*CancelPendingFuturesSweepsResponse, error)

func (Client) ClosePosition

func (c Client) ClosePosition(
	ctx context.Context,
	request *ClosePositionRequest,
) (*ClosePositionResponse, error)

func (Client) CommitConvertQuote

func (c Client) CommitConvertQuote(
	ctx context.Context,
	request *CommitConvertQuoteRequest,
) (*CommitConvertQuoteResponse, error)

func (Client) CreateConvertQuote

func (c Client) CreateConvertQuote(
	ctx context.Context,
	request *CreateConvertQuoteRequest,
) (*CreateConvertQuoteResponse, error)

func (Client) CreateOrder

func (c Client) CreateOrder(
	ctx context.Context,
	request *CreateOrderRequest,
) (*CreateOrderResponse, error)

func (Client) CreateOrderPreview

func (c Client) CreateOrderPreview(
	ctx context.Context,
	request *CreateOrderPreviewRequest,
) (*CreateOrderPreviewResponse, error)

func (Client) CreatePortfolio

func (c Client) CreatePortfolio(
	ctx context.Context,
	request *CreatePortfolioRequest,
) (*CreatePortfolioResponse, error)

func (Client) DeletePortfolio

func (c Client) DeletePortfolio(
	ctx context.Context,
	request *DeletePortfolioRequest,
) (*DeletePortfolioResponse, error)

func (Client) EditOrder

func (c Client) EditOrder(
	ctx context.Context,
	request *EditOrderRequest,
) (*EditOrderResponse, error)

func (Client) EditPortfolio

func (c Client) EditPortfolio(
	ctx context.Context,
	request *EditPortfolioRequest,
) (*EditPortfolioResponse, error)

func (Client) GetAccount

func (c Client) GetAccount(
	ctx context.Context,
	request *GetAccountRequest,
) (*GetAccountResponse, error)

func (Client) GetBestBidAsk

func (c Client) GetBestBidAsk(
	ctx context.Context,
	request *GetBestBidAskRequest,
) (*GetBestBidAskResponse, error)

func (Client) GetConvertTrade

func (c Client) GetConvertTrade(
	ctx context.Context,
	request *GetConvertTradeRequest,
) (*GetConvertTradeResponse, error)

func (Client) GetFuturesBalanceSummary

func (c Client) GetFuturesBalanceSummary(
	ctx context.Context,
	request *GetFuturesBalanceSummaryRequest,
) (*GetFuturesBalanceSummaryResponse, error)

func (Client) GetFuturesPosition

func (c Client) GetFuturesPosition(
	ctx context.Context,
	request *GetFuturesPositionRequest,
) (*GetFuturesPositionResponse, error)

func (Client) GetMarketTrades

func (c Client) GetMarketTrades(
	ctx context.Context,
	request *GetMarketTradesRequest,
) (*GetMarketTradesResponse, error)

func (Client) GetOrder

func (c Client) GetOrder(
	ctx context.Context,
	request *GetOrderRequest,
) (*GetOrderResponse, error)

func (Client) GetPaymentMethod

func (c Client) GetPaymentMethod(
	ctx context.Context,
	request *GetPaymentMethodRequest,
) (*GetPaymentMethodResponse, error)

func (Client) GetPerpetualsPosition

func (c Client) GetPerpetualsPosition(
	ctx context.Context,
	request *GetPerpetualsPositionRequest,
) (*GetPerpetualsPositionResponse, error)

func (Client) GetPortfolioBreakdown

func (c Client) GetPortfolioBreakdown(
	ctx context.Context,
	request *GetPortfolioBreakdownRequest,
) (*GetPortfolioBreakdownResponse, error)

func (Client) GetProduct

func (c Client) GetProduct(
	ctx context.Context,
	request *GetProductRequest,
) (*GetProductResponse, error)

func (Client) GetProductBook

func (c Client) GetProductBook(
	ctx context.Context,
	request *GetProductBookRequest,
) (*GetProductBookResponse, error)

func (Client) GetProductCandles

func (c Client) GetProductCandles(
	ctx context.Context,
	request *GetProductCandlesRequest,
) (*GetProductCandlesResponse, error)

func (Client) GetPublicMarketTrades

func (c Client) GetPublicMarketTrades(
	ctx context.Context,
	request *GetPublicMarketTradesRequest,
) (*GetPublicMarketTradesResponse, error)

func (Client) GetPublicProduct

func (c Client) GetPublicProduct(
	ctx context.Context,
	request *GetPublicProductRequest,
) (*GetPublicProductResponse, error)

func (Client) GetPublicProductBook

func (c Client) GetPublicProductBook(
	ctx context.Context,
	request *GetPublicProductBookRequest,
) (*GetPublicProductBookResponse, error)

func (Client) GetPublicProductCandles

func (c Client) GetPublicProductCandles(
	ctx context.Context,
	request *GetPublicProductCandlesRequest,
) (*GetPublicProductCandlesResponse, error)

func (Client) GetServerTime

func (c Client) GetServerTime(
	ctx context.Context,
	request *GetServerTimeRequest,
) (*GetServerTimeResponse, error)

func (Client) GetTransactionsSummary

func (c Client) GetTransactionsSummary(
	ctx context.Context,
	request *GetTransactionsSummaryRequest,
) (*GetTransactionsSummaryResponse, error)

func (Client) ListAccounts

func (c Client) ListAccounts(
	ctx context.Context,
	request *ListAccountsRequest,
) (*ListAccountsResponse, error)

func (Client) ListFills

func (c Client) ListFills(
	ctx context.Context,
	request *ListFillsRequest,
) (*ListFillsResponse, error)

func (Client) ListFuturesPositions

func (c Client) ListFuturesPositions(
	ctx context.Context,
	request *ListFuturesPositionsRequest,
) (*ListFuturesPositionsResponse, error)

func (Client) ListFuturesSweeps

func (c Client) ListFuturesSweeps(
	ctx context.Context,
	request *ListFuturesSweepsRequest,
) (*ListFuturesSweepsResponse, error)

func (Client) ListOrders

func (c Client) ListOrders(
	ctx context.Context,
	request *ListOrdersRequest,
) (*ListOrdersResponse, error)

func (Client) ListPaymentMethods

func (c Client) ListPaymentMethods(
	ctx context.Context,
	request *ListPaymentMethodsRequest,
) (*ListPaymentMethodsResponse, error)

func (Client) ListPerpetualsPositions

func (c Client) ListPerpetualsPositions(
	ctx context.Context,
	request *ListPerpetualsPositionsRequest,
) (*ListPerpetualsPositionsResponse, error)

func (Client) ListPortfolios

func (c Client) ListPortfolios(
	ctx context.Context,
	request *ListPortfoliosRequest,
) (*ListPortfoliosResponse, error)

func (Client) ListProducts

func (c Client) ListProducts(
	ctx context.Context,
	request *ListProductsRequest,
) (*ListProductsResponse, error)

func (Client) ListPublicProducts

func (c Client) ListPublicProducts(
	ctx context.Context,
	request *ListPublicProductsRequest,
) (*ListPublicProductsResponse, error)

func (Client) MovePortfolioFunds

func (c Client) MovePortfolioFunds(
	ctx context.Context,
	request *MovePortfolioFundsRequest,
) (*MovePortfolioFundsResponse, error)

func (Client) PreviewEditOrder

func (c Client) PreviewEditOrder(
	ctx context.Context,
	request *PreviewEditOrderRequest,
) (*PreviewEditOrderResponse, error)

func (Client) ScheduleFuturesSweep

func (c Client) ScheduleFuturesSweep(
	ctx context.Context,
	request *ScheduleFuturesSweepRequest,
) (*ScheduleFuturesSweepResponse, error)

type ClosePositionRequest

type ClosePositionRequest struct {
	ClientOrderId string `json:"client_order_id"`
	ProductId     string `json:"product_id"`
	Size          string `json:"size,omitempty"`
}

type ClosePositionResponse

type ClosePositionResponse struct {
	Success            bool                  `json:"success"`
	SuccessResponse    *SuccessResponse      `json:"success_response"`
	ErrorResponse      *ErrorResponse        `json:"error_response"`
	OrderConfiguration *OrderConfiguration   `json:"order_configuration"`
	Request            *ClosePositionRequest `json:"request"`
}

type CommitConvertQuoteRequest

type CommitConvertQuoteRequest struct {
	TradeId     string `json:"trade_id"`
	FromAccount string `json:"from_account"`
	ToAccount   string `json:"to_account"`
}

type CommitConvertQuoteResponse

type CommitConvertQuoteResponse struct {
	Trade   *Convert                   `json:"trade"`
	Request *CommitConvertQuoteRequest `json:"request"`
}

type Context

type Context struct {
	Details  []string `json:"details"`
	Title    string   `json:"title"`
	LinkText string   `json:"link_text"`
}

type Convert

type Convert struct {
	Id                 string           `json:"id"`
	Status             string           `json:"status"`
	UserEnteredAmount  Amount           `json:"user_entered_amount"`
	Amount             Amount           `json:"amount"`
	Subtotal           Amount           `json:"subtotal"`
	Total              Amount           `json:"total"`
	Fees               []Fee            `json:"fees"`
	TotalFee           Fee              `json:"total_fee"`
	Source             SourceTargetInfo `json:"source"`
	Target             SourceTargetInfo `json:"target"`
	UnitPrice          UnitPriceInfo    `json:"unit_price"`
	UserWarnings       []UserWarning    `json:"user_warnings"`
	UserReference      string           `json:"user_reference"`
	SourceCurrency     string           `json:"source_currency"`
	TargetCurrency     string           `json:"target_currency"`
	CancellationReason ErrorInfo        `json:"cancellation_reason"`
	SourceId           string           `json:"source_id"`
	TargetId           string           `json:"target_id"`
	ExchangeRate       Amount           `json:"exchange_rate"`
	TaxDetails         []TaxDetail      `json:"tax_details"`
	TradeIncentiveInfo TradeIncentive   `json:"trade_incentive_info"`
	TotalFeeWithoutTax Fee              `json:"total_fee_without_tax"`
	FiatDenotedTotal   Amount           `json:"fiat_denoted_total"`
}

type CreateConvertQuoteRequest

type CreateConvertQuoteRequest struct {
	FromAccount            string                  `json:"from_account"`
	ToAccount              string                  `json:"to_account"`
	Amount                 string                  `json:"amount"`
	TradeIncentiveMetadata *TradeIncentiveMetadata `json:"trade_incentive_metadata,omitempty"`
}

type CreateConvertQuoteResponse

type CreateConvertQuoteResponse struct {
	Convert *Convert                   `json:"trade"`
	Request *CreateConvertQuoteRequest `json:"request"`
}

type CreateOrderPreviewRequest

type CreateOrderPreviewRequest struct {
	ProductId          string             `json:"product_id"`
	Side               string             `json:"side"`
	OrderConfiguration OrderConfiguration `json:"order_configuration"`
	CommissionRate     *Rate              `json:"commission_rate,omitempty"`
	IsMax              *bool              `json:"is_max,omitempty"`
	TradableBalance    string             `json:"tradable_balance,omitempty"`
	SkipFcmRiskCheck   *bool              `json:"skip_fcm_risk_check,omitempty"`
	Leverage           string             `json:"leverage,omitempty"`
	MarginType         string             `json:"margin_type,omitempty"`
	RetailPortfolioId  string             `json:"retail_portfolio_id,omitempty"`
}

type CreateOrderPreviewResponse

type CreateOrderPreviewResponse struct {
	OrderTotal         string                     `json:"order_total"`
	CommissionTotal    string                     `json:"commission_total"`
	Errs               []string                   `json:"errs"`
	Warning            []string                   `json:"warning"`
	QuoteSize          string                     `json:"quote_size"`
	BaseSize           string                     `json:"base_size"`
	BestBid            string                     `json:"best_bid"`
	BestAsk            string                     `json:"best_ask"`
	IsMax              bool                       `json:"is_max"`
	OrderMarginTotal   string                     `json:"order_margin_total"`
	Leverage           string                     `json:"leverage"`
	LongLeverage       string                     `json:"long_leverage"`
	ShortLeverage      string                     `json:"short_leverage"`
	Slippage           string                     `json:"slippage"`
	AverageFilledPrice string                     `json:"average_filled_price"`
	Request            *CreateOrderPreviewRequest `json:"request"`
}

type CreateOrderRequest

type CreateOrderRequest struct {
	ProductId          string             `json:"product_id"`
	Side               string             `json:"side"`
	ClientOrderId      string             `json:"client_order_id"`
	OrderConfiguration OrderConfiguration `json:"order_configuration"`
	CommissionRate     *Rate              `json:"commission_rate,omitempty"`
	IsMax              *bool              `json:"is_max,omitempty"`
	TradableBalance    string             `json:"tradable_balance,omitempty"`
	SkipFcmRiskCheck   *bool              `json:"skip_fcm_risk_check,omitempty"`
	Leverage           string             `json:"leverage,omitempty"`
	MarginType         string             `json:"margin_type,omitempty"`
	RetailPortfolioId  string             `json:"retail_portfolio_id,omitempty"`
}

type CreateOrderResponse

type CreateOrderResponse struct {
	Success            bool                `json:"success"`
	FailureReason      string              `json:"failure_reason,omitempty"`
	OrderId            string              `json:"order_id,omitempty"`
	SuccessResponse    *SuccessResponse    `json:"success_response,omitempty"`
	ErrorResponse      *ErrorResponse      `json:"error_response,omitempty"`
	OrderConfiguration OrderConfiguration  `json:"order_configuration"`
	Request            *CreateOrderRequest `json:"request"`
}

type CreatePortfolioRequest

type CreatePortfolioRequest struct {
	Name string `json:"name"`
}

type CreatePortfolioResponse

type CreatePortfolioResponse struct {
	Portfolio *Portfolio              `json:"portfolio"`
	Request   *CreatePortfolioRequest `json:"request"`
}

type Credentials

type Credentials struct {
	AccessKey     string `json:"accessKey"`
	PrivatePemKey string `json:"privatePemKey"`
	PortfolioId   string `json:"portfolioId"`
}

func ReadEnvCredentials

func ReadEnvCredentials(variableName string) (*Credentials, error)

func UnmarshalCredentials

func UnmarshalCredentials(b []byte) (*Credentials, error)

type DeletePortfolioRequest

type DeletePortfolioRequest struct {
	PortfolioUuid string `json:"portfolio_uuid"`
}

type DeletePortfolioResponse

type DeletePortfolioResponse struct {
	Description string                  `json:"description"`
	Schema      *Schema                 `json:"schema"`
	Request     *DeletePortfolioRequest `json:"request"`
}

type Disclosure

type Disclosure struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	Link        Link   `json:"link"`
}

type DualCurrencyValue

type DualCurrencyValue struct {
	UserNativeCurrency Amount `json:"userNativeCurrency"`
	RawCurrency        Amount `json:"rawCurrency"`
}

type EditError

type EditError struct {
	EditFailureReason    string `json:"edit_failure_reason"`
	PreviewFailureReason string `json:"preview_failure_reason"`
}

type EditHistoryItem

type EditHistoryItem struct {
	Price                  string `json:"price"`
	Size                   string `json:"size"`
	ReplaceAcceptTimestamp string `json:"replace_accept_timestamp"`
}

type EditOrderRequest

type EditOrderRequest struct {
	OrderId string `json:"order_id"`
	Price   string `json:"price"`
	Size    string `json:"size"`
}

type EditOrderResponse

type EditOrderResponse struct {
	Success    bool              `json:"success"`
	EditErrors []*EditError      `json:"errors,omitempty"`
	Request    *EditOrderRequest `json:"request"`
}

type EditPortfolioRequest

type EditPortfolioRequest struct {
	PortfolioUuid string `json:"portfolio_uuid"`
	Name          string `json:"name"`
}

type EditPortfolioResponse

type EditPortfolioResponse struct {
	Portfolio *Portfolio            `json:"portfolio"`
	Request   *EditPortfolioRequest `json:"request"`
}

type ErrorInfo

type ErrorInfo struct {
	Message   string `json:"message"`
	Code      string `json:"code"`
	ErrorCode string `json:"error_code"`
	ErrorCta  string `json:"error_cta"`
}

type ErrorMessage

type ErrorMessage struct {
	Value string `json:"message"`
}

type ErrorResponse

type ErrorResponse struct {
	Error                 string `json:"error"`
	Message               string `json:"message"`
	ErrorDetails          string `json:"error_details"`
	PreviewFailureReason  string `json:"preview_failure_reason"`
	NewOrderFailureReason string `json:"new_order_failure_reason"`
}

type Fee

type Fee struct {
	Title       string     `json:"title"`
	Description string     `json:"description"`
	Amount      Amount     `json:"amount"`
	Label       string     `json:"label"`
	Disclosure  Disclosure `json:"disclosure"`
}

type FeeSummary

type FeeSummary struct {
	TotalVolume             int     `json:"total_volume"`
	TotalFees               float64 `json:"total_fees"`
	FeeTier                 FeeTier `json:"fee_tier"`
	MarginRate              Rate    `json:"margin_rate"`
	GoodsAndServicesTax     Gst     `json:"goods_and_services_tax"`
	AdvancedTradeOnlyVolume int     `json:"advanced_trade_only_volume"`
	AdvancedTradeOnlyFees   float64 `json:"advanced_trade_only_fees"`
	CoinbaseProVolume       int     `json:"coinbase_pro_volume"`
	CoinbaseProFees         float64 `json:"coinbase_pro_fees"`
}

type FeeTier

type FeeTier struct {
	PricingTier  string `json:"pricing_tier"`
	UsdFrom      string `json:"usd_from"`
	UsdTo        string `json:"usd_to"`
	TakerFeeRate string `json:"taker_fee_rate"`
	MakerFeeRate string `json:"maker_fee_rate"`
	AopFrom      string `json:"aop_from"`
	AopTo        string `json:"aop_to"`
}

type Fill

type Fill struct {
	EntryId            string    `json:"entry_id"`
	TradeId            string    `json:"trade_id"`
	OrderId            string    `json:"order_id"`
	TradeTime          time.Time `json:"trade_time"`
	TradeType          string    `json:"trade_type"`
	Price              string    `json:"price"`
	Size               string    `json:"size"`
	Commission         string    `json:"commission"`
	ProductId          string    `json:"product_id"`
	SequenceTimestamp  time.Time `json:"sequence_timestamp"`
	LiquidityIndicator string    `json:"liquidity_indicator"`
	SizeInQuote        bool      `json:"size_in_quote"`
	UserId             string    `json:"user_id"`
	Side               string    `json:"side"`
}

type FutureProductDetails

type FutureProductDetails struct {
	Venue                  string           `json:"venue"`
	ContractCode           string           `json:"contract_code"`
	ContractExpiry         string           `json:"contract_expiry"`
	ContractSize           string           `json:"contract_size"`
	ContractRootUnit       string           `json:"contract_root_unit"`
	GroupDescription       string           `json:"group_description"`
	ContractExpiryTimezone string           `json:"contract_expiry_timezone"`
	GroupShortDescription  string           `json:"group_short_description"`
	RiskManagedBy          string           `json:"risk_managed_by"`
	ContractExpiryType     string           `json:"contract_expiry_type"`
	PerpetualDetails       PerpetualDetails `json:"perpetual_details"`
	ContractDisplayName    string           `json:"contract_display_name"`
}

type FuturesPosition

type FuturesPosition struct {
	ProductId       string `json:"product_id"`
	ContractSize    string `json:"contract_size"`
	Side            string `json:"side"`
	Amount          string `json:"amount"`
	AvgEntryPrice   string `json:"avg_entry_price"`
	CurrentPrice    string `json:"current_price"`
	UnrealizedPnl   string `json:"unrealized_pnl"`
	Expiry          string `json:"expiry"`
	UnderlyingAsset string `json:"underlying_asset"`
	AssetImgUrl     string `json:"asset_img_url"`
	ProductName     string `json:"product_name"`
	Venue           string `json:"venue"`
	NotionalValue   string `json:"notional_value"`
}

type GetAccountRequest

type GetAccountRequest struct {
	AccountUuid string `json:"account_uuid"`
}

type GetAccountResponse

type GetAccountResponse struct {
	Accounts *Account           `json:"account"`
	Request  *GetAccountRequest `json:"request"`
}

type GetBestBidAskRequest

type GetBestBidAskRequest struct {
	ProductIds []string `json:"product_ids,omitempty"`
}

type GetBestBidAskResponse

type GetBestBidAskResponse struct {
	PriceBooks *[]PriceBook          `json:"pricebooks"`
	Request    *GetBestBidAskRequest `json:"request"`
}

type GetConvertTradeRequest

type GetConvertTradeRequest struct {
	TradeId     string `json:"trade_id"`
	FromAccount string `json:"from_account"`
	ToAccount   string `json:"to_account"`
}

type GetConvertTradeResponse

type GetConvertTradeResponse struct {
	Convert *Convert                `json:"trade"`
	Request *GetConvertTradeRequest `json:"request"`
}

type GetFuturesBalanceSummaryRequest

type GetFuturesBalanceSummaryRequest struct{}

type GetFuturesBalanceSummaryResponse

type GetFuturesBalanceSummaryResponse struct {
	BalanceSummary *BalanceSummary                  `json:"balance_summary"`
	Request        *GetFuturesBalanceSummaryRequest `json:"request"`
}

type GetFuturesPositionRequest

type GetFuturesPositionRequest struct {
	ProductId string `json:"product_id"`
}

type GetFuturesPositionResponse

type GetFuturesPositionResponse struct {
	Position *CfmFuturesPosition        `json:"position"`
	Request  *GetFuturesPositionRequest `json:"request"`
}

type GetMarketTradesRequest

type GetMarketTradesRequest struct {
	ProductId string `json:"product_id"`
	Limit     string `json:"limit"`
	Start     string `json:"start,omitempty"`
	End       string `json:"end,omitempty"`
}

type GetMarketTradesResponse

type GetMarketTradesResponse struct {
	Trades  []*Trade                `json:"trades"`
	BestBid string                  `json:"best_bid"`
	BestAsk string                  `json:"best_ask"`
	Request *GetMarketTradesRequest `json:"request"`
}

type GetOrderRequest

type GetOrderRequest struct {
	OrderId            string `json:"order_id"`
	ClientOrderId      string `json:"client_order_id,omitempty"`
	UserNativeCurrency string `json:"user_native_currency,omitempty"`
}

type GetOrderResponse

type GetOrderResponse struct {
	Order   *Order           `json:"order"`
	Request *GetOrderRequest `json:"request"`
}

type GetPaymentMethodRequest

type GetPaymentMethodRequest struct {
	PaymentMethodId string `json:"payment_method_id"`
}

type GetPaymentMethodResponse

type GetPaymentMethodResponse struct {
	PaymentMethod *PaymentMethod           `json:"payment_method"`
	Request       *GetPaymentMethodRequest `json:"request"`
}

type GetPerpetualsPortfolioSummaryRequest

type GetPerpetualsPortfolioSummaryRequest struct {
	PortfolioUuid string `json:"portfolio_uuid"`
}

type GetPerpetualsPortfolioSummaryResponse

type GetPerpetualsPortfolioSummaryResponse struct {
	Portfolios *IntxPortfolio                        `json:"portfolios"`
	Request    *GetPerpetualsPortfolioSummaryRequest `json:"request"`
}

type GetPerpetualsPositionRequest

type GetPerpetualsPositionRequest struct {
	PortfolioUuid string `json:"portfolio_uuid"`
	Symbol        string `json:"symbol"`
}

type GetPerpetualsPositionResponse

type GetPerpetualsPositionResponse struct {
	Position *IntxPosition                 `json:"position"`
	Request  *GetPerpetualsPositionRequest `json:"request"`
}

type GetPortfolioBreakdownRequest

type GetPortfolioBreakdownRequest struct {
	PortfolioUuid string `json:"portfolio_uuid"`
}

type GetPortfolioBreakdownResponse

type GetPortfolioBreakdownResponse struct {
	Breakdown *Breakdown                    `json:"breakdown"`
	Request   *GetPortfolioBreakdownRequest `json:"request"`
}

type GetProductBookRequest

type GetProductBookRequest struct {
	ProductId string `json:"product_id"`
	Limit     string `json:"limit,omitempty"`
}

type GetProductBookResponse

type GetProductBookResponse struct {
	PriceBook *PriceBook             `json:"pricebook"`
	Request   *GetProductBookRequest `json:"request"`
}

type GetProductCandlesRequest

type GetProductCandlesRequest struct {
	ProductId   string `json:"product_id"`
	Start       string `json:"start"`
	End         string `json:"end"`
	Granularity string `json:"granularity"`
}

type GetProductCandlesResponse

type GetProductCandlesResponse struct {
	Candles *[]Candle                 `json:"candles"`
	Request *GetProductCandlesRequest `json:"request"`
}

type GetProductRequest

type GetProductRequest struct {
	ProductId string `json:"product_id"`
}

type GetProductResponse

type GetProductResponse struct {
	ProductId                 string               `json:"product_id"`
	Price                     string               `json:"price"`
	PricePercentageChange24h  string               `json:"price_percentage_change_24h"`
	Volume24h                 string               `json:"volume_24h"`
	VolumePercentageChange24h string               `json:"volume_percentage_change_24h"`
	BaseIncrement             string               `json:"base_increment"`
	QuoteIncrement            string               `json:"quote_increment"`
	QuoteMinSize              string               `json:"quote_min_size"`
	QuoteMaxSize              string               `json:"quote_max_size"`
	BaseMinSize               string               `json:"base_min_size"`
	BaseMaxSize               string               `json:"base_max_size"`
	BaseName                  string               `json:"base_name"`
	QuoteName                 string               `json:"quote_name"`
	Watched                   bool                 `json:"watched"`
	IsDisabled                bool                 `json:"is_disabled"`
	New                       bool                 `json:"new"`
	Status                    string               `json:"status"`
	CancelOnly                bool                 `json:"cancel_only"`
	LimitOnly                 bool                 `json:"limit_only"`
	PostOnly                  bool                 `json:"post_only"`
	TradingDisabled           bool                 `json:"trading_disabled"`
	AuctionMode               bool                 `json:"auction_mode"`
	ProductType               string               `json:"product_type"`
	QuoteCurrencyId           string               `json:"quote_currency_id"`
	BaseCurrencyId            string               `json:"base_currency_id"`
	FCMSessionDetails         SessionDetails       `json:"fcm_trading_session_details"`
	MidMarketPrice            string               `json:"mid_market_price"`
	Alias                     string               `json:"alias"`
	AliasTo                   []string             `json:"alias_to"`
	BaseDisplaySymbol         string               `json:"base_display_symbol"`
	QuoteDisplaySymbol        string               `json:"quote_display_symbol"`
	ViewOnly                  bool                 `json:"view_only"`
	PriceIncrement            string               `json:"price_increment"`
	FutureProductDetails      FutureProductDetails `json:"future_product_details"`
	Request                   *GetProductRequest   `json:"request"`
}

type GetPublicMarketTradesRequest

type GetPublicMarketTradesRequest struct {
	ProductId string `json:"product_id"`
	Limit     string `json:"limit"`
	Start     string `json:"start,omitempty"`
	End       string `json:"end,omitempty"`
}

type GetPublicMarketTradesResponse

type GetPublicMarketTradesResponse struct {
	Trades  []*Trade                      `json:"trades"`
	BestBid string                        `json:"best_bid"`
	BestAsk string                        `json:"best_ask"`
	Request *GetPublicMarketTradesRequest `json:"request"`
}

type GetPublicProductBookRequest

type GetPublicProductBookRequest struct {
	ProductId string `json:"product_id"`
	Limit     string `json:"limit,omitempty"`
}

type GetPublicProductBookResponse

type GetPublicProductBookResponse struct {
	PriceBook *PriceBook                   `json:"pricebook"`
	Request   *GetPublicProductBookRequest `json:"request"`
}

type GetPublicProductCandlesRequest

type GetPublicProductCandlesRequest struct {
	ProductId   string `json:"product_id"`
	Start       string `json:"start"`
	End         string `json:"end"`
	Granularity string `json:"granularity"`
}

type GetPublicProductCandlesResponse

type GetPublicProductCandlesResponse struct {
	Candles *[]Candle                       `json:"candles"`
	Request *GetPublicProductCandlesRequest `json:"request"`
}

type GetPublicProductRequest

type GetPublicProductRequest struct {
	ProductId string `json:"product_id"`
}

type GetPublicProductResponse

type GetPublicProductResponse struct {
	ProductId                 string                   `json:"product_id"`
	Price                     string                   `json:"price"`
	PricePercentageChange24h  string                   `json:"price_percentage_change_24h"`
	Volume24h                 string                   `json:"volume_24h"`
	VolumePercentageChange24h string                   `json:"volume_percentage_change_24h"`
	BaseIncrement             string                   `json:"base_increment"`
	QuoteIncrement            string                   `json:"quote_increment"`
	QuoteMinSize              string                   `json:"quote_min_size"`
	QuoteMaxSize              string                   `json:"quote_max_size"`
	BaseMinSize               string                   `json:"base_min_size"`
	BaseMaxSize               string                   `json:"base_max_size"`
	BaseName                  string                   `json:"base_name"`
	QuoteName                 string                   `json:"quote_name"`
	Watched                   bool                     `json:"watched"`
	IsDisabled                bool                     `json:"is_disabled"`
	New                       bool                     `json:"new"`
	Status                    string                   `json:"status"`
	CancelOnly                bool                     `json:"cancel_only"`
	LimitOnly                 bool                     `json:"limit_only"`
	PostOnly                  bool                     `json:"post_only"`
	TradingDisabled           bool                     `json:"trading_disabled"`
	AuctionMode               bool                     `json:"auction_mode"`
	ProductType               string                   `json:"product_type"`
	QuoteCurrencyId           string                   `json:"quote_currency_id"`
	BaseCurrencyId            string                   `json:"base_currency_id"`
	FCMSessionDetails         SessionDetails           `json:"fcm_trading_session_details"`
	MidMarketPrice            string                   `json:"mid_market_price"`
	Alias                     string                   `json:"alias"`
	AliasTo                   []string                 `json:"alias_to"`
	BaseDisplaySymbol         string                   `json:"base_display_symbol"`
	QuoteDisplaySymbol        string                   `json:"quote_display_symbol"`
	ViewOnly                  bool                     `json:"view_only"`
	PriceIncrement            string                   `json:"price_increment"`
	FutureProductDetails      FutureProductDetails     `json:"future_product_details"`
	Request                   *GetPublicProductRequest `json:"request"`
}

type GetServerTimeRequest

type GetServerTimeRequest struct{}

type GetServerTimeResponse

type GetServerTimeResponse struct {
	Iso          time.Time             `json:"iso"`
	EpochSeconds string                `json:"epochSeconds"`
	EpochMillis  string                `json:"epochMillis"`
	Request      *GetServerTimeRequest `json:"request"`
}

type GetTransactionsSummaryRequest

type GetTransactionsSummaryRequest struct {
	ProductType        string `json:"product_type"`
	ContractExpiryTime string `json:"contract_expiry_type"`
}

type GetTransactionsSummaryResponse

type GetTransactionsSummaryResponse struct {
	TotalVolume             int                            `json:"total_volume"`
	TotalFees               float64                        `json:"total_fees"`
	FeeTier                 FeeTier                        `json:"fee_tier"`
	MarginRate              Rate                           `json:"margin_rate"`
	GoodsAndServicesTax     Gst                            `json:"goods_and_services_tax"`
	AdvancedTradeOnlyVolume int                            `json:"advanced_trade_only_volume"`
	AdvancedTradeOnlyFees   float64                        `json:"advanced_trade_only_fees"`
	CoinbaseProVolume       int                            `json:"coinbase_pro_volume"`
	CoinbaseProFees         float64                        `json:"coinbase_pro_fees"`
	Request                 *GetTransactionsSummaryRequest `json:"request"`
}

type Gst

type Gst struct {
	Rate string `json:"rate"`
	Type string `json:"type"`
}

type IntxPortfolio

type IntxPortfolio struct {
	PortfolioUuid              string       `json:"portfolio_uuid"`
	Collateral                 string       `json:"collateral"`
	PositionNotional           string       `json:"position_notional"`
	OpenPositionNotional       string       `json:"open_position_notional"`
	PendingFees                string       `json:"pending_fees"`
	Borrow                     string       `json:"borrow"`
	AccruedInterest            string       `json:"accrued_interest"`
	RollingDebt                string       `json:"rolling_debt"`
	PortfolioInitialMargin     string       `json:"portfolio_initial_margin"`
	PortfolioImNotional        Amount       `json:"portfolio_im_notional"`
	PortfolioMaintenanceMargin string       `json:"portfolio_maintenance_margin"`
	PortfolioMmNotional        Amount       `json:"portfolio_mm_notional"`
	LiquidationPercentage      string       `json:"liquidation_percentage"`
	LiquidationBuffer          string       `json:"liquidation_buffer"`
	MarginType                 string       `json:"margin_type"`
	MarginFlags                string       `json:"margin_flags"`
	LiquidationStatus          string       `json:"liquidation_status"`
	UnrealizedPnl              Amount       `json:"unrealized_pnl"`
	TotalBalance               Amount       `json:"total_balance"`
	Summary                    PerpsSummary `json:"summary"`
}

type IntxPosition

type IntxPosition struct {
	ProductId        string `json:"product_id"`
	ProductUuid      string `json:"product_uuid"`
	PortfolioUuid    string `json:"portfolio_uuid"`
	Symbol           string `json:"symbol"`
	Vwap             Amount `json:"vwap"`
	EntryVwap        Amount `json:"entry_vwap"`
	PositionSide     string `json:"position_side"`
	MarginType       string `json:"margin_type"`
	NetSize          string `json:"net_size"`
	BuyOrderSize     string `json:"buy_order_size"`
	SellOrderSize    string `json:"sell_order_size"`
	ImContribution   string `json:"im_contribution"`
	UnrealizedPnl    Amount `json:"unrealized_pnl"`
	MarkPrice        Amount `json:"mark_price"`
	LiquidationPrice Amount `json:"liquidation_price"`
	Leverage         string `json:"leverage"`
	ImNotional       Amount `json:"im_notional"`
	MmNotional       Amount `json:"mm_notional"`
	PositionNotional string `json:"position_notional"`
}

type IntxSummary

type IntxSummary struct {
	AggregatedPnl Amount `json:"aggregated_pnl"`
}

type LedgerAccount

type LedgerAccount struct {
	AccountId string `json:"account_id"`
	Currency  string `json:"currency"`
	Owner     Owner  `json:"owner"`
}

type Level

type Level struct {
	Price string `json:"price"`
	Size  string `json:"size"`
}

type LimitFok

type LimitFok struct {
	BaseSize   string `json:"base_size"`
	LimitPrice string `json:"limit_price"`
}

type LimitGtc

type LimitGtc struct {
	BaseSize   string `json:"base_size"`
	LimitPrice string `json:"limit_price"`
	PostOnly   bool   `json:"post_only"`
}

type LimitGtd

type LimitGtd struct {
	BaseSize   string `json:"base_size"`
	LimitPrice string `json:"limit_price"`
	EndTime    string `json:"end_time"`
	PostOnly   bool   `json:"post_only"`
}
type Link struct {
	Text string `json:"text"`
	Url  string `json:"url"`
}

type ListAccountsRequest

type ListAccountsRequest struct {
	Pagination        *PaginationParams `json:"pagination_params"`
	RetailPortfolioId string            `json:"retail_portfolio_id"`
}

type ListAccountsResponse

type ListAccountsResponse struct {
	Accounts   []*Account           `json:"accounts"`
	Request    *ListAccountsRequest `json:"request"`
	Pagination *Pagination
}

type ListFillsRequest

type ListFillsRequest struct {
	OrderId                string `json:"order_id,omitempty"`
	ProductId              string `json:"product_id,omitempty"`
	StartSequenceTimestamp string `json:"start_sequence_timestamp,omitempty"`
	EndSequenceTimestamp   string `json:"end_sequence_timestamp,omitempty"`
	Limit                  string `json:"limit,omitempty"`
	Cursor                 string `json:"cursor,omitempty"`
}

type ListFillsResponse

type ListFillsResponse struct {
	Fills   []*Fill           `json:"fills"`
	Cursor  string            `json:"cursor"`
	Request *ListFillsRequest `json:"request"`
}

type ListFuturesPositionsRequest

type ListFuturesPositionsRequest struct{}

type ListFuturesPositionsResponse

type ListFuturesPositionsResponse struct {
	FuturesPositions []*CfmFuturesPosition        `json:"positions"`
	Request          *ListFuturesPositionsRequest `json:"request"`
}

type ListFuturesSweepsRequest

type ListFuturesSweepsRequest struct{}

type ListFuturesSweepsResponse

type ListFuturesSweepsResponse struct {
	Sweeps  *Sweep                    `json:"sweeps"`
	Request *ListFuturesSweepsRequest `json:"request"`
}

type ListOrdersRequest

type ListOrdersRequest struct {
	ProductId            string            `json:"product_id,omitempty"`
	OrderStatus          []string          `json:"order_status,omitempty"`
	StartDate            string            `json:"start_date,omitempty"`
	EndDate              string            `json:"end_date,omitempty"`
	OrderType            string            `json:"order_type,omitempty"`
	OrderSide            string            `json:"order_side,omitempty"`
	ProductType          string            `json:"product_type,omitempty"`
	OrderPlacementSource string            `json:"order_placement_source,omitempty"`
	ContractExpiryType   string            `json:"contract_expiry_type,omitempty"`
	AssetFilters         []string          `json:"asset_filters,omitempty"`
	RetailPortfolioId    string            `json:"retail_portfolio_id,omitempty"`
	Pagination           *PaginationParams `json:"pagination,omitempty"`
}

type ListOrdersResponse

type ListOrdersResponse struct {
	Orders     []*Order `json:"orders"`
	Sequence   string   `json:"sequence"`
	Pagination *Pagination
	Request    *ListOrdersRequest `json:"request"`
}

type ListPaymentMethodsRequest

type ListPaymentMethodsRequest struct{}

type ListPaymentMethodsResponse

type ListPaymentMethodsResponse struct {
	PaymentMethods []*PaymentMethod           `json:"payment_methods"`
	Request        *ListPaymentMethodsRequest `json:"request"`
}

type ListPerpetualsPositionsRequest

type ListPerpetualsPositionsRequest struct {
	PortfolioUuid string `json:"portfolio_uuid"`
}

type ListPerpetualsPositionsResponse

type ListPerpetualsPositionsResponse struct {
	Positions []*IntxPosition                 `json:"positions"`
	Summary   *IntxSummary                    `json:"summary"`
	Request   *ListPerpetualsPositionsRequest `json:"request"`
}

type ListPortfoliosRequest

type ListPortfoliosRequest struct {
	PortfolioType string `json:"portfolio_type,omitempty"`
}

type ListPortfoliosResponse

type ListPortfoliosResponse struct {
	Portfolios []*Portfolio           `json:"portfolios"`
	Request    *ListPortfoliosRequest `json:"request"`
}

type ListProductsRequest

type ListProductsRequest struct {
	ProductType            string            `json:"product_type,omitempty"`
	ProductIds             []string          `json:"product_ids,omitempty"`
	ContractExpiryType     string            `json:"contract_expiry_type,omitempty"`
	ExpiringContractStatus string            `json:"expiring_contract_status,omitempty"`
	Pagination             *PaginationParams `json:"pagination_params,omitempty"`
}

type ListProductsResponse

type ListProductsResponse struct {
	Products []*Product           `json:"products"`
	Request  *ListProductsRequest `json:"request"`
}

type ListPublicProductsRequest

type ListPublicProductsRequest struct {
	ProductType            string            `json:"product_type"`
	ProductIds             []string          `json:"product_ids"`
	ContractExpiryType     string            `json:"contract_expiry_type"`
	ExpiringContractStatus string            `json:"expiring_contract_status"`
	Pagination             *PaginationParams `json:"pagination_params"`
}

type ListPublicProductsResponse

type ListPublicProductsResponse struct {
	Products []*Product                 `json:"products"`
	Request  *ListPublicProductsRequest `json:"request"`
}

type MarketIoc

type MarketIoc struct {
	QuoteSize string `json:"quote_size,omitempty"`
	BaseSize  string `json:"base_size,omitempty"`
}

type MovePortfolioFundsRequest

type MovePortfolioFundsRequest struct {
	Funds               *Amount `json:"funds"`
	SourcePortfolioUuid string  `json:"source_portfolio_uuid"`
	TargetPortfolioUuid string  `json:"target_portfolio_uuid"`
}

type MovePortfolioFundsResponse

type MovePortfolioFundsResponse struct {
	SourcePortfolioUuid string                     `json:"source_portfolio_uuid"`
	TargetPortfolioUuid string                     `json:"target_portfolio_uuid"`
	Request             *MovePortfolioFundsRequest `json:"request"`
}

type Order

type Order struct {
	OrderId               string             `json:"order_id"`
	ProductId             string             `json:"product_id"`
	UserId                string             `json:"user_id"`
	OrderConfiguration    OrderConfiguration `json:"order_configuration"`
	Side                  string             `json:"side"`
	ClientOrderId         string             `json:"client_order_id"`
	Status                string             `json:"status"`
	TimeInForce           string             `json:"time_in_force"`
	CreatedTime           string             `json:"created_time"`
	CompletionPercentage  string             `json:"completion_percentage"`
	FilledSize            string             `json:"filled_size"`
	AverageFilledPrice    string             `json:"average_filled_price"`
	NumberOfFills         string             `json:"number_of_fills"`
	FilledValue           string             `json:"filled_value"`
	PendingCancel         bool               `json:"pending_cancel"`
	SizeInQuote           bool               `json:"size_in_quote"`
	TotalFees             string             `json:"total_fees"`
	SizeInclusiveOfFees   bool               `json:"size_inclusive_of_fees"`
	TotalValueAfterFees   string             `json:"total_value_after_fees"`
	TriggerStatus         string             `json:"trigger_status"`
	OrderType             string             `json:"order_type"`
	RejectReason          string             `json:"reject_reason"`
	Settled               bool               `json:"settled"`
	ProductType           string             `json:"product_type"`
	RejectMessage         string             `json:"reject_message"`
	CancelMessage         string             `json:"cancel_message"`
	OrderPlacementSource  string             `json:"order_placement_source"`
	OutstandingHoldAmount string             `json:"outstanding_hold_amount"`
	IsLiquidation         bool               `json:"is_liquidation"`
	LastFillTime          string             `json:"last_fill_time"`
	EditHistory           []EditHistoryItem  `json:"edit_history"`
}

type OrderConfiguration

type OrderConfiguration struct {
	MarketMarketIoc       *MarketIoc    `json:"market_market_ioc,omitempty"`
	SorLimitIoc           *SorLimitIoc  `json:"sor_limit_ioc,omitempty"`
	LimitLimitGtc         *LimitGtc     `json:"limit_limit_gtc,omitempty"`
	LimitLimitGtd         *LimitGtd     `json:"limit_limit_gtd,omitempty"`
	LimitLimitFok         *LimitFok     `json:"limit_limit_fok,omitempty"`
	StopLimitStopLimitGtc *StopLimitGtc `json:"stop_limit_stop_limit_gtc,omitempty"`
	StopLimitStopLimitGtd *StopLimitGtd `json:"stop_limit_stop_limit_gtd,omitempty"`
	TriggerBracketGtc     *TriggerGtc   `json:"trigger_bracket_gtc,omitempty"`
	TriggerBracketGtd     *TriggerGtd   `json:"trigger_bracket_gtd,omitempty"`
}

type Owner

type Owner struct {
	Id       string `json:"id"`
	Uuid     string `json:"uuid"`
	UserUuid string `json:"user_uuid"`
	Type     string `json:"type"`
}

type Pagination

type Pagination struct {
	HasNext bool   `json:"has_next"`
	Cursor  string `json:"cursor"`
	Size    string `json:"size"`
}

type PaginationParams

type PaginationParams struct {
	Cursor string `json:"cursor"`
	Limit  string `json:"limit"`
}

type PaymentMethod

type PaymentMethod struct {
	Id            string    `json:"id"`
	Type          string    `json:"type"`
	Name          string    `json:"name"`
	Currency      string    `json:"currency"`
	Verified      bool      `json:"verified"`
	AllowBuy      bool      `json:"allow_buy"`
	AllowSell     bool      `json:"allow_sell"`
	AllowDeposit  bool      `json:"allow_deposit"`
	AllowWithdraw bool      `json:"allow_withdraw"`
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
}

type PerpPosition

type PerpPosition struct {
	ProductId             string            `json:"product_id"`
	ProductUuid           string            `json:"product_uuid"`
	Symbol                string            `json:"symbol"`
	AssetImageUrl         string            `json:"asset_image_url"`
	Vwap                  DualCurrencyValue `json:"vwap"`
	PositionSide          string            `json:"position_side"`
	NetSize               string            `json:"net_size"`
	BuyOrderSize          string            `json:"buy_order_size"`
	SellOrderSize         string            `json:"sell_order_size"`
	ImContribution        string            `json:"im_contribution"`
	UnrealizedPnl         DualCurrencyValue `json:"unrealized_pnl"`
	MarkPrice             DualCurrencyValue `json:"mark_price"`
	LiquidationPrice      DualCurrencyValue `json:"liquidation_price"`
	Leverage              string            `json:"leverage"`
	ImNotional            DualCurrencyValue `json:"im_notional"`
	MmNotional            DualCurrencyValue `json:"mm_notional"`
	PositionNotional      DualCurrencyValue `json:"position_notional"`
	MarginType            string            `json:"margin_type"`
	LiquidationBuffer     string            `json:"liquidation_buffer"`
	LiquidationPercentage string            `json:"liquidation_percentage"`
}

type PerpetualDetails

type PerpetualDetails struct {
	OpenInterest string `json:"open_interest"`
	FundingRate  string `json:"funding_rate"`
	FundingTime  string `json:"funding_time"`
}

type PerpsSummary

type PerpsSummary struct {
	UnrealizedPnl       Amount `json:"unrealized_pnl"`
	BuyingPower         Amount `json:"buying_power"`
	TotalBalance        Amount `json:"total_balance"`
	MaxWithdrawalAmount Amount `json:"max_withdrawal_amount"`
}

type Portfolio

type Portfolio struct {
	Name    string `json:"name"`
	Uuid    string `json:"uuid"`
	Type    string `json:"type"`
	Deleted bool   `json:"deleted"`
}

type PortfolioBalances

type PortfolioBalances struct {
	TotalBalance               Amount `json:"total_balance"`
	TotalFuturesBalance        Amount `json:"total_futures_balance"`
	TotalCashEquivalentBalance Amount `json:"total_cash_equivalent_balance"`
	TotalCryptoBalance         Amount `json:"total_crypto_balance"`
	FuturesUnrealizedPnl       Amount `json:"futures_unrealized_pnl"`
	PerpUnrealizedPnl          Amount `json:"perp_unrealized_pnl"`
}

type Preview

type Preview struct {
	OrderTotal       string   `json:"order_total"`
	CommissionTotal  string   `json:"commission_total"`
	Errs             []string `json:"errs"`
	Warning          []string `json:"warning"`
	QuoteSize        string   `json:"quote_size"`
	BaseSize         string   `json:"base_size"`
	BestBid          string   `json:"best_bid"`
	BestAsk          string   `json:"best_ask"`
	IsMax            string   `json:"is_max"`
	OrderMarginTotal string   `json:"order_margin_total"`
	Leverage         string   `json:"leverage"`
	LongLeverage     string   `json:"long_leverage"`
	ShortLeverage    string   `json:"short_leverage"`
	Slippage         string   `json:"slippage"`
}

type PreviewEditOrderRequest

type PreviewEditOrderRequest struct {
	OrderId string `json:"order_id"`
	Price   string `json:"price"`
	Size    string `json:"size"`
}

type PreviewEditOrderResponse

type PreviewEditOrderResponse struct {
	EditErrors      []*EditError             `json:"errors,omitempty"`
	Slippage        string                   `json:"slippage"`
	OrderTotal      string                   `json:"order_total"`
	CommissionTotal string                   `json:"commission_total"`
	QuoteSize       string                   `json:"quote_size"`
	BaseSize        string                   `json:"base_size"`
	BestBid         string                   `json:"best_bid"`
	BestAsk         string                   `json:"best_ask"`
	Leverage        string                   `json:"leverage"`
	LongLeverage    string                   `json:"long_leverage"`
	ShortLeverage   string                   `json:"short_leverage"`
	Request         *PreviewEditOrderRequest `json:"request"`
}

type PriceBook

type PriceBook struct {
	ProductId string  `json:"product_id"`
	Bids      []Level `json:"bids"`
	Asks      []Level `json:"asks"`
	Time      string  `json:"time"`
}

type Product

type Product struct {
	ProductId                 string               `json:"product_id"`
	Price                     string               `json:"price"`
	PricePercentageChange24h  string               `json:"price_percentage_change_24h"`
	Volume24h                 string               `json:"volume_24h"`
	VolumePercentageChange24h string               `json:"volume_percentage_change_24h"`
	BaseIncrement             string               `json:"base_increment"`
	QuoteIncrement            string               `json:"quote_increment"`
	QuoteMinSize              string               `json:"quote_min_size"`
	QuoteMaxSize              string               `json:"quote_max_size"`
	BaseMinSize               string               `json:"base_min_size"`
	BaseMaxSize               string               `json:"base_max_size"`
	BaseName                  string               `json:"base_name"`
	QuoteName                 string               `json:"quote_name"`
	Watched                   bool                 `json:"watched"`
	IsDisabled                bool                 `json:"is_disabled"`
	New                       bool                 `json:"new"`
	Status                    string               `json:"status"`
	CancelOnly                bool                 `json:"cancel_only"`
	LimitOnly                 bool                 `json:"limit_only"`
	PostOnly                  bool                 `json:"post_only"`
	TradingDisabled           bool                 `json:"trading_disabled"`
	AuctionMode               bool                 `json:"auction_mode"`
	ProductType               string               `json:"product_type"`
	QuoteCurrencyId           string               `json:"quote_currency_id"`
	BaseCurrencyId            string               `json:"base_currency_id"`
	FcmSessionDetails         SessionDetails       `json:"fcm_trading_session_details"`
	MidMarketPrice            string               `json:"mid_market_price"`
	Alias                     string               `json:"alias"`
	AliasTo                   []string             `json:"alias_to"`
	BaseDisplaySymbol         string               `json:"base_display_symbol"`
	QuoteDisplaySymbol        string               `json:"quote_display_symbol"`
	ViewOnly                  bool                 `json:"view_only"`
	PriceIncrement            string               `json:"price_increment"`
	FutureProductDetails      FutureProductDetails `json:"future_product_details"`
}

type ProductsResponse

type ProductsResponse struct {
	Products    Product `json:"products"`
	NumProducts int     `json:"num_products"`
}

type Rate

type Rate struct {
	Value string `json:"value"`
}

type ScheduleFuturesSweepRequest

type ScheduleFuturesSweepRequest struct {
	UsdAmount string `json:"usd_amount"`
}

type ScheduleFuturesSweepResponse

type ScheduleFuturesSweepResponse struct {
	Success bool                         `json:"success"`
	Request *ScheduleFuturesSweepRequest `json:"request"`
}

type Schema

type Schema struct {
	Type string `json:"type"`
}

type SessionDetails

type SessionDetails struct {
	IsSessionOpen string `json:"is_session_open"`
	OpenTime      string `json:"open_time"`
	CloseTime     string `json:"close_time"`
}

type SorLimitIoc

type SorLimitIoc struct {
	BaseSize   string `json:"base_size"`
	LimitPrice string `json:"limit_price"`
}

type SourceTargetInfo

type SourceTargetInfo struct {
	Type          string        `json:"type"`
	Network       string        `json:"network"`
	LedgerAccount LedgerAccount `json:"ledger_account"`
}

type SpotPosition

type SpotPosition struct {
	Asset                string  `json:"asset"`
	AccountUuid          string  `json:"account_uuid"`
	TotalBalanceFiat     float64 `json:"total_balance_fiat"`
	TotalBalanceCrypto   float64 `json:"total_balance_crypto"`
	AvailableToTradeFiat float64 `json:"available_to_trade_fiat"`
	Allocation           float64 `json:"allocation"`
	OneDayChange         float64 `json:"one_day_change"`
	CostBasis            Amount  `json:"cost_basis"`
	AssetImgUrl          string  `json:"asset_img_url"`
	IsCash               bool    `json:"is_cash"`
}

type StopLimitGtc

type StopLimitGtc struct {
	BaseSize      string `json:"base_size"`
	LimitPrice    string `json:"limit_price"`
	StopPrice     string `json:"stop_price"`
	StopDirection string `json:"stop_direction"`
}

type StopLimitGtd

type StopLimitGtd struct {
	BaseSize      string `json:"base_size"`
	LimitPrice    string `json:"limit_price"`
	StopPrice     string `json:"stop_price"`
	EndTime       string `json:"end_time"`
	StopDirection string `json:"stop_direction"`
}

type SuccessResponse

type SuccessResponse struct {
	OrderId       string `json:"order_id"`
	ProductId     string `json:"product_id"`
	Side          string `json:"side"`
	ClientOrderId string `json:"client_order_id"`
}

type Sweep

type Sweep struct {
	Id              string `json:"id"`
	RequestedAmount Amount `json:"requested_amount"`
	ShouldSweepAll  bool   `json:"should_sweep_all"`
	Status          string `json:"status"`
	ScheduledTime   string `json:"scheduled_time"`
}

type TaxDetail

type TaxDetail struct {
	Name   string `json:"name"`
	Amount Amount `json:"amount"`
}

type Trade

type Trade struct {
	TradeId   string    `json:"trade_id"`
	ProductId string    `json:"product_id"`
	Price     string    `json:"price"`
	Size      string    `json:"size"`
	Time      time.Time `json:"time"`
	Side      string    `json:"side"`
	Bid       string    `json:"bid"`
	Ask       string    `json:"ask"`
}

type TradeIncentive

type TradeIncentive struct {
	AppliedIncentive    bool   `json:"applied_incentive"`
	UserIncentiveId     string `json:"user_incentive_id"`
	CodeVal             string `json:"code_val"`
	EndsAt              string `json:"ends_at"`
	FeeWithoutIncentive Amount `json:"fee_without_incentive"`
	Redeemed            bool   `json:"redeemed"`
}

type TradeIncentiveMetadata

type TradeIncentiveMetadata struct {
	UserIncentiveId string `json:"user_incentive_id"`
	CodeVal         string `json:"code_val"`
}

type TriggerGtc

type TriggerGtc struct {
	BaseSize         string `json:"base_size"`
	LimitPrice       string `json:"limit_price"`
	StopTriggerPrice string `json:"stop_trigger_price"`
}

type TriggerGtd

type TriggerGtd struct {
	BaseSize         string `json:"base_size"`
	LimitPrice       string `json:"limit_price"`
	StopTriggerPrice string `json:"stop_trigger_price"`
	EndTime          string `json:"end_time"`
}

type UnitPriceInfo

type UnitPriceInfo struct {
	TargetToFiat   Amount `json:"target_to_fiat"`
	TargetToSource Amount `json:"target_to_source"`
	SourceToFiat   Amount `json:"source_to_fiat"`
}

type UserWarning

type UserWarning struct {
	Id      string  `json:"id"`
	Link    Link    `json:"link"`
	Context Context `json:"context"`
	Code    string  `json:"code"`
	Message string  `json:"message"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL