Browse Source

loopd+looprpc: add REST compatible status calls

pull/140/head
Oliver Gugger 1 year ago
parent
commit
3e25bc3174
No known key found for this signature in database GPG Key ID: 8E4256593F177720
5 changed files with 575 additions and 96 deletions
  1. +44
    -0
      loopd/swapclient_server.go
  2. +290
    -93
      looprpc/client.pb.go
  3. +125
    -0
      looprpc/client.pb.gw.go
  4. +43
    -3
      looprpc/client.proto
  5. +73
    -0
      looprpc/client.swagger.json

+ 44
- 0
loopd/swapclient_server.go View File

@ -241,6 +241,50 @@ func (s *swapClientServer) Monitor(in *looprpc.MonitorRequest,
}
}
// ListSwaps returns a list of all currently known swaps and their current
// status.
func (s *swapClientServer) ListSwaps(_ context.Context,
_ *looprpc.ListSwapsRequest) (*looprpc.ListSwapsResponse, error) {
var (
rpcSwaps = make([]*looprpc.SwapStatus, len(s.swaps))
idx = 0
err error
)
// We can just use the server's in-memory cache as that contains the
// most up-to-date state including temporary failures which aren't
// persisted to disk. The swaps field is a map, that's why we need an
// additional index.
for _, swp := range s.swaps {
swp := swp
rpcSwaps[idx], err = s.marshallSwap(&swp)
if err != nil {
return nil, err
}
idx++
}
return &looprpc.ListSwapsResponse{Swaps: rpcSwaps}, nil
}
// SwapInfo returns all known details about a single swap.
func (s *swapClientServer) SwapInfo(_ context.Context,
req *looprpc.SwapInfoRequest) (*looprpc.SwapStatus, error) {
swapHash, err := lntypes.MakeHash(req.Id)
if err != nil {
return nil, fmt.Errorf("error parsing swap hash: %v", err)
}
// Just return the server's in-memory cache here too as we also want to
// return temporary failures to the client.
swp, ok := s.swaps[swapHash]
if !ok {
return nil, fmt.Errorf("swap with hash %s not found", req.Id)
}
return s.marshallSwap(&swp)
}
// LoopOutTerms returns the terms that the server enforces for loop out swaps.
func (s *swapClientServer) LoopOutTerms(ctx context.Context,
req *looprpc.TermsRequest) (*looprpc.TermsResponse, error) {

+ 290
- 93
looprpc/client.pb.go View File

@ -572,6 +572,120 @@ func (m *SwapStatus) GetCostOffchain() int64 {
return 0
}
type ListSwapsRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListSwapsRequest) Reset() { *m = ListSwapsRequest{} }
func (m *ListSwapsRequest) String() string { return proto.CompactTextString(m) }
func (*ListSwapsRequest) ProtoMessage() {}
func (*ListSwapsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_014de31d7ac8c57c, []int{5}
}
func (m *ListSwapsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListSwapsRequest.Unmarshal(m, b)
}
func (m *ListSwapsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListSwapsRequest.Marshal(b, m, deterministic)
}
func (m *ListSwapsRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListSwapsRequest.Merge(m, src)
}
func (m *ListSwapsRequest) XXX_Size() int {
return xxx_messageInfo_ListSwapsRequest.Size(m)
}
func (m *ListSwapsRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ListSwapsRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ListSwapsRequest proto.InternalMessageInfo
type ListSwapsResponse struct {
//*
//The list of all currently known swaps and their status.
Swaps []*SwapStatus `protobuf:"bytes,1,rep,name=swaps,proto3" json:"swaps,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ListSwapsResponse) Reset() { *m = ListSwapsResponse{} }
func (m *ListSwapsResponse) String() string { return proto.CompactTextString(m) }
func (*ListSwapsResponse) ProtoMessage() {}
func (*ListSwapsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_014de31d7ac8c57c, []int{6}
}
func (m *ListSwapsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ListSwapsResponse.Unmarshal(m, b)
}
func (m *ListSwapsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ListSwapsResponse.Marshal(b, m, deterministic)
}
func (m *ListSwapsResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ListSwapsResponse.Merge(m, src)
}
func (m *ListSwapsResponse) XXX_Size() int {
return xxx_messageInfo_ListSwapsResponse.Size(m)
}
func (m *ListSwapsResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ListSwapsResponse.DiscardUnknown(m)
}
var xxx_messageInfo_ListSwapsResponse proto.InternalMessageInfo
func (m *ListSwapsResponse) GetSwaps() []*SwapStatus {
if m != nil {
return m.Swaps
}
return nil
}
type SwapInfoRequest struct {
//*
//The swap identifier which currently is the hash that locks the HTLCs. When
//using REST, this field must be encoded as base64.
Id []byte `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *SwapInfoRequest) Reset() { *m = SwapInfoRequest{} }
func (m *SwapInfoRequest) String() string { return proto.CompactTextString(m) }
func (*SwapInfoRequest) ProtoMessage() {}
func (*SwapInfoRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_014de31d7ac8c57c, []int{7}
}
func (m *SwapInfoRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SwapInfoRequest.Unmarshal(m, b)
}
func (m *SwapInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_SwapInfoRequest.Marshal(b, m, deterministic)
}
func (m *SwapInfoRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_SwapInfoRequest.Merge(m, src)
}
func (m *SwapInfoRequest) XXX_Size() int {
return xxx_messageInfo_SwapInfoRequest.Size(m)
}
func (m *SwapInfoRequest) XXX_DiscardUnknown() {
xxx_messageInfo_SwapInfoRequest.DiscardUnknown(m)
}
var xxx_messageInfo_SwapInfoRequest proto.InternalMessageInfo
func (m *SwapInfoRequest) GetId() []byte {
if m != nil {
return m.Id
}
return nil
}
type TermsRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
@ -582,7 +696,7 @@ func (m *TermsRequest) Reset() { *m = TermsRequest{} }
func (m *TermsRequest) String() string { return proto.CompactTextString(m) }
func (*TermsRequest) ProtoMessage() {}
func (*TermsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_014de31d7ac8c57c, []int{5}
return fileDescriptor_014de31d7ac8c57c, []int{8}
}
func (m *TermsRequest) XXX_Unmarshal(b []byte) error {
@ -619,7 +733,7 @@ func (m *TermsResponse) Reset() { *m = TermsResponse{} }
func (m *TermsResponse) String() string { return proto.CompactTextString(m) }
func (*TermsResponse) ProtoMessage() {}
func (*TermsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_014de31d7ac8c57c, []int{6}
return fileDescriptor_014de31d7ac8c57c, []int{9}
}
func (m *TermsResponse) XXX_Unmarshal(b []byte) error {
@ -684,7 +798,7 @@ func (m *QuoteRequest) Reset() { *m = QuoteRequest{} }
func (m *QuoteRequest) String() string { return proto.CompactTextString(m) }
func (*QuoteRequest) ProtoMessage() {}
func (*QuoteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_014de31d7ac8c57c, []int{7}
return fileDescriptor_014de31d7ac8c57c, []int{10}
}
func (m *QuoteRequest) XXX_Unmarshal(b []byte) error {
@ -759,7 +873,7 @@ func (m *QuoteResponse) Reset() { *m = QuoteResponse{} }
func (m *QuoteResponse) String() string { return proto.CompactTextString(m) }
func (*QuoteResponse) ProtoMessage() {}
func (*QuoteResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_014de31d7ac8c57c, []int{8}
return fileDescriptor_014de31d7ac8c57c, []int{11}
}
func (m *QuoteResponse) XXX_Unmarshal(b []byte) error {
@ -825,7 +939,7 @@ func (m *TokensRequest) Reset() { *m = TokensRequest{} }
func (m *TokensRequest) String() string { return proto.CompactTextString(m) }
func (*TokensRequest) ProtoMessage() {}
func (*TokensRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_014de31d7ac8c57c, []int{9}
return fileDescriptor_014de31d7ac8c57c, []int{12}
}
func (m *TokensRequest) XXX_Unmarshal(b []byte) error {
@ -859,7 +973,7 @@ func (m *TokensResponse) Reset() { *m = TokensResponse{} }
func (m *TokensResponse) String() string { return proto.CompactTextString(m) }
func (*TokensResponse) ProtoMessage() {}
func (*TokensResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_014de31d7ac8c57c, []int{10}
return fileDescriptor_014de31d7ac8c57c, []int{13}
}
func (m *TokensResponse) XXX_Unmarshal(b []byte) error {
@ -924,7 +1038,7 @@ func (m *LsatToken) Reset() { *m = LsatToken{} }
func (m *LsatToken) String() string { return proto.CompactTextString(m) }
func (*LsatToken) ProtoMessage() {}
func (*LsatToken) Descriptor() ([]byte, []int) {
return fileDescriptor_014de31d7ac8c57c, []int{11}
return fileDescriptor_014de31d7ac8c57c, []int{14}
}
func (m *LsatToken) XXX_Unmarshal(b []byte) error {
@ -1009,6 +1123,9 @@ func init() {
proto.RegisterType((*SwapResponse)(nil), "looprpc.SwapResponse")
proto.RegisterType((*MonitorRequest)(nil), "looprpc.MonitorRequest")
proto.RegisterType((*SwapStatus)(nil), "looprpc.SwapStatus")
proto.RegisterType((*ListSwapsRequest)(nil), "looprpc.ListSwapsRequest")
proto.RegisterType((*ListSwapsResponse)(nil), "looprpc.ListSwapsResponse")
proto.RegisterType((*SwapInfoRequest)(nil), "looprpc.SwapInfoRequest")
proto.RegisterType((*TermsRequest)(nil), "looprpc.TermsRequest")
proto.RegisterType((*TermsResponse)(nil), "looprpc.TermsResponse")
proto.RegisterType((*QuoteRequest)(nil), "looprpc.QuoteRequest")
@ -1021,90 +1138,96 @@ func init() {
func init() { proto.RegisterFile("client.proto", fileDescriptor_014de31d7ac8c57c) }
var fileDescriptor_014de31d7ac8c57c = []byte{
// 1322 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0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 0x00, 0x00, 0x00,
0xff, 0xff, 0x55, 0xbe, 0xbc, 0x0e, 0x1c, 0x0b, 0x00, 0x00,
// 1421 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x57, 0xcd, 0x6e, 0xdb, 0xc6,
0x16, 0x8e, 0x24, 0xda, 0x92, 0x8e, 0x28, 0x8a, 0x1e, 0x27, 0xb6, 0xac, 0x7b, 0x83, 0x38, 0xbc,
0x37, 0xa9, 0xe3, 0x45, 0xd4, 0x38, 0xbb, 0xa0, 0x28, 0xa0, 0xca, 0x4a, 0x2c, 0xc3, 0x7f, 0xa5,
0xe4, 0x00, 0xc9, 0x86, 0x9d, 0x48, 0x63, 0x9b, 0xa8, 0xf8, 0x13, 0xce, 0x28, 0xb1, 0x11, 0x64,
0xd3, 0x07, 0xe8, 0xa6, 0xbb, 0x2e, 0xfb, 0x06, 0x05, 0xba, 0xeb, 0x63, 0x74, 0xdf, 0x55, 0x1f,
0xa4, 0x98, 0x33, 0x43, 0x8a, 0xb2, 0x9c, 0x2c, 0xb2, 0xb3, 0xbe, 0xf9, 0xe6, 0x9b, 0x33, 0xe7,
0xe7, 0x1b, 0x1a, 0xcc, 0xd1, 0xc4, 0x67, 0xa1, 0x78, 0x1c, 0x27, 0x91, 0x88, 0x48, 0x79, 0x12,
0x45, 0x71, 0x12, 0x8f, 0x5a, 0xff, 0x3d, 0x8f, 0xa2, 0xf3, 0x09, 0x6b, 0xd3, 0xd8, 0x6f, 0xd3,
0x30, 0x8c, 0x04, 0x15, 0x7e, 0x14, 0x72, 0x45, 0x73, 0x7e, 0x2d, 0x81, 0x75, 0x10, 0x45, 0xf1,
0xf1, 0x54, 0xb8, 0xec, 0xed, 0x94, 0x71, 0x41, 0x6c, 0x28, 0xd1, 0x40, 0x34, 0x0b, 0x9b, 0x85,
0xad, 0x92, 0x2b, 0xff, 0x24, 0x04, 0x8c, 0x31, 0xe3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 0x36, 0x21, 0x73,
0x92, 0xed, 0x0f, 0xfe, 0xf8, 0x23, 0x79, 0x05, 0xa6, 0x2e, 0x0d, 0x7a, 0x38, 0x99, 0xa5, 0x31,
0xef, 0xf1, 0xad, 0xb5, 0xeb, 0xb0, 0x8e, 0x76, 0x51, 0x3a, 0x9a, 0x8a, 0xb6, 0x40, 0x29, 0x2f,
0x93, 0x46, 0xe7, 0xcb, 0x49, 0xe7, 0xed, 0x3a, 0x27, 0x3d, 0x67, 0x90, 0xce, 0x26, 0x4a, 0xb7,
0x48, 0x73, 0x4e, 0xfa, 0xad, 0xe4, 0xb4, 0x3f, 0xd0, 0x40, 0x7c, 0x24, 0xaf, 0xc1, 0x7a, 0xc1,
0x84, 0x6a, 0x83, 0x2f, 0x8a, 0x7e, 0x03, 0x8f, 0x58, 0x25, 0x2b, 0xb9, 0xe6, 0xd0, 0xc1, 0xff,
0x90, 0xd3, 0xfe, 0xa2, 0xf0, 0xef, 0xa1, 0xf6, 0x06, 0x59, 0xcf, 0x6b, 0xe7, 0xa3, 0x7f, 0x05,
0x75, 0x79, 0x42, 0xea, 0x88, 0x3c, 0xd7, 0xd9, 0x73, 0xb6, 0xdb, 0x5a, 0x5f, 0xc0, 0xe7, 0xa7,
0x85, 0x34, 0xf0, 0x08, 0x4e, 0x45, 0x5b, 0x59, 0xed, 0x9b, 0x65, 0xfc, 0x4f, 0xe1, 0xe9, 0xbf,
0x01, 0x00, 0x00, 0xff, 0xff, 0x63, 0x64, 0x76, 0xf5, 0x60, 0x0c, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
@ -1133,8 +1256,14 @@ type SwapClientClient interface {
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.
//TODO: add MonitorSync version for REST clients.
Monitor(ctx context.Context, in *MonitorRequest, opts ...grpc.CallOption) (SwapClient_MonitorClient, error)
//*
//ListSwaps returns a list of all currently known swaps and their current
//status.
ListSwaps(ctx context.Context, in *ListSwapsRequest, opts ...grpc.CallOption) (*ListSwapsResponse, error)
//*
//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) (*TermsResponse, error)
@ -1211,6 +1340,24 @@ func (x *swapClientMonitorClient) Recv() (*SwapStatus, error) {
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) (*TermsResponse, error) {
out := new(TermsResponse)
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/LoopOutTerms", in, out, opts...)
@ -1272,8 +1419,14 @@ type SwapClientServer interface {
LoopIn(context.Context, *LoopInRequest) (*SwapResponse, error)
//* loop: `monitor`
//Monitor will return a stream of swap updates for currently active swaps.
//TODO: add MonitorSync version for REST clients.
Monitor(*MonitorRequest, SwapClient_MonitorServer) error
//*
//ListSwaps returns a list of all currently known swaps and their current
//status.
ListSwaps(context.Context, *ListSwapsRequest) (*ListSwapsResponse, error)
//*
//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) (*TermsResponse, error)
@ -1353,6 +1506,42 @@ 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 {
@ -1455,6 +1644,14 @@ var _SwapClient_serviceDesc = grpc.ServiceDesc{
MethodName: "LoopIn",
Handler: _SwapClient_LoopIn_Handler,
},
{
MethodName: "ListSwaps",
Handler: _SwapClient_ListSwaps_Handler,
},
{
MethodName: "SwapInfo",
Handler: _SwapClient_SwapInfo_Handler,
},
{
MethodName: "LoopOutTerms",
Handler: _SwapClient_LoopOutTerms_Handler,

+ 125
- 0
looprpc/client.pb.gw.go View File

@ -62,6 +62,59 @@ func request_SwapClient_LoopIn_0(ctx context.Context, marshaler runtime.Marshale
}
func request_SwapClient_Monitor_0(ctx context.Context, marshaler runtime.Marshaler, client SwapClientClient, req *http.Request, pathParams map[string]string) (SwapClient_MonitorClient, runtime.ServerMetadata, error) {
var protoReq MonitorRequest
var metadata runtime.ServerMetadata
stream, err := client.Monitor(ctx, &protoReq)
if err != nil {
return nil, metadata, err
}
header, err := stream.Header()
if err != nil {
return nil, metadata, err
}
metadata.HeaderMD = header
return stream, metadata, nil
}
func request_SwapClient_ListSwaps_0(ctx context.Context, marshaler runtime.Marshaler, client SwapClientClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListSwapsRequest
var metadata runtime.ServerMetadata
msg, err := client.ListSwaps(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_SwapClient_SwapInfo_0(ctx context.Context, marshaler runtime.Marshaler, client SwapClientClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq SwapInfoRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.Bytes(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.SwapInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func request_SwapClient_LoopOutTerms_0(ctx context.Context, marshaler runtime.Marshaler, client SwapClientClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq TermsRequest
var metadata runtime.ServerMetadata
@ -237,6 +290,66 @@ func RegisterSwapClientHandlerClient(ctx context.Context, mux *runtime.ServeMux,
})
mux.Handle("GET", pattern_SwapClient_Monitor_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.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_SwapClient_Monitor_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_SwapClient_Monitor_0(ctx, mux, outboundMarshaler, w, req, func() (proto.Message, error) { return resp.Recv() }, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_SwapClient_ListSwaps_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.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_SwapClient_ListSwaps_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_SwapClient_ListSwaps_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_SwapClient_SwapInfo_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.AnnotateContext(ctx, mux, req)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_SwapClient_SwapInfo_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_SwapClient_SwapInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_SwapClient_LoopOutTerms_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@ -345,6 +458,12 @@ var (
pattern_SwapClient_LoopIn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "loop", "in"}, ""))
pattern_SwapClient_Monitor_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "loop", "monitor"}, ""))
pattern_SwapClient_ListSwaps_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "loop", "swaps"}, ""))
pattern_SwapClient_SwapInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "loop", "swap", "id"}, ""))
pattern_SwapClient_LoopOutTerms_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "loop", "out", "terms"}, ""))
pattern_SwapClient_LoopOutQuote_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"v1", "loop", "out", "quote", "amt"}, ""))
@ -361,6 +480,12 @@ var (
forward_SwapClient_LoopIn_0 = runtime.ForwardResponseMessage
forward_SwapClient_Monitor_0 = runtime.ForwardResponseStream
forward_SwapClient_ListSwaps_0 = runtime.ForwardResponseMessage
forward_SwapClient_SwapInfo_0 = runtime.ForwardResponseMessage
forward_SwapClient_LoopOutTerms_0 = runtime.ForwardResponseMessage
forward_SwapClient_LoopOutQuote_0 = runtime.ForwardResponseMessage

+ 43
- 3
looprpc/client.proto View File

@ -37,9 +37,31 @@ service SwapClient {
/** loop: `monitor`
Monitor will return a stream of swap updates for currently active swaps.
TODO: add MonitorSync version for REST clients.
*/
rpc Monitor (MonitorRequest) returns (stream SwapStatus);
rpc Monitor (MonitorRequest) returns (stream SwapStatus) {
option (google.api.http) = {
get: "/v1/loop/monitor"
};
}
/**
ListSwaps returns a list of all currently known swaps and their current
status.
*/
rpc ListSwaps (ListSwapsRequest) returns (ListSwapsResponse) {
option (google.api.http) = {
get: "/v1/loop/swaps"
};
}
/**
SwapInfo returns all known details about a single swap.
*/
rpc SwapInfo (SwapInfoRequest) returns (SwapStatus) {
option (google.api.http) = {
get: "/v1/loop/swap/{id}"
};
}
/** loop: `terms`
LoopOutTerms returns the terms that the server enforces for a loop out swap.
@ -319,6 +341,24 @@ enum SwapState {
INVOICE_SETTLED = 5;
}
message ListSwapsRequest {
}
message ListSwapsResponse {
/**
The list of all currently known swaps and their status.
*/
repeated SwapStatus swaps = 1;
}
message SwapInfoRequest {
/**
The swap identifier which currently is the hash that locks the HTLCs. When
using REST, this field must be encoded as base64.
*/
bytes id = 1;
}
message TermsRequest {
}
@ -442,7 +482,7 @@ message LsatToken {
Indicates whether the token is expired or still valid.
*/
bool expired = 7;
/**
Identifying attribute of this token in the store. Currently represents the
file name of the token where it's stored on the file system.

+ 73
- 0
looprpc/client.swagger.json View File

@ -110,6 +110,23 @@
]
}
},
"/v1/loop/monitor": {
"get": {
"summary": "* loop: `monitor`\nMonitor will return a stream of swap updates for currently active swaps.",
"operationId": "Monitor",
"responses": {
"200": {
"description": "A successful response.(streaming responses)",
"schema": {
"$ref": "#/x-stream-definitions/looprpcSwapStatus"
}
}
},
"tags": [
"SwapClient"
]
}
},
"/v1/loop/out": {
"post": {
"summary": "* loop: `out`\nLoopOut initiates an loop out swap with the given parameters. The call\nreturns after the swap has been set up with the swap server. From that\npoint onwards, progress can be tracked via the SwapStatus stream that is\nreturned from Monitor().",
@ -205,6 +222,50 @@
]
}
},
"/v1/loop/swap/{id}": {
"get": {
"summary": "*\nSwapInfo returns all known details about a single swap.",
"operationId": "SwapInfo",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/looprpcSwapStatus"
}
}
},
"parameters": [
{
"name": "id",
"description": "*\nThe swap identifier which currently is the hash that locks the HTLCs. When\nusing REST, this field must be encoded as base64.",
"in": "path",
"required": true,
"type": "string",
"format": "byte"
}
],
"tags": [
"SwapClient"
]
}
},
"/v1/loop/swaps": {
"get": {
"summary": "*\nListSwaps returns a list of all currently known swaps and their current\nstatus.",
"operationId": "ListSwaps",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/looprpcListSwapsResponse"
}
}
},
"tags": [
"SwapClient"
]
}
},
"/v1/lsat/tokens": {
"get": {
"summary": "*\nGetLsatTokens returns all LSAT tokens the daemon ever paid for.",
@ -224,6 +285,18 @@
}
},
"definitions": {
"looprpcListSwapsResponse": {
"type": "object",
"properties": {
"swaps": {
"type": "array",
"items": {
"$ref": "#/definitions/looprpcSwapStatus"
},
"description": "*\nThe list of all currently known swaps and their status."
}
}
},
"looprpcLoopInRequest": {
"type": "object",
"properties": {

Loading…
Cancel
Save