Documentation ¶
Index ¶
- func AllTicker()
- func BatchOrder(market string, tradeType TradeType, tradeParams [][]decimal.Decimal, ...)
- func CancelAllOrders(market string, opts ...Option[*Values]) any
- func DepositAddress(currency string)
- func HmacMD5(message, secretKey string) (hmacSign string)
- func Markets() map[string]MarketConfig
- func TickerData(market string)
- func UserInfo()
- type Account
- type AccountType
- type Config
- type MarketConfig
- type Option
- func WithAccount(account *Account) Option[*Values]
- func WithAcctType(acctType AccountType) Option[*Values]
- func WithAmount(amount decimal.Decimal) Option[*Values]
- func WithContinueErr() Option[*Values]
- func WithCurrency(currency string) Option[*Values]
- func WithCurrencyMarket(market string) Option[*Values]
- func WithCustomerOrderId(orderId string) Option[*Values]
- func WithEnableExpress() Option[*Values]
- func WithEnableRepay() Option[*Values]
- func WithMarket(market string) Option[*Values]
- func WithObj(key string, obj any) Option[*Values]
- func WithOrderType(orderType OrderType) Option[*Values]
- func WithPrice(price decimal.Decimal) Option[*Values]
- func WithTrade() Option[*Values]
- func WithTradeType(tradeType TradeType) Option[*Values]
- type OrderResp
- type OrderType
- type Response
- type Ticker
- type TickerModel
- type Tickers
- type TradeType
- type Values
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchOrder ¶
func DepositAddress ¶
func DepositAddress(currency string)
func Markets ¶
func Markets() map[string]MarketConfig
func TickerData ¶
func TickerData(market string)
Types ¶
type Account ¶
type Account struct { Account string `yaml:"account"` AccessKey string `yaml:"accessKey"` SecretKey string `yaml:"secretKey"` API string `yaml:"api"` Trade string `yaml:"trade"` KLine string `yaml:"kline"` WSAPI string `yaml:"wsapi"` }
var (
DefaultAccount *Account
)
type AccountType ¶
type AccountType string
const ( AccountTypeMain AccountType = "0" AccountTypeLever AccountType = "1" AccountTypeCross AccountType = "2" )
type MarketConfig ¶
type Option ¶
type Option[T any] func(T)
func WithAccount ¶
func WithAcctType ¶
func WithAcctType(acctType AccountType) Option[*Values]
func WithContinueErr ¶
func WithCurrency ¶
func WithCurrencyMarket ¶
func WithCustomerOrderId ¶
func WithEnableExpress ¶
func WithEnableRepay ¶
func WithMarket ¶
func WithOrderType ¶
func WithTradeType ¶
type OrderResp ¶
func Order ¶
func Order(market string, price, amount decimal.Decimal, tradeType TradeType, opts ...Option[*Values]) OrderResp
Order spot trade
Optional parameters: WithAcctType: default AccountTypeMain WithEnableExpress: default false WithEnableRepay: default false WithOrderType: default OrderTypeLimit WithCustomerOrderId: default ""
type Ticker ¶
type Ticker struct { Date string `json:"date"` Ticker TickerModel `json:"ticker"` }
type TickerModel ¶
type TickerModel struct { High decimal.Decimal `json:"high"` Vol decimal.Decimal `json:"vol"` Last decimal.Decimal `json:"last"` Low decimal.Decimal `json:"low"` Buy decimal.Decimal `json:"buy"` Sell decimal.Decimal `json:"sell"` Turnover decimal.Decimal `json:"turnover"` Open decimal.Decimal `json:"open"` RiseRate decimal.Decimal `json:"riseRate"` }
type Tickers ¶
type Tickers map[string]TickerModel
Click to show internal directories.
Click to hide internal directories.