mirror of https://github.com/lightninglabs/loop
Merge pull request #409 from lightninglabs/grpc-gateway-update
multi: update lnd to master with grpc-gateway upgradepull/410/head
commit
7d044f58e8
@ -0,0 +1,645 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
|
||||
package looprpc
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// SwapClientClient is the client API for SwapClient service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type SwapClientClient interface {
|
||||
// loop: `out`
|
||||
//LoopOut initiates an loop out swap with the given parameters. The call
|
||||
//returns after the swap has been set up with the swap server. From that
|
||||
//point onwards, progress can be tracked via the SwapStatus stream that is
|
||||
//returned from Monitor().
|
||||
LoopOut(ctx context.Context, in *LoopOutRequest, opts ...grpc.CallOption) (*SwapResponse, error)
|
||||
// loop: `in`
|
||||
//LoopIn initiates a loop in swap with the given parameters. The call
|
||||
//returns after the swap has been set up with the swap server. From that
|
||||
//point onwards, progress can be tracked via the SwapStatus stream
|
||||
//that is returned from Monitor().
|
||||
LoopIn(ctx context.Context, in *LoopInRequest, opts ...grpc.CallOption) (*SwapResponse, error)
|
||||
// loop: `monitor`
|
||||
//Monitor will return a stream of swap updates for currently active swaps.
|
||||
Monitor(ctx context.Context, in *MonitorRequest, opts ...grpc.CallOption) (SwapClient_MonitorClient, error)
|
||||
// loop: `listswaps`
|
||||
//ListSwaps returns a list of all currently known swaps and their current
|
||||
//status.
|
||||
ListSwaps(ctx context.Context, in *ListSwapsRequest, opts ...grpc.CallOption) (*ListSwapsResponse, error)
|
||||
// loop: `swapinfo`
|
||||
//SwapInfo returns all known details about a single swap.
|
||||
SwapInfo(ctx context.Context, in *SwapInfoRequest, opts ...grpc.CallOption) (*SwapStatus, error)
|
||||
// loop: `terms`
|
||||
//LoopOutTerms returns the terms that the server enforces for a loop out swap.
|
||||
LoopOutTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*OutTermsResponse, error)
|
||||
// loop: `quote`
|
||||
//LoopOutQuote returns a quote for a loop out swap with the provided
|
||||
//parameters.
|
||||
LoopOutQuote(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (*OutQuoteResponse, error)
|
||||
// loop: `terms`
|
||||
//GetTerms returns the terms that the server enforces for swaps.
|
||||
GetLoopInTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*InTermsResponse, error)
|
||||
// loop: `quote`
|
||||
//GetQuote returns a quote for a swap with the provided parameters.
|
||||
GetLoopInQuote(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (*InQuoteResponse, error)
|
||||
// loop: `listauth`
|
||||
//GetLsatTokens returns all LSAT tokens the daemon ever paid for.
|
||||
GetLsatTokens(ctx context.Context, in *TokensRequest, opts ...grpc.CallOption) (*TokensResponse, error)
|
||||
// loop: `getparams`
|
||||
//GetLiquidityParams gets the parameters that the daemon's liquidity manager
|
||||
//is currently configured with. This may be nil if nothing is configured.
|
||||
//[EXPERIMENTAL]: endpoint is subject to change.
|
||||
GetLiquidityParams(ctx context.Context, in *GetLiquidityParamsRequest, opts ...grpc.CallOption) (*LiquidityParameters, error)
|
||||
// loop: `setparams`
|
||||
//SetLiquidityParams sets a new set of parameters for the daemon's liquidity
|
||||
//manager. Note that the full set of parameters must be provided, because
|
||||
//this call fully overwrites our existing parameters.
|
||||
//[EXPERIMENTAL]: endpoint is subject to change.
|
||||
SetLiquidityParams(ctx context.Context, in *SetLiquidityParamsRequest, opts ...grpc.CallOption) (*SetLiquidityParamsResponse, error)
|
||||
// loop: `suggestswaps`
|
||||
//SuggestSwaps returns a list of recommended swaps based on the current
|
||||
//state of your node's channels and it's liquidity manager parameters.
|
||||
//Note that only loop out suggestions are currently supported.
|
||||
//[EXPERIMENTAL]: endpoint is subject to change.
|
||||
SuggestSwaps(ctx context.Context, in *SuggestSwapsRequest, opts ...grpc.CallOption) (*SuggestSwapsResponse, error)
|
||||
}
|
||||
|
||||
type swapClientClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSwapClientClient(cc grpc.ClientConnInterface) SwapClientClient {
|
||||
return &swapClientClient{cc}
|
||||
}
|
||||
|
||||
func (c *swapClientClient) LoopOut(ctx context.Context, in *LoopOutRequest, opts ...grpc.CallOption) (*SwapResponse, error) {
|
||||
out := new(SwapResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/LoopOut", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) LoopIn(ctx context.Context, in *LoopInRequest, opts ...grpc.CallOption) (*SwapResponse, error) {
|
||||
out := new(SwapResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/LoopIn", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) Monitor(ctx context.Context, in *MonitorRequest, opts ...grpc.CallOption) (SwapClient_MonitorClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &SwapClient_ServiceDesc.Streams[0], "/looprpc.SwapClient/Monitor", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &swapClientMonitorClient{stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type SwapClient_MonitorClient interface {
|
||||
Recv() (*SwapStatus, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type swapClientMonitorClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *swapClientMonitorClient) Recv() (*SwapStatus, error) {
|
||||
m := new(SwapStatus)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) ListSwaps(ctx context.Context, in *ListSwapsRequest, opts ...grpc.CallOption) (*ListSwapsResponse, error) {
|
||||
out := new(ListSwapsResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/ListSwaps", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) SwapInfo(ctx context.Context, in *SwapInfoRequest, opts ...grpc.CallOption) (*SwapStatus, error) {
|
||||
out := new(SwapStatus)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/SwapInfo", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) LoopOutTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*OutTermsResponse, error) {
|
||||
out := new(OutTermsResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/LoopOutTerms", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) LoopOutQuote(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (*OutQuoteResponse, error) {
|
||||
out := new(OutQuoteResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/LoopOutQuote", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) GetLoopInTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*InTermsResponse, error) {
|
||||
out := new(InTermsResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/GetLoopInTerms", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) GetLoopInQuote(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (*InQuoteResponse, error) {
|
||||
out := new(InQuoteResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/GetLoopInQuote", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) GetLsatTokens(ctx context.Context, in *TokensRequest, opts ...grpc.CallOption) (*TokensResponse, error) {
|
||||
out := new(TokensResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/GetLsatTokens", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) GetLiquidityParams(ctx context.Context, in *GetLiquidityParamsRequest, opts ...grpc.CallOption) (*LiquidityParameters, error) {
|
||||
out := new(LiquidityParameters)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/GetLiquidityParams", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) SetLiquidityParams(ctx context.Context, in *SetLiquidityParamsRequest, opts ...grpc.CallOption) (*SetLiquidityParamsResponse, error) {
|
||||
out := new(SetLiquidityParamsResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/SetLiquidityParams", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapClientClient) SuggestSwaps(ctx context.Context, in *SuggestSwapsRequest, opts ...grpc.CallOption) (*SuggestSwapsResponse, error) {
|
||||
out := new(SuggestSwapsResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/SuggestSwaps", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SwapClientServer is the server API for SwapClient service.
|
||||
// All implementations must embed UnimplementedSwapClientServer
|
||||
// for forward compatibility
|
||||
type SwapClientServer interface {
|
||||
// loop: `out`
|
||||
//LoopOut initiates an loop out swap with the given parameters. The call
|
||||
//returns after the swap has been set up with the swap server. From that
|
||||
//point onwards, progress can be tracked via the SwapStatus stream that is
|
||||
//returned from Monitor().
|
||||
LoopOut(context.Context, *LoopOutRequest) (*SwapResponse, error)
|
||||
// loop: `in`
|
||||
//LoopIn initiates a loop in swap with the given parameters. The call
|
||||
//returns after the swap has been set up with the swap server. From that
|
||||
//point onwards, progress can be tracked via the SwapStatus stream
|
||||
//that is returned from Monitor().
|
||||
LoopIn(context.Context, *LoopInRequest) (*SwapResponse, error)
|
||||
// loop: `monitor`
|
||||
//Monitor will return a stream of swap updates for currently active swaps.
|
||||
Monitor(*MonitorRequest, SwapClient_MonitorServer) error
|
||||
// loop: `listswaps`
|
||||
//ListSwaps returns a list of all currently known swaps and their current
|
||||
//status.
|
||||
ListSwaps(context.Context, *ListSwapsRequest) (*ListSwapsResponse, error)
|
||||
// loop: `swapinfo`
|
||||
//SwapInfo returns all known details about a single swap.
|
||||
SwapInfo(context.Context, *SwapInfoRequest) (*SwapStatus, error)
|
||||
// loop: `terms`
|
||||
//LoopOutTerms returns the terms that the server enforces for a loop out swap.
|
||||
LoopOutTerms(context.Context, *TermsRequest) (*OutTermsResponse, error)
|
||||
// loop: `quote`
|
||||
//LoopOutQuote returns a quote for a loop out swap with the provided
|
||||
//parameters.
|
||||
LoopOutQuote(context.Context, *QuoteRequest) (*OutQuoteResponse, error)
|
||||
// loop: `terms`
|
||||
//GetTerms returns the terms that the server enforces for swaps.
|
||||
GetLoopInTerms(context.Context, *TermsRequest) (*InTermsResponse, error)
|
||||
// loop: `quote`
|
||||
//GetQuote returns a quote for a swap with the provided parameters.
|
||||
GetLoopInQuote(context.Context, *QuoteRequest) (*InQuoteResponse, error)
|
||||
// loop: `listauth`
|
||||
//GetLsatTokens returns all LSAT tokens the daemon ever paid for.
|
||||
GetLsatTokens(context.Context, *TokensRequest) (*TokensResponse, error)
|
||||
// loop: `getparams`
|
||||
//GetLiquidityParams gets the parameters that the daemon's liquidity manager
|
||||
//is currently configured with. This may be nil if nothing is configured.
|
||||
//[EXPERIMENTAL]: endpoint is subject to change.
|
||||
GetLiquidityParams(context.Context, *GetLiquidityParamsRequest) (*LiquidityParameters, error)
|
||||
// loop: `setparams`
|
||||
//SetLiquidityParams sets a new set of parameters for the daemon's liquidity
|
||||
//manager. Note that the full set of parameters must be provided, because
|
||||
//this call fully overwrites our existing parameters.
|
||||
//[EXPERIMENTAL]: endpoint is subject to change.
|
||||
SetLiquidityParams(context.Context, *SetLiquidityParamsRequest) (*SetLiquidityParamsResponse, error)
|
||||
// loop: `suggestswaps`
|
||||
//SuggestSwaps returns a list of recommended swaps based on the current
|
||||
//state of your node's channels and it's liquidity manager parameters.
|
||||
//Note that only loop out suggestions are currently supported.
|
||||
//[EXPERIMENTAL]: endpoint is subject to change.
|
||||
SuggestSwaps(context.Context, *SuggestSwapsRequest) (*SuggestSwapsResponse, error)
|
||||
mustEmbedUnimplementedSwapClientServer()
|
||||
}
|
||||
|
||||
// UnimplementedSwapClientServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedSwapClientServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedSwapClientServer) LoopOut(context.Context, *LoopOutRequest) (*SwapResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LoopOut not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) LoopIn(context.Context, *LoopInRequest) (*SwapResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LoopIn not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) Monitor(*MonitorRequest, SwapClient_MonitorServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method Monitor not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) ListSwaps(context.Context, *ListSwapsRequest) (*ListSwapsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListSwaps not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) SwapInfo(context.Context, *SwapInfoRequest) (*SwapStatus, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SwapInfo not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) LoopOutTerms(context.Context, *TermsRequest) (*OutTermsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LoopOutTerms not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) LoopOutQuote(context.Context, *QuoteRequest) (*OutQuoteResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LoopOutQuote not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) GetLoopInTerms(context.Context, *TermsRequest) (*InTermsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetLoopInTerms not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) GetLoopInQuote(context.Context, *QuoteRequest) (*InQuoteResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetLoopInQuote not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) GetLsatTokens(context.Context, *TokensRequest) (*TokensResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetLsatTokens not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) GetLiquidityParams(context.Context, *GetLiquidityParamsRequest) (*LiquidityParameters, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetLiquidityParams not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) SetLiquidityParams(context.Context, *SetLiquidityParamsRequest) (*SetLiquidityParamsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SetLiquidityParams not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) SuggestSwaps(context.Context, *SuggestSwapsRequest) (*SuggestSwapsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method SuggestSwaps not implemented")
|
||||
}
|
||||
func (UnimplementedSwapClientServer) mustEmbedUnimplementedSwapClientServer() {}
|
||||
|
||||
// UnsafeSwapClientServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SwapClientServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSwapClientServer interface {
|
||||
mustEmbedUnimplementedSwapClientServer()
|
||||
}
|
||||
|
||||
func RegisterSwapClientServer(s grpc.ServiceRegistrar, srv SwapClientServer) {
|
||||
s.RegisterService(&SwapClient_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _SwapClient_LoopOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LoopOutRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).LoopOut(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/LoopOut",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).LoopOut(ctx, req.(*LoopOutRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapClient_LoopIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LoopInRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).LoopIn(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/LoopIn",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).LoopIn(ctx, req.(*LoopInRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapClient_Monitor_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(MonitorRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(SwapClientServer).Monitor(m, &swapClientMonitorServer{stream})
|
||||
}
|
||||
|
||||
type SwapClient_MonitorServer interface {
|
||||
Send(*SwapStatus) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type swapClientMonitorServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *swapClientMonitorServer) Send(m *SwapStatus) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func _SwapClient_ListSwaps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListSwapsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).ListSwaps(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/ListSwaps",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).ListSwaps(ctx, req.(*ListSwapsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapClient_SwapInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SwapInfoRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).SwapInfo(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/SwapInfo",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).SwapInfo(ctx, req.(*SwapInfoRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapClient_LoopOutTerms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TermsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).LoopOutTerms(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/LoopOutTerms",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).LoopOutTerms(ctx, req.(*TermsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapClient_LoopOutQuote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QuoteRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).LoopOutQuote(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/LoopOutQuote",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).LoopOutQuote(ctx, req.(*QuoteRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapClient_GetLoopInTerms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TermsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).GetLoopInTerms(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/GetLoopInTerms",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).GetLoopInTerms(ctx, req.(*TermsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapClient_GetLoopInQuote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(QuoteRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).GetLoopInQuote(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/GetLoopInQuote",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).GetLoopInQuote(ctx, req.(*QuoteRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapClient_GetLsatTokens_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(TokensRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).GetLsatTokens(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/GetLsatTokens",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).GetLsatTokens(ctx, req.(*TokensRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapClient_GetLiquidityParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetLiquidityParamsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).GetLiquidityParams(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/GetLiquidityParams",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).GetLiquidityParams(ctx, req.(*GetLiquidityParamsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapClient_SetLiquidityParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SetLiquidityParamsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).SetLiquidityParams(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/SetLiquidityParams",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).SetLiquidityParams(ctx, req.(*SetLiquidityParamsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapClient_SuggestSwaps_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(SuggestSwapsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapClientServer).SuggestSwaps(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapClient/SuggestSwaps",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapClientServer).SuggestSwaps(ctx, req.(*SuggestSwapsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// SwapClient_ServiceDesc is the grpc.ServiceDesc for SwapClient service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SwapClient_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "looprpc.SwapClient",
|
||||
HandlerType: (*SwapClientServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "LoopOut",
|
||||
Handler: _SwapClient_LoopOut_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoopIn",
|
||||
Handler: _SwapClient_LoopIn_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListSwaps",
|
||||
Handler: _SwapClient_ListSwaps_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SwapInfo",
|
||||
Handler: _SwapClient_SwapInfo_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoopOutTerms",
|
||||
Handler: _SwapClient_LoopOutTerms_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoopOutQuote",
|
||||
Handler: _SwapClient_LoopOutQuote_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetLoopInTerms",
|
||||
Handler: _SwapClient_GetLoopInTerms_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetLoopInQuote",
|
||||
Handler: _SwapClient_GetLoopInQuote_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetLsatTokens",
|
||||
Handler: _SwapClient_GetLsatTokens_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetLiquidityParams",
|
||||
Handler: _SwapClient_GetLiquidityParams_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SetLiquidityParams",
|
||||
Handler: _SwapClient_SetLiquidityParams_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "SuggestSwaps",
|
||||
Handler: _SwapClient_SuggestSwaps_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "Monitor",
|
||||
Handler: _SwapClient_Monitor_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "client.proto",
|
||||
}
|
@ -0,0 +1,109 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
|
||||
package looprpc
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// DebugClient is the client API for Debug service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type DebugClient interface {
|
||||
//
|
||||
//ForceAutoLoop is intended for *testing purposes only* and will not work on
|
||||
//mainnet. This endpoint ticks our autoloop timer, triggering automated
|
||||
//dispatch of a swap if one is suggested.
|
||||
ForceAutoLoop(ctx context.Context, in *ForceAutoLoopRequest, opts ...grpc.CallOption) (*ForceAutoLoopResponse, error)
|
||||
}
|
||||
|
||||
type debugClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewDebugClient(cc grpc.ClientConnInterface) DebugClient {
|
||||
return &debugClient{cc}
|
||||
}
|
||||
|
||||
func (c *debugClient) ForceAutoLoop(ctx context.Context, in *ForceAutoLoopRequest, opts ...grpc.CallOption) (*ForceAutoLoopResponse, error) {
|
||||
out := new(ForceAutoLoopResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.Debug/ForceAutoLoop", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// DebugServer is the server API for Debug service.
|
||||
// All implementations must embed UnimplementedDebugServer
|
||||
// for forward compatibility
|
||||
type DebugServer interface {
|
||||
//
|
||||
//ForceAutoLoop is intended for *testing purposes only* and will not work on
|
||||
//mainnet. This endpoint ticks our autoloop timer, triggering automated
|
||||
//dispatch of a swap if one is suggested.
|
||||
ForceAutoLoop(context.Context, *ForceAutoLoopRequest) (*ForceAutoLoopResponse, error)
|
||||
mustEmbedUnimplementedDebugServer()
|
||||
}
|
||||
|
||||
// UnimplementedDebugServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedDebugServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedDebugServer) ForceAutoLoop(context.Context, *ForceAutoLoopRequest) (*ForceAutoLoopResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ForceAutoLoop not implemented")
|
||||
}
|
||||
func (UnimplementedDebugServer) mustEmbedUnimplementedDebugServer() {}
|
||||
|
||||
// UnsafeDebugServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to DebugServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeDebugServer interface {
|
||||
mustEmbedUnimplementedDebugServer()
|
||||
}
|
||||
|
||||
func RegisterDebugServer(s grpc.ServiceRegistrar, srv DebugServer) {
|
||||
s.RegisterService(&Debug_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Debug_ForceAutoLoop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ForceAutoLoopRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(DebugServer).ForceAutoLoop(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.Debug/ForceAutoLoop",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DebugServer).ForceAutoLoop(ctx, req.(*ForceAutoLoopRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Debug_ServiceDesc is the grpc.ServiceDesc for Debug service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Debug_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "looprpc.Debug",
|
||||
HandlerType: (*DebugServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ForceAutoLoop",
|
||||
Handler: _Debug_ForceAutoLoop_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "debug.proto",
|
||||
}
|
@ -0,0 +1,480 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
|
||||
package looprpc
|
||||
|
||||
import (
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
status "google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
// SwapServerClient is the client API for SwapServer service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type SwapServerClient interface {
|
||||
LoopOutTerms(ctx context.Context, in *ServerLoopOutTermsRequest, opts ...grpc.CallOption) (*ServerLoopOutTerms, error)
|
||||
NewLoopOutSwap(ctx context.Context, in *ServerLoopOutRequest, opts ...grpc.CallOption) (*ServerLoopOutResponse, error)
|
||||
LoopOutPushPreimage(ctx context.Context, in *ServerLoopOutPushPreimageRequest, opts ...grpc.CallOption) (*ServerLoopOutPushPreimageResponse, error)
|
||||
LoopOutQuote(ctx context.Context, in *ServerLoopOutQuoteRequest, opts ...grpc.CallOption) (*ServerLoopOutQuote, error)
|
||||
LoopInTerms(ctx context.Context, in *ServerLoopInTermsRequest, opts ...grpc.CallOption) (*ServerLoopInTerms, error)
|
||||
NewLoopInSwap(ctx context.Context, in *ServerLoopInRequest, opts ...grpc.CallOption) (*ServerLoopInResponse, error)
|
||||
LoopInQuote(ctx context.Context, in *ServerLoopInQuoteRequest, opts ...grpc.CallOption) (*ServerLoopInQuoteResponse, error)
|
||||
SubscribeLoopOutUpdates(ctx context.Context, in *SubscribeUpdatesRequest, opts ...grpc.CallOption) (SwapServer_SubscribeLoopOutUpdatesClient, error)
|
||||
SubscribeLoopInUpdates(ctx context.Context, in *SubscribeUpdatesRequest, opts ...grpc.CallOption) (SwapServer_SubscribeLoopInUpdatesClient, error)
|
||||
CancelLoopOutSwap(ctx context.Context, in *CancelLoopOutSwapRequest, opts ...grpc.CallOption) (*CancelLoopOutSwapResponse, error)
|
||||
}
|
||||
|
||||
type swapServerClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewSwapServerClient(cc grpc.ClientConnInterface) SwapServerClient {
|
||||
return &swapServerClient{cc}
|
||||
}
|
||||
|
||||
func (c *swapServerClient) LoopOutTerms(ctx context.Context, in *ServerLoopOutTermsRequest, opts ...grpc.CallOption) (*ServerLoopOutTerms, error) {
|
||||
out := new(ServerLoopOutTerms)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/LoopOutTerms", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapServerClient) NewLoopOutSwap(ctx context.Context, in *ServerLoopOutRequest, opts ...grpc.CallOption) (*ServerLoopOutResponse, error) {
|
||||
out := new(ServerLoopOutResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/NewLoopOutSwap", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapServerClient) LoopOutPushPreimage(ctx context.Context, in *ServerLoopOutPushPreimageRequest, opts ...grpc.CallOption) (*ServerLoopOutPushPreimageResponse, error) {
|
||||
out := new(ServerLoopOutPushPreimageResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/LoopOutPushPreimage", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapServerClient) LoopOutQuote(ctx context.Context, in *ServerLoopOutQuoteRequest, opts ...grpc.CallOption) (*ServerLoopOutQuote, error) {
|
||||
out := new(ServerLoopOutQuote)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/LoopOutQuote", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapServerClient) LoopInTerms(ctx context.Context, in *ServerLoopInTermsRequest, opts ...grpc.CallOption) (*ServerLoopInTerms, error) {
|
||||
out := new(ServerLoopInTerms)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/LoopInTerms", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapServerClient) NewLoopInSwap(ctx context.Context, in *ServerLoopInRequest, opts ...grpc.CallOption) (*ServerLoopInResponse, error) {
|
||||
out := new(ServerLoopInResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/NewLoopInSwap", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapServerClient) LoopInQuote(ctx context.Context, in *ServerLoopInQuoteRequest, opts ...grpc.CallOption) (*ServerLoopInQuoteResponse, error) {
|
||||
out := new(ServerLoopInQuoteResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/LoopInQuote", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *swapServerClient) SubscribeLoopOutUpdates(ctx context.Context, in *SubscribeUpdatesRequest, opts ...grpc.CallOption) (SwapServer_SubscribeLoopOutUpdatesClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &SwapServer_ServiceDesc.Streams[0], "/looprpc.SwapServer/SubscribeLoopOutUpdates", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &swapServerSubscribeLoopOutUpdatesClient{stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type SwapServer_SubscribeLoopOutUpdatesClient interface {
|
||||
Recv() (*SubscribeLoopOutUpdatesResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type swapServerSubscribeLoopOutUpdatesClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *swapServerSubscribeLoopOutUpdatesClient) Recv() (*SubscribeLoopOutUpdatesResponse, error) {
|
||||
m := new(SubscribeLoopOutUpdatesResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *swapServerClient) SubscribeLoopInUpdates(ctx context.Context, in *SubscribeUpdatesRequest, opts ...grpc.CallOption) (SwapServer_SubscribeLoopInUpdatesClient, error) {
|
||||
stream, err := c.cc.NewStream(ctx, &SwapServer_ServiceDesc.Streams[1], "/looprpc.SwapServer/SubscribeLoopInUpdates", opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
x := &swapServerSubscribeLoopInUpdatesClient{stream}
|
||||
if err := x.ClientStream.SendMsg(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := x.ClientStream.CloseSend(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return x, nil
|
||||
}
|
||||
|
||||
type SwapServer_SubscribeLoopInUpdatesClient interface {
|
||||
Recv() (*SubscribeLoopInUpdatesResponse, error)
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
type swapServerSubscribeLoopInUpdatesClient struct {
|
||||
grpc.ClientStream
|
||||
}
|
||||
|
||||
func (x *swapServerSubscribeLoopInUpdatesClient) Recv() (*SubscribeLoopInUpdatesResponse, error) {
|
||||
m := new(SubscribeLoopInUpdatesResponse)
|
||||
if err := x.ClientStream.RecvMsg(m); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
||||
func (c *swapServerClient) CancelLoopOutSwap(ctx context.Context, in *CancelLoopOutSwapRequest, opts ...grpc.CallOption) (*CancelLoopOutSwapResponse, error) {
|
||||
out := new(CancelLoopOutSwapResponse)
|
||||
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/CancelLoopOutSwap", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SwapServerServer is the server API for SwapServer service.
|
||||
// All implementations must embed UnimplementedSwapServerServer
|
||||
// for forward compatibility
|
||||
type SwapServerServer interface {
|
||||
LoopOutTerms(context.Context, *ServerLoopOutTermsRequest) (*ServerLoopOutTerms, error)
|
||||
NewLoopOutSwap(context.Context, *ServerLoopOutRequest) (*ServerLoopOutResponse, error)
|
||||
LoopOutPushPreimage(context.Context, *ServerLoopOutPushPreimageRequest) (*ServerLoopOutPushPreimageResponse, error)
|
||||
LoopOutQuote(context.Context, *ServerLoopOutQuoteRequest) (*ServerLoopOutQuote, error)
|
||||
LoopInTerms(context.Context, *ServerLoopInTermsRequest) (*ServerLoopInTerms, error)
|
||||
NewLoopInSwap(context.Context, *ServerLoopInRequest) (*ServerLoopInResponse, error)
|
||||
LoopInQuote(context.Context, *ServerLoopInQuoteRequest) (*ServerLoopInQuoteResponse, error)
|
||||
SubscribeLoopOutUpdates(*SubscribeUpdatesRequest, SwapServer_SubscribeLoopOutUpdatesServer) error
|
||||
SubscribeLoopInUpdates(*SubscribeUpdatesRequest, SwapServer_SubscribeLoopInUpdatesServer) error
|
||||
CancelLoopOutSwap(context.Context, *CancelLoopOutSwapRequest) (*CancelLoopOutSwapResponse, error)
|
||||
mustEmbedUnimplementedSwapServerServer()
|
||||
}
|
||||
|
||||
// UnimplementedSwapServerServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedSwapServerServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedSwapServerServer) LoopOutTerms(context.Context, *ServerLoopOutTermsRequest) (*ServerLoopOutTerms, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LoopOutTerms not implemented")
|
||||
}
|
||||
func (UnimplementedSwapServerServer) NewLoopOutSwap(context.Context, *ServerLoopOutRequest) (*ServerLoopOutResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NewLoopOutSwap not implemented")
|
||||
}
|
||||
func (UnimplementedSwapServerServer) LoopOutPushPreimage(context.Context, *ServerLoopOutPushPreimageRequest) (*ServerLoopOutPushPreimageResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LoopOutPushPreimage not implemented")
|
||||
}
|
||||
func (UnimplementedSwapServerServer) LoopOutQuote(context.Context, *ServerLoopOutQuoteRequest) (*ServerLoopOutQuote, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LoopOutQuote not implemented")
|
||||
}
|
||||
func (UnimplementedSwapServerServer) LoopInTerms(context.Context, *ServerLoopInTermsRequest) (*ServerLoopInTerms, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LoopInTerms not implemented")
|
||||
}
|
||||
func (UnimplementedSwapServerServer) NewLoopInSwap(context.Context, *ServerLoopInRequest) (*ServerLoopInResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NewLoopInSwap not implemented")
|
||||
}
|
||||
func (UnimplementedSwapServerServer) LoopInQuote(context.Context, *ServerLoopInQuoteRequest) (*ServerLoopInQuoteResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method LoopInQuote not implemented")
|
||||
}
|
||||
func (UnimplementedSwapServerServer) SubscribeLoopOutUpdates(*SubscribeUpdatesRequest, SwapServer_SubscribeLoopOutUpdatesServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method SubscribeLoopOutUpdates not implemented")
|
||||
}
|
||||
func (UnimplementedSwapServerServer) SubscribeLoopInUpdates(*SubscribeUpdatesRequest, SwapServer_SubscribeLoopInUpdatesServer) error {
|
||||
return status.Errorf(codes.Unimplemented, "method SubscribeLoopInUpdates not implemented")
|
||||
}
|
||||
func (UnimplementedSwapServerServer) CancelLoopOutSwap(context.Context, *CancelLoopOutSwapRequest) (*CancelLoopOutSwapResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CancelLoopOutSwap not implemented")
|
||||
}
|
||||
func (UnimplementedSwapServerServer) mustEmbedUnimplementedSwapServerServer() {}
|
||||
|
||||
// UnsafeSwapServerServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to SwapServerServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeSwapServerServer interface {
|
||||
mustEmbedUnimplementedSwapServerServer()
|
||||
}
|
||||
|
||||
func RegisterSwapServerServer(s grpc.ServiceRegistrar, srv SwapServerServer) {
|
||||
s.RegisterService(&SwapServer_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _SwapServer_LoopOutTerms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ServerLoopOutTermsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapServerServer).LoopOutTerms(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapServer/LoopOutTerms",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapServerServer).LoopOutTerms(ctx, req.(*ServerLoopOutTermsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapServer_NewLoopOutSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ServerLoopOutRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapServerServer).NewLoopOutSwap(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapServer/NewLoopOutSwap",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapServerServer).NewLoopOutSwap(ctx, req.(*ServerLoopOutRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapServer_LoopOutPushPreimage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ServerLoopOutPushPreimageRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapServerServer).LoopOutPushPreimage(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapServer/LoopOutPushPreimage",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapServerServer).LoopOutPushPreimage(ctx, req.(*ServerLoopOutPushPreimageRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapServer_LoopOutQuote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ServerLoopOutQuoteRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapServerServer).LoopOutQuote(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapServer/LoopOutQuote",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapServerServer).LoopOutQuote(ctx, req.(*ServerLoopOutQuoteRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapServer_LoopInTerms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ServerLoopInTermsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapServerServer).LoopInTerms(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapServer/LoopInTerms",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapServerServer).LoopInTerms(ctx, req.(*ServerLoopInTermsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapServer_NewLoopInSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ServerLoopInRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapServerServer).NewLoopInSwap(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapServer/NewLoopInSwap",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapServerServer).NewLoopInSwap(ctx, req.(*ServerLoopInRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapServer_LoopInQuote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ServerLoopInQuoteRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapServerServer).LoopInQuote(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapServer/LoopInQuote",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapServerServer).LoopInQuote(ctx, req.(*ServerLoopInQuoteRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SwapServer_SubscribeLoopOutUpdates_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(SubscribeUpdatesRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(SwapServerServer).SubscribeLoopOutUpdates(m, &swapServerSubscribeLoopOutUpdatesServer{stream})
|
||||
}
|
||||
|
||||
type SwapServer_SubscribeLoopOutUpdatesServer interface {
|
||||
Send(*SubscribeLoopOutUpdatesResponse) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type swapServerSubscribeLoopOutUpdatesServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *swapServerSubscribeLoopOutUpdatesServer) Send(m *SubscribeLoopOutUpdatesResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func _SwapServer_SubscribeLoopInUpdates_Handler(srv interface{}, stream grpc.ServerStream) error {
|
||||
m := new(SubscribeUpdatesRequest)
|
||||
if err := stream.RecvMsg(m); err != nil {
|
||||
return err
|
||||
}
|
||||
return srv.(SwapServerServer).SubscribeLoopInUpdates(m, &swapServerSubscribeLoopInUpdatesServer{stream})
|
||||
}
|
||||
|
||||
type SwapServer_SubscribeLoopInUpdatesServer interface {
|
||||
Send(*SubscribeLoopInUpdatesResponse) error
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
type swapServerSubscribeLoopInUpdatesServer struct {
|
||||
grpc.ServerStream
|
||||
}
|
||||
|
||||
func (x *swapServerSubscribeLoopInUpdatesServer) Send(m *SubscribeLoopInUpdatesResponse) error {
|
||||
return x.ServerStream.SendMsg(m)
|
||||
}
|
||||
|
||||
func _SwapServer_CancelLoopOutSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CancelLoopOutSwapRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SwapServerServer).CancelLoopOutSwap(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/looprpc.SwapServer/CancelLoopOutSwap",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SwapServerServer).CancelLoopOutSwap(ctx, req.(*CancelLoopOutSwapRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// SwapServer_ServiceDesc is the grpc.ServiceDesc for SwapServer service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var SwapServer_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "looprpc.SwapServer",
|
||||
HandlerType: (*SwapServerServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "LoopOutTerms",
|
||||
Handler: _SwapServer_LoopOutTerms_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NewLoopOutSwap",
|
||||
Handler: _SwapServer_NewLoopOutSwap_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoopOutPushPreimage",
|
||||
Handler: _SwapServer_LoopOutPushPreimage_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoopOutQuote",
|
||||
Handler: _SwapServer_LoopOutQuote_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoopInTerms",
|
||||
Handler: _SwapServer_LoopInTerms_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NewLoopInSwap",
|
||||
Handler: _SwapServer_NewLoopInSwap_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "LoopInQuote",
|
||||
Handler: _SwapServer_LoopInQuote_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CancelLoopOutSwap",
|
||||
Handler: _SwapServer_CancelLoopOutSwap_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{
|
||||
{
|
||||
StreamName: "SubscribeLoopOutUpdates",
|
||||
Handler: _SwapServer_SubscribeLoopOutUpdates_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
{
|
||||
StreamName: "SubscribeLoopInUpdates",
|
||||
Handler: _SwapServer_SubscribeLoopInUpdates_Handler,
|
||||
ServerStreams: true,
|
||||
},
|
||||
},
|
||||
Metadata: "server.proto",
|
||||
}
|
Loading…
Reference in New Issue