Documentation ¶
Index ¶
- Constants
- func FormURL(s string) string
- func MakeRequests(chantype models.ChannelType, symbols TrivialMap) []models.WSRequest
- func MapToMarketData(event interface{}) (map[string]*models.Market, error)
- func PrepareQueryParams(params interface{}) (map[string]string, error)
- func PtrBool(b bool) *bool
- func PtrDecimal(d decimal.Decimal) *decimal.Decimal
- func PtrDuration(d time.Duration) *time.Duration
- func PtrFloat64(f float64) *float64
- func PtrInt(i int) *int
- func PtrInt64(i int64) *int64
- func PtrString(s string) *string
- type Account
- type Client
- func (c *Client) Delete(params interface{}, url string) ([]byte, error)
- func (c *Client) Get(params interface{}, url string, auth bool) ([]byte, error)
- func (c *Client) GetResponse(params interface{}, url string, method string, auth ...bool) ([]byte, error)
- func (c *Client) GetServerTime() (*time.Time, error)
- func (c *Client) Post(params interface{}, url string) ([]byte, error)
- func (c *Client) SetServerTimeDiff() error
- type Convert
- type Fills
- type Funding
- type Futures
- func (f *Futures) GetExpiredFutures() ([]*models.FutureExpired, error)
- func (f *Futures) GetFundingRates() ([]*models.FundingRates, error)
- func (f *Futures) GetFutureByName(name string, future *models.Future) (err error)
- func (f *Futures) GetFutureStats(future string, stats *models.FutureStats) (err error)
- func (f *Futures) GetFutures() ([]*models.Future, error)
- func (f *Futures) GetHistoricalIndex(indexName string, params *models.HistoricalIndexParams) ([]*models.HistoricalIndex, error)
- func (f *Futures) GetIndexWeights(index string) (*map[string]float64, error)
- type LeveragedTokens
- func (l *LeveragedTokens) GetLeveragedTokenBalances() ([]*models.LeveragedTokenBalance, error)
- func (l *LeveragedTokens) GetTokenInfo(token string) (*models.TokenInfo, error)
- func (l *LeveragedTokens) ListLeveragedTokenCreationRequests() ([]*models.LeveragedTokenCreationRequest, error)
- func (l *LeveragedTokens) ListLeveragedTokenRedemptionRequests() ([]*models.LeveragedTokenRedemptionRequest, error)
- func (l *LeveragedTokens) ListLeveragedTokens() ([]*models.LeveragedToken, error)
- func (l *LeveragedTokens) RequestLeveragedTokenCreation(token string, size decimal.Decimal) (*models.LeveragedTokenCreation, error)
- func (l *LeveragedTokens) RequestLeveragedTokenRedemption(token string, size decimal.Decimal) (*models.LeveragedTokenRedemption, error)
- type Markets
- func (m *Markets) GetHistoricalPrices(market string, params *models.GetHistoricalPricesParams) ([]*models.HistoricalPrice, error)
- func (m *Markets) GetMarketByName(name string, market *models.Market) (err error)
- func (m *Markets) GetMarkets() ([]*models.Market, error)
- func (m *Markets) GetOrderBook(market string, depth *int, ob *models.OrderBook) (err error)
- func (m *Markets) GetTrades(market string, params *models.GetTradesParams) ([]*models.Trade, error)
- type Option
- type Options
- func (o *Options) AcceptQuote(id int64) (*models.UserOptionQuote, error)
- func (o *Options) CancelQuote(id int64) (*models.UserOptionQuote, error)
- func (o *Options) CancelQuoteRequest(id int64) (*models.CancelQuoteRequest, error)
- func (o *Options) CreateQuote(id int64, price decimal.Decimal) (*models.UserOptionQuote, error)
- func (o *Options) CreateQuoteRequest(params *models.OptionQuoteRequestParams) (*models.CreateQuoteRequest, error)
- func (o *Options) Get24hOptionVolume() (*models.OptionsVolume, error)
- func (o *Options) GetAccountOptionsInfo() (*models.AccountOptionsInfo, error)
- func (o *Options) GetHistoricalOpenInterest(params *models.NumberTimeLimit) ([]*models.OptionsHistoricalOpenInterest, error)
- func (o *Options) GetOptionsFills(params *models.NumberTimeLimit) ([]*models.OptionFill, error)
- func (o *Options) GetOptionsHistoricalVolumes(params *models.NumberTimeLimit) ([]*models.OptionsHistoricalVolumes, error)
- func (o *Options) GetOptionsOpenInterest() (openInterest decimal.Decimal, err error)
- func (o *Options) GetOptionsPositions() ([]*models.OptionPosition, error)
- func (o *Options) GetPublicOptionsTrades(params *models.NumberTimeLimit) ([]*models.PublicOptionTrade, error)
- func (o *Options) GetQuotesForUserQuoteRequest(id int64) ([]*models.QuotesForOptionQuoteRequest, error)
- func (o *Options) GetUserQuotes() ([]*models.UserOptionQuote, error)
- func (o *Options) ListQuoteRequests() ([]*models.OptionQuoteRequest, error)
- func (o *Options) ListUserQuoteRequests() ([]*models.OptionQuoteRequest, error)
- type Orders
- func (o *Orders) CancelAllOrders(params *models.CancelAllParams) (result string, err error)
- func (o *Orders) CancelOrder(orderID int64) (result string, err error)
- func (o *Orders) CancelOrderByClientID(clientID int64) (result string, err error)
- func (o *Orders) CancelTriggerOrder(orderID int64) (result string, err error)
- func (o *Orders) GetOpenOrders(market *string) ([]*models.Order, error)
- func (o *Orders) GetOpenTriggerOrders(market, triggerType *string) ([]*models.TriggerOrder, error)
- func (o *Orders) GetOrderStatus(orderID int64, order *models.Order) (err error)
- func (o *Orders) GetOrderStatusByClientID(clientID int64, order *models.Order) (err error)
- func (o *Orders) GetOrdersHistory(params *models.OrdersHistoryParams) ([]*models.Order, error)
- func (o *Orders) GetTriggerOrderTriggers(orderID int64) ([]*models.Trigger, error)
- func (o *Orders) GetTriggerOrdersHistory(params *models.TriggerOrdersHistoryParams) ([]*models.TriggerOrder, error)
- func (o *Orders) ModifyOrder(orderID int64, params *models.ModifyOrderParams, order *models.Order) (err error)
- func (o *Orders) ModifyOrderByClientID(clientID int64, params *models.ModifyOrderParams, order *models.Order) (err error)
- func (o *Orders) ModifyTriggerOrder(orderID int64, params *models.ModifyTriggerOrderParams, ...) (err error)
- func (o *Orders) PlaceOrder(params *models.OrderParams, order *models.Order) (err error)
- func (o *Orders) PlaceTriggerOrder(params *models.TriggerOrderParams, order *models.TriggerOrder) (err error)
- type Request
- type Response
- type SpotMargin
- func (s *SpotMargin) GetBorrowHistory() ([]*models.BorrowHistory, error)
- func (s *SpotMargin) GetBorrowRates() ([]*models.BorrowRate, error)
- func (s *SpotMargin) GetBorrowSummary() ([]*models.BorrowedAmount, error)
- func (s *SpotMargin) GetLendingHistory() ([]*models.LendingHistory, error)
- func (s *SpotMargin) GetLendingInfo() ([]*models.LendingInfo, error)
- func (s *SpotMargin) GetLendingOffers() ([]*models.LendingOffer, error)
- func (s *SpotMargin) GetLendingRates() ([]*models.LendingRate, error)
- func (s *SpotMargin) GetMarketInfo(market string) (*models.SpotMarginMarketInfo, error)
- func (s *SpotMargin) SubmitLendingOffer(coin string, size decimal.Decimal, rate float64) (result string, err error)
- type Staking
- func (s *Staking) CancelUnstakeRequest(id int64) (result string, err error)
- func (s *Staking) GetStakeBalances() ([]*models.StakeBalance, error)
- func (s *Staking) GetStakes() ([]*models.Stake, error)
- func (s *Staking) GetStakingRewards() ([]*models.StakingReward, error)
- func (s *Staking) GetUnstakeRequests() ([]*models.UnstakeRequest, error)
- func (s *Staking) RequestStake(coin string, size decimal.Decimal) (*models.Stake, error)
- func (s *Staking) RequestUnstake(coin string, size decimal.Decimal) (*models.UnstakeRequest, error)
- type Stream
- func (s *Stream) Authorize() (err error)
- func (s *Stream) Connect(requests ...models.WSRequest) (err error)
- func (s *Stream) CreateNewConnection() (err error)
- func (s *Stream) GetAuthRequest() (*models.WSRequestAuthorize, error)
- func (s *Stream) GetEventResponse(ctx context.Context, msg *models.WsResponse) (err error)
- func (s *Stream) IsLoggedIn() bool
- func (s *Stream) Reconnect(ctx context.Context) (err error)
- func (s *Stream) SendToChannel(ct models.ChannelType, response interface{})
- func (s *Stream) Serve(ctx context.Context) (err error)
- func (s *Stream) SetReconnectionCount(count int)
- func (s *Stream) SetReconnectionInterval(interval time.Duration)
- func (s *Stream) Subscribe() (err error)
- func (s *Stream) SubscribeToFills(ctx context.Context) (chan *models.FillResponse, error)
- func (s *Stream) SubscribeToMarkets(ctx context.Context) (chan *models.Market, error)
- func (s *Stream) SubscribeToOrderBooks(ctx context.Context, symbols ...string) (chan *models.OrderBookResponse, error)
- func (s *Stream) SubscribeToOrders(ctx context.Context, symbols ...string) (chan *models.OrdersResponse, error)
- func (s *Stream) SubscribeToTickers(ctx context.Context, symbols ...string) (chan *models.TickerResponse, error)
- func (s *Stream) SubscribeToTrades(ctx context.Context, symbols ...string) (chan *models.TradeResponse, error)
- func (s *Stream) WSConn() *websocket.Conn
- type SubAccounts
- func (s *SubAccounts) ChangeSubaccount(nickname, newNickname string) (result string, err error)
- func (s *SubAccounts) CreateSubaccount(nickname string) (*models.SubAccount, error)
- func (s *SubAccounts) DeleteSubaccount(nickname string) (result string, err error)
- func (s *SubAccounts) GetSubaccountBalances(nickname string) ([]*models.Balance, error)
- func (s *SubAccounts) GetSubaccounts() ([]*models.SubAccount, error)
- func (s *SubAccounts) Transfer(payload *models.TransferPayload) (*models.TransferResponse, error)
- type TrivialMap
- type Wallet
- func (w *Wallet) CreateSavedAddresses(params *models.SavedAddressParams) ([]*models.SavedAddress, error)
- func (w *Wallet) DeleteSavedAddress(address int64) (result string, err error)
- func (w *Wallet) GetAirdrops(params *models.AirDropParams) ([]*models.AirDrop, error)
- func (w *Wallet) GetBalances() ([]*models.Balance, error)
- func (w *Wallet) GetBalancesAllAccts() (map[string][]*models.Balance, error)
- func (w *Wallet) GetCoins() ([]*models.Coin, error)
- func (w *Wallet) GetDepositAddress(coin string, method *models.DepositMethod) (address, tag string, err error)
- func (w *Wallet) GetDepositHistory(pars *models.DepositHistoryParams) ([]*models.Deposit, error)
- func (w *Wallet) GetSavedAddresses(coin *string) ([]*models.SavedAddress, error)
- func (w *Wallet) GetWithdrawalHistory(params *models.WithdrawalHistoryParams) ([]*models.Withdrawal, error)
- func (w *Wallet) RequestWithdrawal(params *models.RequestWithdrawalParams, withdrawal *models.Withdrawal) (err error)
- type WsSub
Constants ¶
View Source
const ( CommaOmitEmpty string = "," + OmitEmpty OmitEmpty string = "omitempty" ZeroString string = "" )
Variables ¶
This section is empty.
Functions ¶
func MakeRequests ¶
func MakeRequests( chantype models.ChannelType, symbols TrivialMap) []models.WSRequest
func PrepareQueryParams ¶
func PtrFloat64 ¶
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
func (*Account) ChangeAccountLeverage ¶
func (*Account) GetAccountInformation ¶
func (a *Account) GetAccountInformation(result *models.AccountInformation) (err error)
type Client ¶
type Client struct { SubAccount *string Logger *clog.Logger Buf *bytes.Buffer Account Convert Fills Funding Futures LeveragedTokens Markets Options Orders SpotMargin Staking SubAccounts Wallet Stream // contains filtered or unexported fields }
func (*Client) GetResponse ¶
func (*Client) SetServerTimeDiff ¶
type Convert ¶
type Convert struct {
// contains filtered or unexported fields
}
func (*Convert) AcceptQuote ¶
func (*Convert) GetQuoteStatus ¶
func (c *Convert) GetQuoteStatus(id int64) (*models.ConvertQuoteStatus, error)
type Funding ¶
type Funding struct {
// contains filtered or unexported fields
}
func (*Funding) GetFundingPayments ¶
type Futures ¶
type Futures struct {
// contains filtered or unexported fields
}
func (*Futures) GetExpiredFutures ¶
func (f *Futures) GetExpiredFutures() ([]*models.FutureExpired, error)
func (*Futures) GetFundingRates ¶
func (f *Futures) GetFundingRates() ([]*models.FundingRates, error)
func (*Futures) GetFutureByName ¶
func (*Futures) GetFutureStats ¶
func (f *Futures) GetFutureStats(future string, stats *models.FutureStats) (err error)
func (*Futures) GetHistoricalIndex ¶
func (f *Futures) GetHistoricalIndex( indexName string, params *models.HistoricalIndexParams) ([]*models.HistoricalIndex, error)
type LeveragedTokens ¶
type LeveragedTokens struct {
// contains filtered or unexported fields
}
func (*LeveragedTokens) GetLeveragedTokenBalances ¶
func (l *LeveragedTokens) GetLeveragedTokenBalances() ( []*models.LeveragedTokenBalance, error)
func (*LeveragedTokens) GetTokenInfo ¶
func (l *LeveragedTokens) GetTokenInfo(token string) (*models.TokenInfo, error)
func (*LeveragedTokens) ListLeveragedTokenCreationRequests ¶
func (l *LeveragedTokens) ListLeveragedTokenCreationRequests() ( []*models.LeveragedTokenCreationRequest, error)
func (*LeveragedTokens) ListLeveragedTokenRedemptionRequests ¶
func (l *LeveragedTokens) ListLeveragedTokenRedemptionRequests() ( []*models.LeveragedTokenRedemptionRequest, error)
func (*LeveragedTokens) ListLeveragedTokens ¶
func (l *LeveragedTokens) ListLeveragedTokens() ([]*models.LeveragedToken, error)
func (*LeveragedTokens) RequestLeveragedTokenCreation ¶
func (l *LeveragedTokens) RequestLeveragedTokenCreation( token string, size decimal.Decimal, ) (*models.LeveragedTokenCreation, error)
func (*LeveragedTokens) RequestLeveragedTokenRedemption ¶
func (l *LeveragedTokens) RequestLeveragedTokenRedemption( token string, size decimal.Decimal, ) (*models.LeveragedTokenRedemption, error)
type Markets ¶
type Markets struct {
// contains filtered or unexported fields
}
func (*Markets) GetHistoricalPrices ¶
func (m *Markets) GetHistoricalPrices( market string, params *models.GetHistoricalPricesParams, ) ([]*models.HistoricalPrice, error)
func (*Markets) GetMarketByName ¶
func (*Markets) GetOrderBook ¶
type Options ¶
type Options struct {
// contains filtered or unexported fields
}
func (*Options) AcceptQuote ¶
func (o *Options) AcceptQuote(id int64) (*models.UserOptionQuote, error)
func (*Options) CancelQuote ¶
func (o *Options) CancelQuote(id int64) (*models.UserOptionQuote, error)
func (*Options) CancelQuoteRequest ¶
func (o *Options) CancelQuoteRequest(id int64) (*models.CancelQuoteRequest, error)
func (*Options) CreateQuote ¶
func (*Options) CreateQuoteRequest ¶
func (o *Options) CreateQuoteRequest( params *models.OptionQuoteRequestParams, ) (*models.CreateQuoteRequest, error)
func (*Options) Get24hOptionVolume ¶
func (o *Options) Get24hOptionVolume() (*models.OptionsVolume, error)
func (*Options) GetAccountOptionsInfo ¶
func (o *Options) GetAccountOptionsInfo() (*models.AccountOptionsInfo, error)
func (*Options) GetHistoricalOpenInterest ¶
func (o *Options) GetHistoricalOpenInterest( params *models.NumberTimeLimit, ) ([]*models.OptionsHistoricalOpenInterest, error)
func (*Options) GetOptionsFills ¶
func (o *Options) GetOptionsFills( params *models.NumberTimeLimit, ) ([]*models.OptionFill, error)
func (*Options) GetOptionsHistoricalVolumes ¶
func (o *Options) GetOptionsHistoricalVolumes( params *models.NumberTimeLimit, ) ([]*models.OptionsHistoricalVolumes, error)
func (*Options) GetOptionsOpenInterest ¶
func (*Options) GetOptionsPositions ¶
func (o *Options) GetOptionsPositions() ([]*models.OptionPosition, error)
func (*Options) GetPublicOptionsTrades ¶
func (o *Options) GetPublicOptionsTrades( params *models.NumberTimeLimit, ) ([]*models.PublicOptionTrade, error)
func (*Options) GetQuotesForUserQuoteRequest ¶
func (o *Options) GetQuotesForUserQuoteRequest( id int64, ) ([]*models.QuotesForOptionQuoteRequest, error)
func (*Options) GetUserQuotes ¶
func (o *Options) GetUserQuotes() ([]*models.UserOptionQuote, error)
func (*Options) ListQuoteRequests ¶
func (o *Options) ListQuoteRequests() ([]*models.OptionQuoteRequest, error)
func (*Options) ListUserQuoteRequests ¶
func (o *Options) ListUserQuoteRequests() ([]*models.OptionQuoteRequest, error)
type Orders ¶
type Orders struct {
// contains filtered or unexported fields
}
func (*Orders) CancelAllOrders ¶
func (o *Orders) CancelAllOrders( params *models.CancelAllParams) (result string, err error)
func (*Orders) CancelOrderByClientID ¶
func (*Orders) CancelTriggerOrder ¶
func (*Orders) GetOpenOrders ¶
func (*Orders) GetOpenTriggerOrders ¶
func (o *Orders) GetOpenTriggerOrders( market, triggerType *string) ([]*models.TriggerOrder, error)
func (*Orders) GetOrderStatus ¶
func (*Orders) GetOrderStatusByClientID ¶
func (*Orders) GetOrdersHistory ¶
func (*Orders) GetTriggerOrderTriggers ¶
func (*Orders) GetTriggerOrdersHistory ¶
func (o *Orders) GetTriggerOrdersHistory( params *models.TriggerOrdersHistoryParams) ([]*models.TriggerOrder, error)
func (*Orders) ModifyOrder ¶
func (*Orders) ModifyOrderByClientID ¶
func (*Orders) ModifyTriggerOrder ¶
func (o *Orders) ModifyTriggerOrder( orderID int64, params *models.ModifyTriggerOrderParams, order *models.TriggerOrder) (err error)
func (*Orders) PlaceOrder ¶
func (*Orders) PlaceTriggerOrder ¶
func (o *Orders) PlaceTriggerOrder( params *models.TriggerOrderParams, order *models.TriggerOrder) (err error)
type Response ¶
type Response struct { Success bool `json:"success"` Result json.RawMessage `json:"result"` Error string `json:"error,omitempty"` }
type SpotMargin ¶
type SpotMargin struct {
// contains filtered or unexported fields
}
func (*SpotMargin) GetBorrowHistory ¶
func (s *SpotMargin) GetBorrowHistory() ([]*models.BorrowHistory, error)
func (*SpotMargin) GetBorrowRates ¶
func (s *SpotMargin) GetBorrowRates() ([]*models.BorrowRate, error)
func (*SpotMargin) GetBorrowSummary ¶
func (s *SpotMargin) GetBorrowSummary() ([]*models.BorrowedAmount, error)
func (*SpotMargin) GetLendingHistory ¶
func (s *SpotMargin) GetLendingHistory() ([]*models.LendingHistory, error)
func (*SpotMargin) GetLendingInfo ¶
func (s *SpotMargin) GetLendingInfo() ([]*models.LendingInfo, error)
func (*SpotMargin) GetLendingOffers ¶
func (s *SpotMargin) GetLendingOffers() ([]*models.LendingOffer, error)
func (*SpotMargin) GetLendingRates ¶
func (s *SpotMargin) GetLendingRates() ([]*models.LendingRate, error)
func (*SpotMargin) GetMarketInfo ¶
func (s *SpotMargin) GetMarketInfo(market string) (*models.SpotMarginMarketInfo, error)
func (*SpotMargin) SubmitLendingOffer ¶
type Staking ¶
type Staking struct {
// contains filtered or unexported fields
}
func (*Staking) CancelUnstakeRequest ¶
func (*Staking) GetStakeBalances ¶
func (s *Staking) GetStakeBalances() ([]*models.StakeBalance, error)
func (*Staking) GetStakingRewards ¶
func (s *Staking) GetStakingRewards() ([]*models.StakingReward, error)
func (*Staking) GetUnstakeRequests ¶
func (s *Staking) GetUnstakeRequests() ([]*models.UnstakeRequest, error)
func (*Staking) RequestStake ¶
func (*Staking) RequestUnstake ¶
type Stream ¶
type Stream struct { WsSub *WsSub // contains filtered or unexported fields }
func (*Stream) CreateNewConnection ¶
func (*Stream) GetAuthRequest ¶
func (s *Stream) GetAuthRequest() (*models.WSRequestAuthorize, error)
func (*Stream) GetEventResponse ¶
func (*Stream) IsLoggedIn ¶
func (*Stream) SendToChannel ¶
func (s *Stream) SendToChannel(ct models.ChannelType, response interface{})
func (*Stream) SetReconnectionCount ¶
func (*Stream) SetReconnectionInterval ¶
func (*Stream) SubscribeToFills ¶
func (*Stream) SubscribeToMarkets ¶
func (*Stream) SubscribeToOrderBooks ¶
func (*Stream) SubscribeToOrders ¶
func (*Stream) SubscribeToTickers ¶
func (*Stream) SubscribeToTrades ¶
type SubAccounts ¶
type SubAccounts struct {
// contains filtered or unexported fields
}
func (*SubAccounts) ChangeSubaccount ¶
func (s *SubAccounts) ChangeSubaccount(nickname, newNickname string) (result string, err error)
func (*SubAccounts) CreateSubaccount ¶
func (s *SubAccounts) CreateSubaccount(nickname string) (*models.SubAccount, error)
func (*SubAccounts) DeleteSubaccount ¶
func (s *SubAccounts) DeleteSubaccount(nickname string) (result string, err error)
func (*SubAccounts) GetSubaccountBalances ¶
func (s *SubAccounts) GetSubaccountBalances(nickname string) ([]*models.Balance, error)
func (*SubAccounts) GetSubaccounts ¶
func (s *SubAccounts) GetSubaccounts() ([]*models.SubAccount, error)
func (*SubAccounts) Transfer ¶
func (s *SubAccounts) Transfer(payload *models.TransferPayload) (*models.TransferResponse, error)
type TrivialMap ¶
type TrivialMap map[string]struct{}
type Wallet ¶
type Wallet struct {
// contains filtered or unexported fields
}
func (*Wallet) CreateSavedAddresses ¶
func (w *Wallet) CreateSavedAddresses( params *models.SavedAddressParams, ) ([]*models.SavedAddress, error)
func (*Wallet) DeleteSavedAddress ¶
func (*Wallet) GetAirdrops ¶
func (*Wallet) GetBalancesAllAccts ¶
func (*Wallet) GetDepositAddress ¶
func (*Wallet) GetDepositHistory ¶
func (*Wallet) GetSavedAddresses ¶
func (w *Wallet) GetSavedAddresses(coin *string) ([]*models.SavedAddress, error)
func (*Wallet) GetWithdrawalHistory ¶
func (w *Wallet) GetWithdrawalHistory( params *models.WithdrawalHistoryParams, ) ([]*models.Withdrawal, error)
func (*Wallet) RequestWithdrawal ¶
func (w *Wallet) RequestWithdrawal( params *models.RequestWithdrawalParams, withdrawal *models.Withdrawal, ) (err error)
type WsSub ¶
type WsSub struct { ChannelTypes map[models.ChannelType]TrivialMap Requests []models.WSRequest }
func (*WsSub) AppendRequests ¶
func (ws *WsSub) AppendRequests(ct models.ChannelType, symbols ...string)
Click to show internal directories.
Click to hide internal directories.