Documentation ¶
Index ¶
- Variables
- type BalancesOpts
- type Client
- func (c *Client) Balances(opts BalancesOpts) (*pbtrade.BalancesReply, error)
- func (c *Client) CloseConnection() error
- func (c *Client) MarketPrice(opts MarketPriceOpts) (*pbtrade.MarketPriceReply, error)
- func (c *Client) Markets() (*pbtrade.MarketsReply, error)
- func (c *Client) TradeComplete(opts TradeCompleteOpts) (*pbtrade.TradeCompleteReply, error)
- func (c *Client) TradePropose(opts TradeProposeOpts) (*pbtrade.TradeProposeReply, error)
- type MarketPriceOpts
- type TradeCompleteOpts
- type TradeProposeOpts
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNullTradeCompleteOpts ... ErrNullTradeCompleteOpts = errors.New("swap complete and swap fail messages must not be both null") // ErrInvalidTradeCompleteOpts ... ErrInvalidTradeCompleteOpts = errors.New("swap complete and swap fail messages must not be both defined") // ErrInvalidSwapCompleteMessage ... ErrInvalidSwapCompleteMessage = errors.New("swap complete must be a valid serialized message") // ErrInvalidSwapFailMessage ... ErrInvalidSwapFailMessage = errors.New("swap fail must be a valid serialized message") )
var ( // ErrMalformedSwapRequestMessage ... ErrMalformedSwapRequestMessage = errors.New("swap request must be a valid serialized message") )
Functions ¶
This section is empty.
Types ¶
type BalancesOpts ¶
type BalancesOpts struct {
Market trademarket.Market
}
BalancesOpts is the struct given to Balances method
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client allows to connect with a trader service and to call its RPCs
func NewTradeClient ¶
NewTradeClient returns a new Client connected to the server at the given host and port through an insecure connection
func (*Client) Balances ¶
func (c *Client) Balances(opts BalancesOpts) (*pbtrade.BalancesReply, error)
Balances crafts the request and calls the Balances rpc
func (*Client) CloseConnection ¶
CloseConnection closes the connections between the current client and the server
func (*Client) MarketPrice ¶
func (c *Client) MarketPrice(opts MarketPriceOpts) (*pbtrade.MarketPriceReply, error)
MarketPrice crafts the request and calls the MarketPrice rpc
func (*Client) Markets ¶
func (c *Client) Markets() (*pbtrade.MarketsReply, error)
Markets calls the Markets rpc and returns its response
func (*Client) TradeComplete ¶
func (c *Client) TradeComplete(opts TradeCompleteOpts) (*pbtrade.TradeCompleteReply, error)
TradeComplete crafts the request and calls the TradeComplete rpc
func (*Client) TradePropose ¶
func (c *Client) TradePropose(opts TradeProposeOpts) (*pbtrade.TradeProposeReply, error)
TradePropose crafts the request and calls the TradePropose rpc
type MarketPriceOpts ¶
type MarketPriceOpts struct { Market trademarket.Market TradeType tradetype.TradeType Amount uint64 Asset string }
MarketPriceOpts is the struct given to MarketPrice method
type TradeCompleteOpts ¶
TradeCompleteOpts is the struct given to TradeComplete method
type TradeProposeOpts ¶
type TradeProposeOpts struct { Market trademarket.Market SwapRequest []byte TradeType tradetype.TradeType }
TradeProposeOpts is the struct given to TradePropose method