Documentation ¶
Index ¶
- type BoltStorage
- func (bs *BoltStorage) GetIntermedatorTx(id common.ActivityID) (common.TXEntry, error)
- func (bs *BoltStorage) GetPendingIntermediateTXs() (map[common.ActivityID]common.TXEntry, error)
- func (bs *BoltStorage) GetTradeHistory(fromTime, toTime uint64) (common.ExchangeTradeHistory, error)
- func (bs *BoltStorage) StoreIntermediateTx(id common.ActivityID, data common.TXEntry) error
- func (bs *BoltStorage) StorePendingIntermediateTx(id common.ActivityID, data common.TXEntry) error
- func (bs *BoltStorage) StoreTradeHistory(data common.ExchangeTradeHistory) error
- type Client
- func (ep *Client) CancelOrder(symbol string, id uint64) (exchange.HuobiCancel, error)
- func (ep *Client) DepositHistory(tokens []common.Token) (exchange.HuobiDeposits, error)
- func (ep *Client) GetAccountTradeHistory(base, quote common.Token) (exchange.HuobiTradeHistory, error)
- func (ep *Client) GetAccounts() (exchange.HuobiAccounts, error)
- func (ep *Client) GetDepositAddress(asset string) (exchange.HuobiDepositAddress, error)
- func (ep *Client) GetDepthOnePair(baseID, quoteID string) (exchange.HuobiDepth, error)
- func (ep *Client) GetExchangeInfo() (exchange.HuobiExchangeInfo, error)
- func (ep *Client) GetInfo() (exchange.HuobiInfo, error)
- func (ep *Client) GetResponse(method string, reqURL string, params map[string]string, signNeeded bool) ([]byte, error)
- func (ep *Client) OrderStatus(symbol string, id uint64) (exchange.HuobiOrder, error)
- func (ep *Client) Trade(tradeType string, base, quote common.Token, rate, amount float64, ...) (exchange.HuobiTrade, error)
- func (ep *Client) Withdraw(token common.Token, amount *big.Int, address ethereum.Address) (string, error)
- func (ep *Client) WithdrawHistory(tokens []common.Token) (exchange.HuobiWithdraws, error)
- type Endpoints
- type EndpointsInterface
- type Signer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltStorage ¶
type BoltStorage struct {
// contains filtered or unexported fields
}
BoltStorage strage object for using huobi including boltdb
func NewBoltStorage ¶
func NewBoltStorage(path string) (*BoltStorage, error)
NewBoltStorage return new storage instance
func (*BoltStorage) GetIntermedatorTx ¶
func (bs *BoltStorage) GetIntermedatorTx(id common.ActivityID) (common.TXEntry, error)
GetIntermedatorTx get intermediate transaction
func (*BoltStorage) GetPendingIntermediateTXs ¶
func (bs *BoltStorage) GetPendingIntermediateTXs() (map[common.ActivityID]common.TXEntry, error)
GetPendingIntermediateTXs return pending transaction for first deposit phase
func (*BoltStorage) GetTradeHistory ¶
func (bs *BoltStorage) GetTradeHistory(fromTime, toTime uint64) (common.ExchangeTradeHistory, error)
GetTradeHistory get trade history
func (*BoltStorage) StoreIntermediateTx ¶
func (bs *BoltStorage) StoreIntermediateTx(id common.ActivityID, data common.TXEntry) error
StoreIntermediateTx store intermediate transaction and remove it from pending bucket
func (*BoltStorage) StorePendingIntermediateTx ¶
func (bs *BoltStorage) StorePendingIntermediateTx(id common.ActivityID, data common.TXEntry) error
StorePendingIntermediateTx store pending transaction
func (*BoltStorage) StoreTradeHistory ¶
func (bs *BoltStorage) StoreTradeHistory(data common.ExchangeTradeHistory) error
StoreTradeHistory store trade history
type Client ¶ added in v0.1.2
type Client struct {
// contains filtered or unexported fields
}
Client endpoint object
func NewHuobiClient ¶ added in v0.1.2
func NewHuobiClient(signer Signer, interf EndpointsInterface) *Client
NewHuobiClient return new endpoint instance
func (*Client) CancelOrder ¶ added in v0.1.2
CancelOrder cancel open order on huobi
func (*Client) DepositHistory ¶ added in v0.1.2
DepositHistory get deposit history from huobi
func (*Client) GetAccountTradeHistory ¶ added in v0.1.2
func (ep *Client) GetAccountTradeHistory( base, quote common.Token) (exchange.HuobiTradeHistory, error)
GetAccountTradeHistory return account trade history
func (*Client) GetAccounts ¶ added in v0.1.2
func (ep *Client) GetAccounts() (exchange.HuobiAccounts, error)
GetAccounts Get account list for later use
func (*Client) GetDepositAddress ¶ added in v0.1.2
func (ep *Client) GetDepositAddress(asset string) (exchange.HuobiDepositAddress, error)
GetDepositAddress get huobi deposit address
func (*Client) GetDepthOnePair ¶ added in v0.1.2
func (ep *Client) GetDepthOnePair( baseID, quoteID string) (exchange.HuobiDepth, error)
GetDepthOnePair get depth one pair on huobi
func (*Client) GetExchangeInfo ¶ added in v0.1.2
func (ep *Client) GetExchangeInfo() (exchange.HuobiExchangeInfo, error)
GetExchangeInfo get huobi exchange info
func (*Client) GetResponse ¶ added in v0.1.2
func (ep *Client) GetResponse( method string, reqURL string, params map[string]string, signNeeded bool) ([]byte, error)
GetResponse from huobi api
func (*Client) OrderStatus ¶ added in v0.1.2
OrderStatus check order status on huobi
func (*Client) Trade ¶ added in v0.1.2
func (ep *Client) Trade(tradeType string, base, quote common.Token, rate, amount float64, timepoint uint64) (exchange.HuobiTrade, error)
Trade create a new order on huobi
func (*Client) Withdraw ¶ added in v0.1.2
func (ep *Client) Withdraw(token common.Token, amount *big.Int, address ethereum.Address) (string, error)
Withdraw token from huobi
func (*Client) WithdrawHistory ¶ added in v0.1.2
WithdrawHistory return withdraw history from huobi
type Endpoints ¶ added in v0.1.2
type Endpoints struct {
// contains filtered or unexported fields
}
func (*Endpoints) AuthenticatedEndpoint ¶ added in v0.1.2
func (*Endpoints) PublicEndpoint ¶ added in v0.1.2
type EndpointsInterface ¶ added in v0.1.2
type EndpointsInterface interface { // PublicEndpoint returns the endpoint that does not requires authentication. PublicEndpoint() string // AuthenticatedEndpoint returns the endpoint that requires authentication. // In simulation mode, authenticated endpoint is the Huobi mock server. AuthenticatedEndpoint() string }
EndpointsInterface is Huobi exchange API endpoints interface.
func NewEndpoints ¶ added in v0.1.2
func NewEndpoints(baseURL string) EndpointsInterface
NewEndpoints ...