client

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountClient

type AccountClient struct {
	// contains filtered or unexported fields
}

func (*AccountClient) GetAccountHistory

func (c *AccountClient) GetAccountHistory(page, limit int) (*model.AccountHistoryList, error)

get account history doc: https://hopex-hk.github.io/docs/contract/v1/cn/#8e62101ca9

func (*AccountClient) GetUserInfo

func (c *AccountClient) GetUserInfo() (*model.UserInfo, error)

get account information https://hopex-hk.github.io/docs/contract/v1/cn/#hopex-7

func (*AccountClient) GetWalletInfo

func (c *AccountClient) GetWalletInfo() (*model.WalletInfo, error)

get account wallet information doc: https://hopex-hk.github.io/docs/contract/v1/cn/#224168edc1

func (*AccountClient) Init

func (c *AccountClient) Init(requester core.HttpRequester) *AccountClient

func (*AccountClient) InitByDefault

func (c *AccountClient) InitByDefault(cfg *core.Config) *AccountClient

type HomeClient

type HomeClient struct {
	// contains filtered or unexported fields
}

func (*HomeClient) GetIndexNotify

func (c *HomeClient) GetIndexNotify(page, limit int) (*model.GetIndexNotifyResponse, error)

获取公告 page: current page, starts from 1

func (*HomeClient) GetIndexStatistics

func (c *HomeClient) GetIndexStatistics() (*model.IndexStatistics, error)

获取成交统计数据

func (*HomeClient) Init

func (c *HomeClient) Init(requester core.HttpRequester) *HomeClient

func (*HomeClient) InitByDefault

func (c *HomeClient) InitByDefault(cfg *core.Config) *HomeClient

type MarketClient

type MarketClient struct {
	// contains filtered or unexported fields
}

func (*MarketClient) GetKline

func (c *MarketClient) GetKline(contractCode, interval string, startTime, endTime int64) (*model.KLine, error)

get kline data doc: https://hopex-hk.github.io/docs/contract/v1/cn/#hopex-k

func (*MarketClient) GetMarketDepth

func (c *MarketClient) GetMarketDepth(contractCode string, limit int) (*model.MarketDepth, error)

get market depth doc: https://hopex-hk.github.io/docs/contract/v1/cn/#hopex-2

func (*MarketClient) GetMarketTicker

func (c *MarketClient) GetMarketTicker(contractCode string) (*model.MarketTicker, error)

get contract market ticker doc: https://hopex-hk.github.io/docs/contract/v1/cn/#hopex

func (*MarketClient) GetMarkets

func (c *MarketClient) GetMarkets() ([]*model.MarketTicker1, error)

get all contract market ticker doc: https://hopex-hk.github.io/docs/contract/v1/cn/#hopex-4

func (*MarketClient) GetTrades

func (c *MarketClient) GetTrades(contractCode string, limit int) ([]*model.Trade, error)

get all contract market ticker doc: https://hopex-hk.github.io/docs/contract/v1/cn/#hopex-3

func (*MarketClient) Init

func (c *MarketClient) Init(requester core.HttpRequester) *MarketClient

func (*MarketClient) InitByDefault

func (c *MarketClient) InitByDefault(cfg *core.Config) *MarketClient

type TradeClient

type TradeClient struct {
	// contains filtered or unexported fields
}

func (*TradeClient) CancelConditionOrder

func (c *TradeClient) CancelConditionOrder(contractCode string, taskId int64) error

cancel condition order doc: https://hopex-hk.github.io/docs/contract/v1/cn/#6a6d683558

func (*TradeClient) CancelOrder

func (c *TradeClient) CancelOrder(contractCode string, orderId int64) error

cancel open order doc: https://hopex-hk.github.io/docs/contract/v1/cn/#11d9e25be8

func (*TradeClient) CreateConditionOrder

func (c *TradeClient) CreateConditionOrder(contractCode string, side int, _type string, trigPrice decimal.Decimal, expectedQuantity int, expectedPrice decimal.NullDecimal) error

put condition order doc: https://hopex-hk.github.io/docs/contract/v1/cn/#f9e87fb381

func (*TradeClient) CreateOrder

func (c *TradeClient) CreateOrder(contractCode string, side int, orderPrice decimal.NullDecimal, orderQuantity int) (int64, error)

put order doc: https://hopex-hk.github.io/docs/contract/v1/cn/#73292b0f57

func (*TradeClient) GetConditionOrders

func (c *TradeClient) GetConditionOrders(param *model.GetConditionOrdersParam, page, limit int) (*model.ConditionOrderList, error)

get condition orders doc: https://hopex-hk.github.io/docs/contract/v1/cn/#4d2cea97f7

func (*TradeClient) GetHistoryOrders

func (c *TradeClient) GetHistoryOrders(param *model.GetHistoryOrdersParam, page, limit int) (*model.HistoryOrderList, error)

get condition orders doc: https://hopex-hk.github.io/docs/contract/v1/cn/#4212d667d1

func (*TradeClient) GetLiquidationHistories

func (c *TradeClient) GetLiquidationHistories(param *model.GetLiquidationHistoryParam, page, limit int) (*model.LiquidationHistoryList, error)

get liquidation histories doc: https://hopex-hk.github.io/docs/contract/v1/cn/#17307ac747

func (*TradeClient) GetOpenOrders

func (c *TradeClient) GetOpenOrders(contractCode string) ([]*model.OpenOrder, error)

get open orders

func (*TradeClient) GetOrderParameter

func (c *TradeClient) GetOrderParameter(contractCode string) (map[string]interface{}, error)

get liquidation histories doc: https://hopex-hk.github.io/docs/contract/v1/cn/#ed645b50df

func (*TradeClient) GetPositions

func (c *TradeClient) GetPositions(contractCode string) ([]*model.Position, error)

get positions

func (*TradeClient) Init

func (c *TradeClient) Init(requester core.HttpRequester) *TradeClient

func (*TradeClient) InitByDefault

func (c *TradeClient) InitByDefault(cfg *core.Config) *TradeClient

func (*TradeClient) SetLeverage

func (c *TradeClient) SetLeverage(contractCode string, direct int, leverage float32) (decimal.Decimal, error)

set leverage doc: https://hopex-hk.github.io/docs/contract/v1/cn/#24da12c248

Jump to

Keyboard shortcuts

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