Documentation ¶
Index ¶
- type DBTX
- type GetServerOpenTradesWithStatusParams
- type Queries
- type Server
- func (s *Server) CancelTrade(ctx context.Context, req *connect.Request[v1.CancelTradeRequest]) (*connect.Response[v1.CreateTradeResponse], error)
- func (s Server) CreateTrade(ctx context.Context, req *connect.Request[v1.CreateTradeRequest]) (*connect.Response[v1.CreateTradeResponse], error)
- func (s *Server) FulfillTrade(ctx context.Context, req *connect.Request[v1.FulfillTradeRequest]) (*connect.Response[v1.FulfillTradeResponse], error)
- func (s *Server) GetOpenTrades(ctx context.Context, req *connect.Request[v1.GetOpenTradesRequest]) (*connect.Response[v1.GetOpenTradesResponse], error)
- func (s *Server) WatchTrade(ctx context.Context, req *connect.Request[v1.WatchTradeRequest], ...) error
- type Trade
- type TradeFulfillment
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) GetServerOpenTradesWithStatus ¶
type Server ¶
type Server struct {
Q *Queries
}
func (*Server) CancelTrade ¶
func (s *Server) CancelTrade(ctx context.Context, req *connect.Request[v1.CancelTradeRequest]) (*connect.Response[v1.CreateTradeResponse], error)
Cancel an open trade
func (Server) CreateTrade ¶
func (s Server) CreateTrade(ctx context.Context, req *connect.Request[v1.CreateTradeRequest]) (*connect.Response[v1.CreateTradeResponse], error)
Create a new trade (either buy, or sell), registered to the server that requested it
func (*Server) FulfillTrade ¶
func (s *Server) FulfillTrade(ctx context.Context, req *connect.Request[v1.FulfillTradeRequest]) (*connect.Response[v1.FulfillTradeResponse], error)
Fulfill an open trade. This will trigger both servers to At the moment, this is only buying with coins, or selling for coins
func (*Server) GetOpenTrades ¶
func (*Server) WatchTrade ¶
func (s *Server) WatchTrade(ctx context.Context, req *connect.Request[v1.WatchTradeRequest], stream *connect.ServerStream[v1.WatchTradeResponse]) error
Stream events for an open trade
type Trade ¶
type Trade struct { ID pgtype.UUID Status pgtype.Text Type pgtype.Text InitiatingServer pgtype.UUID Item pgtype.Text TradeQuantity pgtype.Int4 Price pgtype.Int4 FulfilledQuantity pgtype.Int4 CreatedAt pgtype.Timestamp FulfilledAt pgtype.Timestamp CancelledAt pgtype.Timestamp UpdatedAt pgtype.Timestamp }
Click to show internal directories.
Click to hide internal directories.