mirror of
https://github.com/lightninglabs/pool.git
synced 2026-08-17 13:06:52 +02:00
clmrpc: re-generate with updated grpc-gateway
This commit is contained in:
parent
adcb145e76
commit
69ebc705e8
4 changed files with 491 additions and 13 deletions
|
|
@ -9,6 +9,8 @@ import (
|
|||
proto "github.com/golang/protobuf/proto"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
math "math"
|
||||
)
|
||||
|
||||
|
|
@ -3515,6 +3517,38 @@ type ChannelAuctioneerServer interface {
|
|||
RelevantBatchSnapshot(context.Context, *RelevantBatchRequest) (*RelevantBatch, error)
|
||||
}
|
||||
|
||||
// UnimplementedChannelAuctioneerServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedChannelAuctioneerServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedChannelAuctioneerServer) ReserveAccount(ctx context.Context, req *ReserveAccountRequest) (*ReserveAccountResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ReserveAccount not implemented")
|
||||
}
|
||||
func (*UnimplementedChannelAuctioneerServer) InitAccount(ctx context.Context, req *ServerInitAccountRequest) (*ServerInitAccountResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method InitAccount not implemented")
|
||||
}
|
||||
func (*UnimplementedChannelAuctioneerServer) ModifyAccount(ctx context.Context, req *ServerModifyAccountRequest) (*ServerModifyAccountResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ModifyAccount not implemented")
|
||||
}
|
||||
func (*UnimplementedChannelAuctioneerServer) SubmitOrder(ctx context.Context, req *ServerSubmitOrderRequest) (*ServerSubmitOrderResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SubmitOrder not implemented")
|
||||
}
|
||||
func (*UnimplementedChannelAuctioneerServer) CancelOrder(ctx context.Context, req *ServerCancelOrderRequest) (*ServerCancelOrderResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CancelOrder not implemented")
|
||||
}
|
||||
func (*UnimplementedChannelAuctioneerServer) OrderState(ctx context.Context, req *ServerOrderStateRequest) (*ServerOrderStateResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method OrderState not implemented")
|
||||
}
|
||||
func (*UnimplementedChannelAuctioneerServer) SubscribeBatchAuction(srv ChannelAuctioneer_SubscribeBatchAuctionServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method SubscribeBatchAuction not implemented")
|
||||
}
|
||||
func (*UnimplementedChannelAuctioneerServer) FeeQuote(ctx context.Context, req *FeeQuoteRequest) (*FeeQuoteResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method FeeQuote not implemented")
|
||||
}
|
||||
func (*UnimplementedChannelAuctioneerServer) RelevantBatchSnapshot(ctx context.Context, req *RelevantBatchRequest) (*RelevantBatch, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RelevantBatchSnapshot not implemented")
|
||||
}
|
||||
|
||||
func RegisterChannelAuctioneerServer(s *grpc.Server, srv ChannelAuctioneerServer) {
|
||||
s.RegisterService(&_ChannelAuctioneer_serviceDesc, srv)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ import (
|
|||
proto "github.com/golang/protobuf/proto"
|
||||
_ "google.golang.org/genproto/googleapis/api/annotations"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
math "math"
|
||||
)
|
||||
|
||||
|
|
@ -1367,6 +1369,35 @@ type TraderServer interface {
|
|||
CancelOrder(context.Context, *CancelOrderRequest) (*CancelOrderResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedTraderServer can be embedded to have forward compatible implementations.
|
||||
type UnimplementedTraderServer struct {
|
||||
}
|
||||
|
||||
func (*UnimplementedTraderServer) InitAccount(ctx context.Context, req *InitAccountRequest) (*Account, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method InitAccount not implemented")
|
||||
}
|
||||
func (*UnimplementedTraderServer) ListAccounts(ctx context.Context, req *ListAccountsRequest) (*ListAccountsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListAccounts not implemented")
|
||||
}
|
||||
func (*UnimplementedTraderServer) CloseAccount(ctx context.Context, req *CloseAccountRequest) (*CloseAccountResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CloseAccount not implemented")
|
||||
}
|
||||
func (*UnimplementedTraderServer) WithdrawAccount(ctx context.Context, req *WithdrawAccountRequest) (*WithdrawAccountResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method WithdrawAccount not implemented")
|
||||
}
|
||||
func (*UnimplementedTraderServer) RecoverAccounts(ctx context.Context, req *RecoverAccountsRequest) (*RecoverAccountsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RecoverAccounts not implemented")
|
||||
}
|
||||
func (*UnimplementedTraderServer) SubmitOrder(ctx context.Context, req *SubmitOrderRequest) (*SubmitOrderResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SubmitOrder not implemented")
|
||||
}
|
||||
func (*UnimplementedTraderServer) ListOrders(ctx context.Context, req *ListOrdersRequest) (*ListOrdersResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListOrders not implemented")
|
||||
}
|
||||
func (*UnimplementedTraderServer) CancelOrder(ctx context.Context, req *CancelOrderRequest) (*CancelOrderResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CancelOrder not implemented")
|
||||
}
|
||||
|
||||
func RegisterTraderServer(s *grpc.Server, srv TraderServer) {
|
||||
s.RegisterService(&_Trader_serviceDesc, srv)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import (
|
|||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
|
|
@ -22,11 +23,13 @@ import (
|
|||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
func request_Trader_InitAccount_0(ctx context.Context, marshaler runtime.Marshaler, client TraderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq InitAccountRequest
|
||||
|
|
@ -45,6 +48,23 @@ func request_Trader_InitAccount_0(ctx context.Context, marshaler runtime.Marshal
|
|||
|
||||
}
|
||||
|
||||
func local_request_Trader_InitAccount_0(ctx context.Context, marshaler runtime.Marshaler, server TraderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq InitAccountRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.InitAccount(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Trader_ListAccounts_0(ctx context.Context, marshaler runtime.Marshaler, client TraderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListAccountsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
|
@ -54,6 +74,15 @@ func request_Trader_ListAccounts_0(ctx context.Context, marshaler runtime.Marsha
|
|||
|
||||
}
|
||||
|
||||
func local_request_Trader_ListAccounts_0(ctx context.Context, marshaler runtime.Marshaler, server TraderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListAccountsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.ListAccounts(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Trader_CloseAccount_0 = &utilities.DoubleArray{Encoding: map[string]int{"trader_key": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
|
||||
)
|
||||
|
|
@ -80,7 +109,10 @@ func request_Trader_CloseAccount_0(ctx context.Context, marshaler runtime.Marsha
|
|||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "trader_key", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Trader_CloseAccount_0); err != nil {
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Trader_CloseAccount_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
|
|
@ -89,6 +121,37 @@ func request_Trader_CloseAccount_0(ctx context.Context, marshaler runtime.Marsha
|
|||
|
||||
}
|
||||
|
||||
func local_request_Trader_CloseAccount_0(ctx context.Context, marshaler runtime.Marshaler, server TraderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CloseAccountRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["trader_key"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "trader_key")
|
||||
}
|
||||
|
||||
protoReq.TraderKey, err = runtime.Bytes(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "trader_key", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Trader_CloseAccount_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.CloseAccount(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Trader_WithdrawAccount_0(ctx context.Context, marshaler runtime.Marshaler, client TraderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq WithdrawAccountRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
|
@ -124,6 +187,41 @@ func request_Trader_WithdrawAccount_0(ctx context.Context, marshaler runtime.Mar
|
|||
|
||||
}
|
||||
|
||||
func local_request_Trader_WithdrawAccount_0(ctx context.Context, marshaler runtime.Marshaler, server TraderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq WithdrawAccountRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["trader_key"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "trader_key")
|
||||
}
|
||||
|
||||
protoReq.TraderKey, err = runtime.Bytes(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "trader_key", err)
|
||||
}
|
||||
|
||||
msg, err := server.WithdrawAccount(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Trader_RecoverAccounts_0(ctx context.Context, marshaler runtime.Marshaler, client TraderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq RecoverAccountsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
|
@ -141,6 +239,23 @@ func request_Trader_RecoverAccounts_0(ctx context.Context, marshaler runtime.Mar
|
|||
|
||||
}
|
||||
|
||||
func local_request_Trader_RecoverAccounts_0(ctx context.Context, marshaler runtime.Marshaler, server TraderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq RecoverAccountsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.RecoverAccounts(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Trader_SubmitOrder_0(ctx context.Context, marshaler runtime.Marshaler, client TraderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SubmitOrderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
|
@ -158,6 +273,23 @@ func request_Trader_SubmitOrder_0(ctx context.Context, marshaler runtime.Marshal
|
|||
|
||||
}
|
||||
|
||||
func local_request_Trader_SubmitOrder_0(ctx context.Context, marshaler runtime.Marshaler, server TraderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq SubmitOrderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.SubmitOrder(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Trader_ListOrders_0(ctx context.Context, marshaler runtime.Marshaler, client TraderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListOrdersRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
|
@ -167,6 +299,15 @@ func request_Trader_ListOrders_0(ctx context.Context, marshaler runtime.Marshale
|
|||
|
||||
}
|
||||
|
||||
func local_request_Trader_ListOrders_0(ctx context.Context, marshaler runtime.Marshaler, server TraderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListOrdersRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
msg, err := server.ListOrders(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_Trader_CancelOrder_0(ctx context.Context, marshaler runtime.Marshaler, client TraderClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CancelOrderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
|
@ -194,6 +335,201 @@ func request_Trader_CancelOrder_0(ctx context.Context, marshaler runtime.Marshal
|
|||
|
||||
}
|
||||
|
||||
func local_request_Trader_CancelOrder_0(ctx context.Context, marshaler runtime.Marshaler, server TraderServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CancelOrderRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["order_nonce"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "order_nonce")
|
||||
}
|
||||
|
||||
protoReq.OrderNonce, err = runtime.Bytes(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "order_nonce", err)
|
||||
}
|
||||
|
||||
msg, err := server.CancelOrder(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterTraderHandlerServer registers the http handlers for service Trader to "mux".
|
||||
// UnaryRPC :call TraderServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterTraderHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TraderServer) error {
|
||||
|
||||
mux.Handle("POST", pattern_Trader_InitAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Trader_InitAccount_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Trader_InitAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Trader_ListAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Trader_ListAccounts_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Trader_ListAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_Trader_CloseAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Trader_CloseAccount_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Trader_CloseAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Trader_WithdrawAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Trader_WithdrawAccount_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Trader_WithdrawAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Trader_RecoverAccounts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Trader_RecoverAccounts_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Trader_RecoverAccounts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_Trader_SubmitOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Trader_SubmitOrder_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Trader_SubmitOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_Trader_ListOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Trader_ListOrders_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Trader_ListOrders_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_Trader_CancelOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_Trader_CancelOrder_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_Trader_CancelOrder_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterTraderHandlerFromEndpoint is same as RegisterTraderHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterTraderHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
|
|
@ -396,21 +732,21 @@ func RegisterTraderHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli
|
|||
}
|
||||
|
||||
var (
|
||||
pattern_Trader_InitAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clm", "accounts"}, ""))
|
||||
pattern_Trader_InitAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clm", "accounts"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Trader_ListAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clm", "accounts"}, ""))
|
||||
pattern_Trader_ListAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clm", "accounts"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Trader_CloseAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "clm", "accounts", "trader_key"}, ""))
|
||||
pattern_Trader_CloseAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "clm", "accounts", "trader_key"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Trader_WithdrawAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "clm", "accounts", "withdraw", "trader_key"}, ""))
|
||||
pattern_Trader_WithdrawAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "clm", "accounts", "withdraw", "trader_key"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Trader_RecoverAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "clm", "accounts", "recover"}, ""))
|
||||
pattern_Trader_RecoverAccounts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "clm", "accounts", "recover"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Trader_SubmitOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clm", "orders"}, ""))
|
||||
pattern_Trader_SubmitOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clm", "orders"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Trader_ListOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clm", "orders"}, ""))
|
||||
pattern_Trader_ListOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "clm", "orders"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_Trader_CancelOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "clm", "orders", "order_nonce"}, ""))
|
||||
pattern_Trader_CancelOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "clm", "orders", "order_nonce"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
|||
|
|
@ -4,10 +4,6 @@
|
|||
"title": "trader.proto",
|
||||
"version": "version not set"
|
||||
},
|
||||
"schemes": [
|
||||
"http",
|
||||
"https"
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
|
|
@ -24,6 +20,12 @@
|
|||
"schema": {
|
||||
"$ref": "#/definitions/clmrpcListAccountsResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gatewayruntimeError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
|
|
@ -38,6 +40,12 @@
|
|||
"schema": {
|
||||
"$ref": "#/definitions/clmrpcAccount"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gatewayruntimeError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
|
|
@ -64,6 +72,12 @@
|
|||
"schema": {
|
||||
"$ref": "#/definitions/clmrpcRecoverAccountsResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gatewayruntimeError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
|
|
@ -90,6 +104,12 @@
|
|||
"schema": {
|
||||
"$ref": "#/definitions/clmrpcWithdrawAccountResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gatewayruntimeError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
|
|
@ -124,6 +144,12 @@
|
|||
"schema": {
|
||||
"$ref": "#/definitions/clmrpcCloseAccountResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gatewayruntimeError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
|
|
@ -150,6 +176,12 @@
|
|||
"schema": {
|
||||
"$ref": "#/definitions/clmrpcListOrdersResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gatewayruntimeError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"tags": [
|
||||
|
|
@ -164,6 +196,12 @@
|
|||
"schema": {
|
||||
"$ref": "#/definitions/clmrpcSubmitOrderResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gatewayruntimeError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
|
|
@ -190,6 +228,12 @@
|
|||
"schema": {
|
||||
"$ref": "#/definitions/clmrpcCancelOrderResponse"
|
||||
}
|
||||
},
|
||||
"default": {
|
||||
"description": "An unexpected error response",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/gatewayruntimeError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
|
|
@ -527,6 +571,39 @@
|
|||
"description": "The transaction used to withdraw funds from the account."
|
||||
}
|
||||
}
|
||||
},
|
||||
"gatewayruntimeError": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"error": {
|
||||
"type": "string"
|
||||
},
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/protobufAny"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"protobufAny": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"type_url": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"type": "string",
|
||||
"format": "byte"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue