Documentation ¶
Index ¶
- Variables
- func NewAnonymousClient(opts ...ClientOption) (*client, error)
- func NewClient(key, passphrase, secret string, opts ...ClientOption) (*client, error)
- type Account
- type Book
- type BookEntry
- type CancelAllOrdersParams
- type ClientOption
- type CreateReportParams
- type Currency
- type Cursor
- type Deposit
- type Error
- type Fees
- type Fill
- type GetAccountLedgerParams
- type GetHistoricRatesParams
- type HistoricRate
- type Hold
- type LedgerDetails
- type LedgerEntry
- type ListFillsParams
- type ListHoldsParams
- type ListOrdersParams
- type ListTradesParams
- type Message
- type MessageChannel
- type Order
- type PaginationParams
- type PaymentMethod
- type Product
- type Profile
- type ProfileTransfer
- type Report
- type ReportParams
- type ServerTime
- type SignedMessage
- type SnapshotChange
- type SnapshotEntry
- type Stats
- type StringNumber
- type Ticker
- type Time
- type Trade
- type Transfer
- type WithdrawalCoinbase
- type WithdrawalCrypto
- type WithdrawalPaymentMethod
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = Error{Message: "Route not found"} ErrCloseWebsocket = errors.New("close webscoket connection") )
Functions ¶
func NewAnonymousClient ¶ added in v1.0.1
func NewAnonymousClient(opts ...ClientOption) (*client, error)
NewAnonymousClient creates a new instance of client without any credentials which can be used for public endpoints.
func NewClient ¶
func NewClient(key, passphrase, secret string, opts ...ClientOption) (*client, error)
NewClient creates a new instance of client with credentials which can be used for both public & private endpoints.
Types ¶
type BookEntry ¶
func (*BookEntry) UnmarshalJSON ¶
type CancelAllOrdersParams ¶
type CancelAllOrdersParams struct {
ProductID string
}
type ClientOption ¶ added in v1.0.1
type ClientOption func(*client) error
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) ClientOption
func WithRetryCount ¶
func WithRetryCount(retryCount int) ClientOption
func WithRetryInterval ¶
func WithRetryInterval(retryInterval time.Duration) ClientOption
func WithSandboxEnvironment ¶
func WithSandboxEnvironment() ClientOption
func WithTimeOffsetSeconds ¶
func WithTimeOffsetSeconds(offset int) ClientOption
WithTimeOffsetSeconds can be used to generate timestamps with offset to current time. Coinbase Pro sandbox time has been off in the past.
type Deposit ¶
type Deposit struct { Currency string `json:"currency"` Amount string `json:"amount"` // PaymentMethodID can be determined by calling GetPaymentMethods PaymentMethodID string `json:"payment_method_id"` // Response fields ID string `json:"id,omitempty"` PayoutAt Time `json:"payout_at,string,omitempty"` }
type Fill ¶
type Fill struct { TradeID int `json:"trade_id,int"` ProductID string `json:"product_id"` Price string `json:"price"` Size string `json:"size"` FillID string `json:"order_id"` CreatedAt Time `json:"created_at,string"` Fee string `json:"fee"` Settled bool `json:"settled"` Side string `json:"side"` Liquidity string `json:"liquidity"` }
type GetAccountLedgerParams ¶
type GetAccountLedgerParams struct {
Pagination PaginationParams
}
type GetHistoricRatesParams ¶
type HistoricRate ¶
type HistoricRate struct { Time time.Time Low float64 High float64 Open float64 Close float64 Volume float64 }
func (*HistoricRate) UnmarshalJSON ¶
func (e *HistoricRate) UnmarshalJSON(data []byte) error
type LedgerDetails ¶
type LedgerEntry ¶
type ListFillsParams ¶
type ListFillsParams struct { OrderID string ProductID string Pagination PaginationParams }
type ListHoldsParams ¶
type ListHoldsParams struct {
Pagination PaginationParams
}
type ListOrdersParams ¶
type ListOrdersParams struct { Status string ProductID string Pagination PaginationParams }
type ListTradesParams ¶
type ListTradesParams struct {
Pagination *PaginationParams
}
type Message ¶
type Message struct { Type string `json:"type"` ProductID string `json:"product_id"` ProductIds []string `json:"product_ids"` Products []Product `json:"products"` Currencies []Currency `json:"currencies"` TradeID int `json:"trade_id,number"` OrderID string `json:"order_id"` ClientOID string `json:"client_oid"` Sequence int64 `json:"sequence,number"` MakerOrderID string `json:"maker_order_id"` TakerOrderID string `json:"taker_order_id"` Time Time `json:"time,string"` RemainingSize string `json:"remaining_size"` NewSize string `json:"new_size"` OldSize string `json:"old_size"` Size string `json:"size"` Price string `json:"price"` Side string `json:"side"` Reason string `json:"reason"` OrderType string `json:"order_type"` Funds string `json:"funds"` NewFunds string `json:"new_funds"` OldFunds string `json:"old_funds"` Message string `json:"message"` Bids []SnapshotEntry `json:"bids,omitempty"` Asks []SnapshotEntry `json:"asks,omitempty"` Changes []SnapshotChange `json:"changes,omitempty"` LastSize string `json:"last_size"` BestBid string `json:"best_bid"` BestAsk string `json:"best_ask"` Channels []MessageChannel `json:"channels"` UserID string `json:"user_id"` ProfileID string `json:"profile_id"` LastTradeID int `json:"last_trade_id"` }
type MessageChannel ¶
type Order ¶
type Order struct { Type string `json:"type"` Size string `json:"size,omitempty"` Side string `json:"side"` ProductID string `json:"product_id"` ClientOID string `json:"client_oid,omitempty"` Stp string `json:"stp,omitempty"` Stop string `json:"stop,omitempty"` StopPrice string `json:"stop_price,omitempty"` // Limit Order Price string `json:"price,omitempty"` TimeInForce string `json:"time_in_force,omitempty"` PostOnly bool `json:"post_only,omitempty"` CancelAfter string `json:"cancel_after,omitempty"` // Market Order Funds string `json:"funds,omitempty"` SpecifiedFunds string `json:"specified_funds,omitempty"` // Response Fields ID string `json:"id"` Status string `json:"status,omitempty"` Settled bool `json:"settled,omitempty"` DoneReason string `json:"done_reason,omitempty"` DoneAt Time `json:"done_at,string,omitempty"` CreatedAt Time `json:"created_at,string,omitempty"` FillFees string `json:"fill_fees,omitempty"` FilledSize string `json:"filled_size,omitempty"` ExecutedValue string `json:"executed_value,omitempty"` }
type PaginationParams ¶
func (*PaginationParams) AddExtraParam ¶
func (p *PaginationParams) AddExtraParam(key, value string)
func (*PaginationParams) Done ¶
func (p *PaginationParams) Done(direction string) bool
func (*PaginationParams) Encode ¶
func (p *PaginationParams) Encode(direction string) string
type PaymentMethod ¶
type Product ¶
type Product struct { ID string `json:"id"` BaseCurrency string `json:"base_currency"` QuoteCurrency string `json:"quote_currency"` BaseMinSize string `json:"base_min_size"` BaseMaxSize string `json:"base_max_size"` QuoteIncrement string `json:"quote_increment"` BaseIncrement string `json:"base_increment"` DisplayName string `json:"display_name"` MinMarketFunds string `json:"min_market_funds"` MaxMarketFunds string `json:"max_market_funds"` MarginEnabled bool `json:"margin_enabled"` PostOnly bool `json:"post_only"` LimitOnly bool `json:"limit_only"` CancelOnly bool `json:"cancel_only"` TradingDisabled bool `json:"trading_disabled"` Status string `json:"status"` StatusMessage string `json:"status_message"` }
type ProfileTransfer ¶
type Report ¶
type Report struct { ID string `json:"id"` Type string `json:"type"` Status string `json:"status"` // ProductID is required for fills type reports. // Use 'ALL' to get all products. ProductID string `json:"product_id"` // AccountID is required for account type reports. AccountID string `json:"account_id"` CreatedAt Time `json:"created_at,string"` CompletedAt Time `json:"completed_at,string,"` ExpiresAt Time `json:"expires_at,string"` FileURL string `json:"file_url"` Params ReportParams `json:"params"` StartDate time.Time EndDate time.Time }
type ServerTime ¶
type SignedMessage ¶
type SnapshotChange ¶
func (*SnapshotChange) UnmarshalJSON ¶
func (e *SnapshotChange) UnmarshalJSON(data []byte) error
type SnapshotEntry ¶
func (*SnapshotEntry) UnmarshalJSON ¶
func (e *SnapshotEntry) UnmarshalJSON(data []byte) error
type StringNumber ¶
type StringNumber string
func (*StringNumber) UnmarshalJSON ¶
func (s *StringNumber) UnmarshalJSON(data []byte) error
type Time ¶
func (Time) MarshalJSON ¶
MarshalJSON marshal time back to time.Time for json encoding
func (*Time) UnmarshalJSON ¶
type WithdrawalCoinbase ¶
type WithdrawalCrypto ¶
type WithdrawalPaymentMethod ¶
type WithdrawalPaymentMethod struct { ProfileID string `json:"profile_id"` Currency string `json:"currency"` Amount string `json:"amount"` // PaymentMethodID can be determined by calling GetPaymentMethods PaymentMethodID string `json:"payment_method_id"` // Response fields ID string `json:"id,omitempty"` PayoutAt Time `json:"payout_at,string,omitempty"` Fee string `json:"fee,omitempty"` Subtotal string `json:"subtotal,omitempty"` }
Click to show internal directories.
Click to hide internal directories.