looprpc: rename service actions from uncharge to loop out

In this commit, we rename all the service actions from uncharge, to loop
out instead. We do this in order to be line with the new naming scheme
for the service.
pull/9/head
Olaoluwa Osuntokun 5 years ago
parent 908d82acdb
commit e299dc696c
No known key found for this signature in database
GPG Key ID: CE58F7F8E20FD9A2

@ -26,22 +26,22 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type SwapType int32 type SwapType int32
const ( const (
// UNCHARGE indicates an uncharge swap (off-chain to on-chain) // LOOP_OUT indicates an loop out swap (off-chain to on-chain)
SwapType_UNCHARGE SwapType = 0 SwapType_LOOP_OUT SwapType = 0
) )
var SwapType_name = map[int32]string{ var SwapType_name = map[int32]string{
0: "UNCHARGE", 0: "LOOP_OUT",
} }
var SwapType_value = map[string]int32{ var SwapType_value = map[string]int32{
"UNCHARGE": 0, "LOOP_OUT": 0,
} }
func (x SwapType) String() string { func (x SwapType) String() string {
return proto.EnumName(SwapType_name, int32(x)) return proto.EnumName(SwapType_name, int32(x))
} }
func (SwapType) EnumDescriptor() ([]byte, []int) { func (SwapType) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_client_55d0482164e13e67, []int{0} return fileDescriptor_client_e8e8b003a83cbb2b, []int{0}
} }
type SwapState int32 type SwapState int32
@ -86,13 +86,12 @@ func (x SwapState) String() string {
return proto.EnumName(SwapState_name, int32(x)) return proto.EnumName(SwapState_name, int32(x))
} }
func (SwapState) EnumDescriptor() ([]byte, []int) { func (SwapState) EnumDescriptor() ([]byte, []int) {
return fileDescriptor_client_55d0482164e13e67, []int{1} return fileDescriptor_client_e8e8b003a83cbb2b, []int{1}
} }
type UnchargeRequest struct { type LoopOutRequest struct {
// * // *
// Requested swap amount in sat. This does not include the swap and miner // Requested swap amount in sat. This does not include the swap and miner fee.
// fee.
Amt int64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"` Amt int64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"`
// * // *
// Base58 encoded destination address for the swap. // Base58 encoded destination address for the swap.
@ -122,101 +121,101 @@ type UnchargeRequest struct {
// value, we cancel the swap. If the fee estimate is lower, we publish the // value, we cancel the swap. If the fee estimate is lower, we publish the
// sweep tx. // sweep tx.
// //
// If the sweep tx isn't confirmed, we are forced to ratchet up fees until // If the sweep tx is not confirmed, we are forced to ratchet up fees until it
// it is swept. Possibly even exceeding max_miner_fee if we get close to the // is swept. Possibly even exceeding max_miner_fee if we get close to the htlc
// htlc timeout. Because the initial publication revealed the preimage, we // timeout. Because the initial publication revealed the preimage, we have no
// have no other choice. The server may already have pulled the off-chain // other choice. The server may already have pulled the off-chain htlc. Only
// htlc. Only when the fee becomes higher than the swap amount, we can only // when the fee becomes higher than the swap amount, we can only wait for fees
// wait for fees to come down and hope - if we are past the timeout - that // to come down and hope - if we are past the timeout - that the server is not
// the server isn't publishing the revocation. // publishing the revocation.
// //
// max_miner_fee is typically taken from the response of the GetQuote call. // max_miner_fee is typically taken from the response of the GetQuote call.
MaxMinerFee int64 `protobuf:"varint,7,opt,name=max_miner_fee,json=maxMinerFee,proto3" json:"max_miner_fee,omitempty"` MaxMinerFee int64 `protobuf:"varint,7,opt,name=max_miner_fee,json=maxMinerFee,proto3" json:"max_miner_fee,omitempty"`
// * // *
// The channel to uncharge. If zero, the channel to uncharge is selected based // The channel to loop out, the channel to loop out is selected based on the
// on the lowest routing fee for the swap payment to the server. // lowest routing fee for the swap payment to the server.
UnchargeChannel uint64 `protobuf:"varint,8,opt,name=uncharge_channel,json=unchargeChannel,proto3" json:"uncharge_channel,omitempty"` LoopOutChannel uint64 `protobuf:"varint,8,opt,name=loop_out_channel,json=loopOutChannel,proto3" json:"loop_out_channel,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *UnchargeRequest) Reset() { *m = UnchargeRequest{} } func (m *LoopOutRequest) Reset() { *m = LoopOutRequest{} }
func (m *UnchargeRequest) String() string { return proto.CompactTextString(m) } func (m *LoopOutRequest) String() string { return proto.CompactTextString(m) }
func (*UnchargeRequest) ProtoMessage() {} func (*LoopOutRequest) ProtoMessage() {}
func (*UnchargeRequest) Descriptor() ([]byte, []int) { func (*LoopOutRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_client_55d0482164e13e67, []int{0} return fileDescriptor_client_e8e8b003a83cbb2b, []int{0}
} }
func (m *UnchargeRequest) XXX_Unmarshal(b []byte) error { func (m *LoopOutRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_UnchargeRequest.Unmarshal(m, b) return xxx_messageInfo_LoopOutRequest.Unmarshal(m, b)
} }
func (m *UnchargeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *LoopOutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_UnchargeRequest.Marshal(b, m, deterministic) return xxx_messageInfo_LoopOutRequest.Marshal(b, m, deterministic)
} }
func (dst *UnchargeRequest) XXX_Merge(src proto.Message) { func (dst *LoopOutRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_UnchargeRequest.Merge(dst, src) xxx_messageInfo_LoopOutRequest.Merge(dst, src)
} }
func (m *UnchargeRequest) XXX_Size() int { func (m *LoopOutRequest) XXX_Size() int {
return xxx_messageInfo_UnchargeRequest.Size(m) return xxx_messageInfo_LoopOutRequest.Size(m)
} }
func (m *UnchargeRequest) XXX_DiscardUnknown() { func (m *LoopOutRequest) XXX_DiscardUnknown() {
xxx_messageInfo_UnchargeRequest.DiscardUnknown(m) xxx_messageInfo_LoopOutRequest.DiscardUnknown(m)
} }
var xxx_messageInfo_UnchargeRequest proto.InternalMessageInfo var xxx_messageInfo_LoopOutRequest proto.InternalMessageInfo
func (m *UnchargeRequest) GetAmt() int64 { func (m *LoopOutRequest) GetAmt() int64 {
if m != nil { if m != nil {
return m.Amt return m.Amt
} }
return 0 return 0
} }
func (m *UnchargeRequest) GetDest() string { func (m *LoopOutRequest) GetDest() string {
if m != nil { if m != nil {
return m.Dest return m.Dest
} }
return "" return ""
} }
func (m *UnchargeRequest) GetMaxSwapRoutingFee() int64 { func (m *LoopOutRequest) GetMaxSwapRoutingFee() int64 {
if m != nil { if m != nil {
return m.MaxSwapRoutingFee return m.MaxSwapRoutingFee
} }
return 0 return 0
} }
func (m *UnchargeRequest) GetMaxPrepayRoutingFee() int64 { func (m *LoopOutRequest) GetMaxPrepayRoutingFee() int64 {
if m != nil { if m != nil {
return m.MaxPrepayRoutingFee return m.MaxPrepayRoutingFee
} }
return 0 return 0
} }
func (m *UnchargeRequest) GetMaxSwapFee() int64 { func (m *LoopOutRequest) GetMaxSwapFee() int64 {
if m != nil { if m != nil {
return m.MaxSwapFee return m.MaxSwapFee
} }
return 0 return 0
} }
func (m *UnchargeRequest) GetMaxPrepayAmt() int64 { func (m *LoopOutRequest) GetMaxPrepayAmt() int64 {
if m != nil { if m != nil {
return m.MaxPrepayAmt return m.MaxPrepayAmt
} }
return 0 return 0
} }
func (m *UnchargeRequest) GetMaxMinerFee() int64 { func (m *LoopOutRequest) GetMaxMinerFee() int64 {
if m != nil { if m != nil {
return m.MaxMinerFee return m.MaxMinerFee
} }
return 0 return 0
} }
func (m *UnchargeRequest) GetUnchargeChannel() uint64 { func (m *LoopOutRequest) GetLoopOutChannel() uint64 {
if m != nil { if m != nil {
return m.UnchargeChannel return m.LoopOutChannel
} }
return 0 return 0
} }
@ -235,7 +234,7 @@ func (m *SwapResponse) Reset() { *m = SwapResponse{} }
func (m *SwapResponse) String() string { return proto.CompactTextString(m) } func (m *SwapResponse) String() string { return proto.CompactTextString(m) }
func (*SwapResponse) ProtoMessage() {} func (*SwapResponse) ProtoMessage() {}
func (*SwapResponse) Descriptor() ([]byte, []int) { func (*SwapResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_client_55d0482164e13e67, []int{1} return fileDescriptor_client_e8e8b003a83cbb2b, []int{1}
} }
func (m *SwapResponse) XXX_Unmarshal(b []byte) error { func (m *SwapResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SwapResponse.Unmarshal(m, b) return xxx_messageInfo_SwapResponse.Unmarshal(m, b)
@ -272,7 +271,7 @@ func (m *MonitorRequest) Reset() { *m = MonitorRequest{} }
func (m *MonitorRequest) String() string { return proto.CompactTextString(m) } func (m *MonitorRequest) String() string { return proto.CompactTextString(m) }
func (*MonitorRequest) ProtoMessage() {} func (*MonitorRequest) ProtoMessage() {}
func (*MonitorRequest) Descriptor() ([]byte, []int) { func (*MonitorRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_client_55d0482164e13e67, []int{2} return fileDescriptor_client_e8e8b003a83cbb2b, []int{2}
} }
func (m *MonitorRequest) XXX_Unmarshal(b []byte) error { func (m *MonitorRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_MonitorRequest.Unmarshal(m, b) return xxx_messageInfo_MonitorRequest.Unmarshal(m, b)
@ -325,7 +324,7 @@ func (m *SwapStatus) Reset() { *m = SwapStatus{} }
func (m *SwapStatus) String() string { return proto.CompactTextString(m) } func (m *SwapStatus) String() string { return proto.CompactTextString(m) }
func (*SwapStatus) ProtoMessage() {} func (*SwapStatus) ProtoMessage() {}
func (*SwapStatus) Descriptor() ([]byte, []int) { func (*SwapStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_client_55d0482164e13e67, []int{3} return fileDescriptor_client_e8e8b003a83cbb2b, []int{3}
} }
func (m *SwapStatus) XXX_Unmarshal(b []byte) error { func (m *SwapStatus) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_SwapStatus.Unmarshal(m, b) return xxx_messageInfo_SwapStatus.Unmarshal(m, b)
@ -363,7 +362,7 @@ func (m *SwapStatus) GetType() SwapType {
if m != nil { if m != nil {
return m.Type return m.Type
} }
return SwapType_UNCHARGE return SwapType_LOOP_OUT
} }
func (m *SwapStatus) GetState() SwapState { func (m *SwapStatus) GetState() SwapState {
@ -404,7 +403,7 @@ func (m *TermsRequest) Reset() { *m = TermsRequest{} }
func (m *TermsRequest) String() string { return proto.CompactTextString(m) } func (m *TermsRequest) String() string { return proto.CompactTextString(m) }
func (*TermsRequest) ProtoMessage() {} func (*TermsRequest) ProtoMessage() {}
func (*TermsRequest) Descriptor() ([]byte, []int) { func (*TermsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_client_55d0482164e13e67, []int{4} return fileDescriptor_client_e8e8b003a83cbb2b, []int{4}
} }
func (m *TermsRequest) XXX_Unmarshal(b []byte) error { func (m *TermsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TermsRequest.Unmarshal(m, b) return xxx_messageInfo_TermsRequest.Unmarshal(m, b)
@ -459,7 +458,7 @@ func (m *TermsResponse) Reset() { *m = TermsResponse{} }
func (m *TermsResponse) String() string { return proto.CompactTextString(m) } func (m *TermsResponse) String() string { return proto.CompactTextString(m) }
func (*TermsResponse) ProtoMessage() {} func (*TermsResponse) ProtoMessage() {}
func (*TermsResponse) Descriptor() ([]byte, []int) { func (*TermsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_client_55d0482164e13e67, []int{5} return fileDescriptor_client_e8e8b003a83cbb2b, []int{5}
} }
func (m *TermsResponse) XXX_Unmarshal(b []byte) error { func (m *TermsResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_TermsResponse.Unmarshal(m, b) return xxx_messageInfo_TermsResponse.Unmarshal(m, b)
@ -548,7 +547,7 @@ func (m *QuoteRequest) Reset() { *m = QuoteRequest{} }
func (m *QuoteRequest) String() string { return proto.CompactTextString(m) } func (m *QuoteRequest) String() string { return proto.CompactTextString(m) }
func (*QuoteRequest) ProtoMessage() {} func (*QuoteRequest) ProtoMessage() {}
func (*QuoteRequest) Descriptor() ([]byte, []int) { func (*QuoteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_client_55d0482164e13e67, []int{6} return fileDescriptor_client_e8e8b003a83cbb2b, []int{6}
} }
func (m *QuoteRequest) XXX_Unmarshal(b []byte) error { func (m *QuoteRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QuoteRequest.Unmarshal(m, b) return xxx_messageInfo_QuoteRequest.Unmarshal(m, b)
@ -596,7 +595,7 @@ func (m *QuoteResponse) Reset() { *m = QuoteResponse{} }
func (m *QuoteResponse) String() string { return proto.CompactTextString(m) } func (m *QuoteResponse) String() string { return proto.CompactTextString(m) }
func (*QuoteResponse) ProtoMessage() {} func (*QuoteResponse) ProtoMessage() {}
func (*QuoteResponse) Descriptor() ([]byte, []int) { func (*QuoteResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_client_55d0482164e13e67, []int{7} return fileDescriptor_client_e8e8b003a83cbb2b, []int{7}
} }
func (m *QuoteResponse) XXX_Unmarshal(b []byte) error { func (m *QuoteResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_QuoteResponse.Unmarshal(m, b) return xxx_messageInfo_QuoteResponse.Unmarshal(m, b)
@ -638,7 +637,7 @@ func (m *QuoteResponse) GetMinerFee() int64 {
} }
func init() { func init() {
proto.RegisterType((*UnchargeRequest)(nil), "looprpc.UnchargeRequest") proto.RegisterType((*LoopOutRequest)(nil), "looprpc.LoopOutRequest")
proto.RegisterType((*SwapResponse)(nil), "looprpc.SwapResponse") proto.RegisterType((*SwapResponse)(nil), "looprpc.SwapResponse")
proto.RegisterType((*MonitorRequest)(nil), "looprpc.MonitorRequest") proto.RegisterType((*MonitorRequest)(nil), "looprpc.MonitorRequest")
proto.RegisterType((*SwapStatus)(nil), "looprpc.SwapStatus") proto.RegisterType((*SwapStatus)(nil), "looprpc.SwapStatus")
@ -663,20 +662,20 @@ const _ = grpc.SupportPackageIsVersion4
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type SwapClientClient interface { type SwapClientClient interface {
// * // *
// Uncharge initiates an uncharge swap with the given parameters. The call // 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 // returns after the swap has been set up with the swap server. From that
// point onwards, progress can be tracked via the SwapStatus stream // point onwards, progress can be tracked via the SwapStatus stream that is
// that is returned from Monitor(). // returned from Monitor().
Uncharge(ctx context.Context, in *UnchargeRequest, opts ...grpc.CallOption) (*SwapResponse, error) LoopOut(ctx context.Context, in *LoopOutRequest, opts ...grpc.CallOption) (*SwapResponse, error)
// * // *
// Monitor will return a stream of swap updates for currently active swaps. // Monitor will return a stream of swap updates for currently active swaps.
Monitor(ctx context.Context, in *MonitorRequest, opts ...grpc.CallOption) (SwapClient_MonitorClient, error) Monitor(ctx context.Context, in *MonitorRequest, opts ...grpc.CallOption) (SwapClient_MonitorClient, error)
// * // *
// GetTerms returns the terms that the server enforces for swaps. // GetLoopOutTerms returns the terms that the server enforces for swaps.
GetUnchargeTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*TermsResponse, error) GetLoopOutTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*TermsResponse, error)
// * // *
// GetQuote returns a quote for a swap with the provided parameters. // GetLoopOutQuote returns a quote for a swap with the provided parameters.
GetUnchargeQuote(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (*QuoteResponse, error) GetLoopOutQuote(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (*QuoteResponse, error)
} }
type swapClientClient struct { type swapClientClient struct {
@ -687,9 +686,9 @@ func NewSwapClientClient(cc *grpc.ClientConn) SwapClientClient {
return &swapClientClient{cc} return &swapClientClient{cc}
} }
func (c *swapClientClient) Uncharge(ctx context.Context, in *UnchargeRequest, opts ...grpc.CallOption) (*SwapResponse, error) { func (c *swapClientClient) LoopOut(ctx context.Context, in *LoopOutRequest, opts ...grpc.CallOption) (*SwapResponse, error) {
out := new(SwapResponse) out := new(SwapResponse)
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/Uncharge", in, out, opts...) err := c.cc.Invoke(ctx, "/looprpc.SwapClient/LoopOut", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -728,18 +727,18 @@ func (x *swapClientMonitorClient) Recv() (*SwapStatus, error) {
return m, nil return m, nil
} }
func (c *swapClientClient) GetUnchargeTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*TermsResponse, error) { func (c *swapClientClient) GetLoopOutTerms(ctx context.Context, in *TermsRequest, opts ...grpc.CallOption) (*TermsResponse, error) {
out := new(TermsResponse) out := new(TermsResponse)
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/GetUnchargeTerms", in, out, opts...) err := c.cc.Invoke(ctx, "/looprpc.SwapClient/GetLoopOutTerms", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *swapClientClient) GetUnchargeQuote(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (*QuoteResponse, error) { func (c *swapClientClient) GetLoopOutQuote(ctx context.Context, in *QuoteRequest, opts ...grpc.CallOption) (*QuoteResponse, error) {
out := new(QuoteResponse) out := new(QuoteResponse)
err := c.cc.Invoke(ctx, "/looprpc.SwapClient/GetUnchargeQuote", in, out, opts...) err := c.cc.Invoke(ctx, "/looprpc.SwapClient/GetLoopOutQuote", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -749,40 +748,40 @@ func (c *swapClientClient) GetUnchargeQuote(ctx context.Context, in *QuoteReques
// SwapClientServer is the server API for SwapClient service. // SwapClientServer is the server API for SwapClient service.
type SwapClientServer interface { type SwapClientServer interface {
// * // *
// Uncharge initiates an uncharge swap with the given parameters. The call // 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 // returns after the swap has been set up with the swap server. From that
// point onwards, progress can be tracked via the SwapStatus stream // point onwards, progress can be tracked via the SwapStatus stream that is
// that is returned from Monitor(). // returned from Monitor().
Uncharge(context.Context, *UnchargeRequest) (*SwapResponse, error) LoopOut(context.Context, *LoopOutRequest) (*SwapResponse, error)
// * // *
// Monitor will return a stream of swap updates for currently active swaps. // Monitor will return a stream of swap updates for currently active swaps.
Monitor(*MonitorRequest, SwapClient_MonitorServer) error Monitor(*MonitorRequest, SwapClient_MonitorServer) error
// * // *
// GetTerms returns the terms that the server enforces for swaps. // GetLoopOutTerms returns the terms that the server enforces for swaps.
GetUnchargeTerms(context.Context, *TermsRequest) (*TermsResponse, error) GetLoopOutTerms(context.Context, *TermsRequest) (*TermsResponse, error)
// * // *
// GetQuote returns a quote for a swap with the provided parameters. // GetLoopOutQuote returns a quote for a swap with the provided parameters.
GetUnchargeQuote(context.Context, *QuoteRequest) (*QuoteResponse, error) GetLoopOutQuote(context.Context, *QuoteRequest) (*QuoteResponse, error)
} }
func RegisterSwapClientServer(s *grpc.Server, srv SwapClientServer) { func RegisterSwapClientServer(s *grpc.Server, srv SwapClientServer) {
s.RegisterService(&_SwapClient_serviceDesc, srv) s.RegisterService(&_SwapClient_serviceDesc, srv)
} }
func _SwapClient_Uncharge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _SwapClient_LoopOut_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UnchargeRequest) in := new(LoopOutRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(SwapClientServer).Uncharge(ctx, in) return srv.(SwapClientServer).LoopOut(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: "/looprpc.SwapClient/Uncharge", FullMethod: "/looprpc.SwapClient/LoopOut",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SwapClientServer).Uncharge(ctx, req.(*UnchargeRequest)) return srv.(SwapClientServer).LoopOut(ctx, req.(*LoopOutRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -808,38 +807,38 @@ func (x *swapClientMonitorServer) Send(m *SwapStatus) error {
return x.ServerStream.SendMsg(m) return x.ServerStream.SendMsg(m)
} }
func _SwapClient_GetUnchargeTerms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _SwapClient_GetLoopOutTerms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(TermsRequest) in := new(TermsRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(SwapClientServer).GetUnchargeTerms(ctx, in) return srv.(SwapClientServer).GetLoopOutTerms(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: "/looprpc.SwapClient/GetUnchargeTerms", FullMethod: "/looprpc.SwapClient/GetLoopOutTerms",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SwapClientServer).GetUnchargeTerms(ctx, req.(*TermsRequest)) return srv.(SwapClientServer).GetLoopOutTerms(ctx, req.(*TermsRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _SwapClient_GetUnchargeQuote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _SwapClient_GetLoopOutQuote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QuoteRequest) in := new(QuoteRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(SwapClientServer).GetUnchargeQuote(ctx, in) return srv.(SwapClientServer).GetLoopOutQuote(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: "/looprpc.SwapClient/GetUnchargeQuote", FullMethod: "/looprpc.SwapClient/GetLoopOutQuote",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SwapClientServer).GetUnchargeQuote(ctx, req.(*QuoteRequest)) return srv.(SwapClientServer).GetLoopOutQuote(ctx, req.(*QuoteRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -849,16 +848,16 @@ var _SwapClient_serviceDesc = grpc.ServiceDesc{
HandlerType: (*SwapClientServer)(nil), HandlerType: (*SwapClientServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{ {
MethodName: "Uncharge", MethodName: "LoopOut",
Handler: _SwapClient_Uncharge_Handler, Handler: _SwapClient_LoopOut_Handler,
}, },
{ {
MethodName: "GetUnchargeTerms", MethodName: "GetLoopOutTerms",
Handler: _SwapClient_GetUnchargeTerms_Handler, Handler: _SwapClient_GetLoopOutTerms_Handler,
}, },
{ {
MethodName: "GetUnchargeQuote", MethodName: "GetLoopOutQuote",
Handler: _SwapClient_GetUnchargeQuote_Handler, Handler: _SwapClient_GetLoopOutQuote_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{ Streams: []grpc.StreamDesc{
@ -871,55 +870,55 @@ var _SwapClient_serviceDesc = grpc.ServiceDesc{
Metadata: "client.proto", Metadata: "client.proto",
} }
func init() { proto.RegisterFile("client.proto", fileDescriptor_client_55d0482164e13e67) } func init() { proto.RegisterFile("client.proto", fileDescriptor_client_e8e8b003a83cbb2b) }
var fileDescriptor_client_55d0482164e13e67 = []byte{ var fileDescriptor_client_e8e8b003a83cbb2b = []byte{
// 749 bytes of a gzipped FileDescriptorProto // 749 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0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x60, 0xf8, 0x4b, 0x09, 0xcc, 0x74, 0x0d, 0x7f, 0xe9, 0xb4, 0xc0, 0xbe, 0x8e, 0x42, 0x9f, 0x47,
0xf7, 0x9f, 0x06, 0x80, 0x28, 0x59, 0x72, 0xc2, 0x8b, 0xfc, 0x7f, 0x3c, 0x56, 0x12, 0x46, 0x29, 0x89, 0x66, 0xea, 0xfc, 0x28, 0x00, 0x88, 0x92, 0x19, 0xc7, 0x3c, 0x65, 0xbf, 0x41, 0xac, 0x5a,
0x81, 0xbe, 0x82, 0x16, 0xdf, 0xa7, 0xca, 0x4f, 0xfb, 0x62, 0x74, 0xae, 0x27, 0x76, 0x2e, 0x44, 0x18, 0x9b, 0x16, 0xe8, 0x05, 0x94, 0xf8, 0x3a, 0x56, 0x38, 0xed, 0xd3, 0xf6, 0x89, 0xbe, 0xaf,
0x56, 0xfb, 0x94, 0x62, 0x79, 0x8c, 0xa6, 0xd0, 0xce, 0x39, 0xe1, 0xca, 0x44, 0xfb, 0x02, 0xd5, 0x13, 0xd1, 0x64, 0xbe, 0x8e, 0x89, 0x2b, 0x97, 0x51, 0x0f, 0xca, 0x8c, 0x63, 0xae, 0x18, 0xda,
0x78, 0xa2, 0x19, 0xc5, 0x8a, 0x80, 0xbe, 0x81, 0x61, 0x18, 0x87, 0x3c, 0x24, 0x3c, 0x4c, 0xe2, 0xa7, 0x28, 0xe7, 0x13, 0x9b, 0x11, 0x57, 0x19, 0xd0, 0x2b, 0x68, 0xfa, 0xa1, 0xcf, 0x7d, 0xcc,
0x80, 0x87, 0xac, 0x74, 0xd3, 0x7e, 0x85, 0x57, 0x21, 0x13, 0x92, 0x4e, 0x44, 0x72, 0x1e, 0x14, 0xfd, 0x28, 0xf4, 0xb8, 0x4f, 0x37, 0x30, 0xed, 0x27, 0x79, 0xee, 0x53, 0x85, 0x01, 0x33, 0xee,
0xe9, 0x96, 0x70, 0xaa, 0x98, 0xca, 0x53, 0x5b, 0xe0, 0x6b, 0x09, 0x4b, 0xe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0x00, 0x00, 0xff, 0xff, 0xc5, 0x15, 0xc0, 0x11, 0xb6, 0x05, 0x00, 0x00,
} }

@ -2,10 +2,38 @@ syntax = "proto3";
package looprpc; package looprpc;
message UnchargeRequest { /**
SwapClient is a service that handles the client side process of onchain/offchain
swaps. The service is designed for a single client.
*/
service SwapClient {
/** /**
Requested swap amount in sat. This does not include the swap and miner LoopOut initiates an loop out swap with the given parameters. The call
fee. 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().
*/
rpc LoopOut(LoopOutRequest) returns (SwapResponse);
/**
Monitor will return a stream of swap updates for currently active swaps.
*/
rpc Monitor(MonitorRequest) returns(stream SwapStatus);
/**
GetLoopOutTerms returns the terms that the server enforces for swaps.
*/
rpc GetLoopOutTerms(TermsRequest) returns(TermsResponse);
/**
GetLoopOutQuote returns a quote for a swap with the provided parameters.
*/
rpc GetLoopOutQuote(QuoteRequest) returns(QuoteResponse);
}
message LoopOutRequest {
/**
Requested swap amount in sat. This does not include the swap and miner fee.
*/ */
int64 amt = 1; int64 amt = 1;
@ -19,51 +47,51 @@ message UnchargeRequest {
This limit is applied during path finding. Typically this value is taken This limit is applied during path finding. Typically this value is taken
from the response of the GetQuote call. from the response of the GetQuote call.
*/ */
int64 max_swap_routing_fee = 3; int64 max_swap_routing_fee = 3;
/** /**
Maximum off-chain fee in msat that may be paid for payment to the server. Maximum off-chain fee in msat that may be paid for payment to the server.
This limit is applied during path finding. Typically this value is taken This limit is applied during path finding. Typically this value is taken
from the response of the GetQuote call. from the response of the GetQuote call.
*/ */
int64 max_prepay_routing_fee = 4; int64 max_prepay_routing_fee = 4;
/** /**
Maximum we are willing to pay the server for the swap. This value is not Maximum we are willing to pay the server for the swap. This value is not
disclosed in the swap initiation call, but if the server asks for a disclosed in the swap initiation call, but if the server asks for a
higher fee, we abort the swap. Typically this value is taken from the higher fee, we abort the swap. Typically this value is taken from the
response of the GetQuote call. It includes the prepay amount. response of the GetQuote call. It includes the prepay amount.
*/ */
int64 max_swap_fee = 5; int64 max_swap_fee = 5;
/** /**
Maximum amount of the swap fee that may be charged as a prepayment. Maximum amount of the swap fee that may be charged as a prepayment.
*/ */
int64 max_prepay_amt = 6; int64 max_prepay_amt = 6;
/** /**
Maximum in on-chain fees that we are willing to spent. If we want to Maximum in on-chain fees that we are willing to spent. If we want to
sweep the on-chain htlc and the fee estimate turns out higher than this sweep the on-chain htlc and the fee estimate turns out higher than this
value, we cancel the swap. If the fee estimate is lower, we publish the value, we cancel the swap. If the fee estimate is lower, we publish the
sweep tx. sweep tx.
If the sweep tx isn't confirmed, we are forced to ratchet up fees until If the sweep tx is not confirmed, we are forced to ratchet up fees until it
it is swept. Possibly even exceeding max_miner_fee if we get close to the is swept. Possibly even exceeding max_miner_fee if we get close to the htlc
htlc timeout. Because the initial publication revealed the preimage, we timeout. Because the initial publication revealed the preimage, we have no
have no other choice. The server may already have pulled the off-chain other choice. The server may already have pulled the off-chain htlc. Only
htlc. Only when the fee becomes higher than the swap amount, we can only when the fee becomes higher than the swap amount, we can only wait for fees
wait for fees to come down and hope - if we are past the timeout - that to come down and hope - if we are past the timeout - that the server is not
the server isn't publishing the revocation. publishing the revocation.
max_miner_fee is typically taken from the response of the GetQuote call. max_miner_fee is typically taken from the response of the GetQuote call.
*/ */
int64 max_miner_fee = 7; int64 max_miner_fee = 7;
/** /**
The channel to uncharge. If zero, the channel to uncharge is selected based The channel to loop out, the channel to loop out is selected based on the
on the lowest routing fee for the swap payment to the server. lowest routing fee for the swap payment to the server.
*/ */
uint64 uncharge_channel = 8; uint64 loop_out_channel = 8;
} }
@ -78,7 +106,6 @@ message SwapResponse {
message MonitorRequest{ message MonitorRequest{
} }
message SwapStatus { message SwapStatus {
/** /**
Requested swap amount in sat. This does not include the swap and miner Requested swap amount in sat. This does not include the swap and miner
@ -119,10 +146,8 @@ message SwapStatus {
} }
enum SwapType { enum SwapType {
// UNCHARGE indicates an uncharge swap (off-chain to on-chain) // LOOP_OUT indicates an loop out swap (off-chain to on-chain)
UNCHARGE = 0; LOOP_OUT = 0;
} }
enum SwapState { enum SwapState {
@ -218,42 +243,11 @@ message QuoteResponse {
The part of the swap fee that is requested as a The part of the swap fee that is requested as a
prepayment. prepayment.
*/ */
int64 prepay_amt = 2; int64 prepay_amt = 2;
/** /**
An estimate of the on-chain fee that needs to be paid to An estimate of the on-chain fee that needs to be paid to
sweep the htlc. sweep the htlc.
*/ */
int64 miner_fee = 3; int64 miner_fee = 3;
} }
/**
SwapClient is a service that handles the client side process of onchain/offchain
swaps. The service is designed for a single client.
*/
service SwapClient {
/**
Uncharge initiates an uncharge 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().
*/
rpc Uncharge(UnchargeRequest) returns (SwapResponse);
/**
Monitor will return a stream of swap updates for currently active swaps.
*/
rpc Monitor(MonitorRequest) returns(stream SwapStatus);
/**
GetTerms returns the terms that the server enforces for swaps.
*/
rpc GetUnchargeTerms(TermsRequest) returns(TermsResponse);
/**
GetQuote returns a quote for a swap with the provided parameters.
*/
rpc GetUnchargeQuote(QuoteRequest) returns(QuoteResponse);
}

@ -24,7 +24,7 @@ var _ = math.Inf
// proto package needs to be updated. // proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ServerUnchargeSwapRequest struct { type ServerLoopOutRequest struct {
ReceiverKey []byte `protobuf:"bytes,1,opt,name=receiver_key,json=receiverKey,proto3" json:"receiver_key,omitempty"` ReceiverKey []byte `protobuf:"bytes,1,opt,name=receiver_key,json=receiverKey,proto3" json:"receiver_key,omitempty"`
SwapHash []byte `protobuf:"bytes,2,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"` SwapHash []byte `protobuf:"bytes,2,opt,name=swap_hash,json=swapHash,proto3" json:"swap_hash,omitempty"`
Amt uint64 `protobuf:"varint,3,opt,name=amt,proto3" json:"amt,omitempty"` Amt uint64 `protobuf:"varint,3,opt,name=amt,proto3" json:"amt,omitempty"`
@ -33,52 +33,52 @@ type ServerUnchargeSwapRequest struct {
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *ServerUnchargeSwapRequest) Reset() { *m = ServerUnchargeSwapRequest{} } func (m *ServerLoopOutRequest) Reset() { *m = ServerLoopOutRequest{} }
func (m *ServerUnchargeSwapRequest) String() string { return proto.CompactTextString(m) } func (m *ServerLoopOutRequest) String() string { return proto.CompactTextString(m) }
func (*ServerUnchargeSwapRequest) ProtoMessage() {} func (*ServerLoopOutRequest) ProtoMessage() {}
func (*ServerUnchargeSwapRequest) Descriptor() ([]byte, []int) { func (*ServerLoopOutRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_server_9aa9f93bbf0053c2, []int{0} return fileDescriptor_server_76a33eec530f39a2, []int{0}
} }
func (m *ServerUnchargeSwapRequest) XXX_Unmarshal(b []byte) error { func (m *ServerLoopOutRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ServerUnchargeSwapRequest.Unmarshal(m, b) return xxx_messageInfo_ServerLoopOutRequest.Unmarshal(m, b)
} }
func (m *ServerUnchargeSwapRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ServerLoopOutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ServerUnchargeSwapRequest.Marshal(b, m, deterministic) return xxx_messageInfo_ServerLoopOutRequest.Marshal(b, m, deterministic)
} }
func (dst *ServerUnchargeSwapRequest) XXX_Merge(src proto.Message) { func (dst *ServerLoopOutRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ServerUnchargeSwapRequest.Merge(dst, src) xxx_messageInfo_ServerLoopOutRequest.Merge(dst, src)
} }
func (m *ServerUnchargeSwapRequest) XXX_Size() int { func (m *ServerLoopOutRequest) XXX_Size() int {
return xxx_messageInfo_ServerUnchargeSwapRequest.Size(m) return xxx_messageInfo_ServerLoopOutRequest.Size(m)
} }
func (m *ServerUnchargeSwapRequest) XXX_DiscardUnknown() { func (m *ServerLoopOutRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ServerUnchargeSwapRequest.DiscardUnknown(m) xxx_messageInfo_ServerLoopOutRequest.DiscardUnknown(m)
} }
var xxx_messageInfo_ServerUnchargeSwapRequest proto.InternalMessageInfo var xxx_messageInfo_ServerLoopOutRequest proto.InternalMessageInfo
func (m *ServerUnchargeSwapRequest) GetReceiverKey() []byte { func (m *ServerLoopOutRequest) GetReceiverKey() []byte {
if m != nil { if m != nil {
return m.ReceiverKey return m.ReceiverKey
} }
return nil return nil
} }
func (m *ServerUnchargeSwapRequest) GetSwapHash() []byte { func (m *ServerLoopOutRequest) GetSwapHash() []byte {
if m != nil { if m != nil {
return m.SwapHash return m.SwapHash
} }
return nil return nil
} }
func (m *ServerUnchargeSwapRequest) GetAmt() uint64 { func (m *ServerLoopOutRequest) GetAmt() uint64 {
if m != nil { if m != nil {
return m.Amt return m.Amt
} }
return 0 return 0
} }
type ServerUnchargeSwapResponse struct { type ServerLoopOutResponse struct {
SwapInvoice string `protobuf:"bytes,1,opt,name=swap_invoice,json=swapInvoice,proto3" json:"swap_invoice,omitempty"` SwapInvoice string `protobuf:"bytes,1,opt,name=swap_invoice,json=swapInvoice,proto3" json:"swap_invoice,omitempty"`
PrepayInvoice string `protobuf:"bytes,2,opt,name=prepay_invoice,json=prepayInvoice,proto3" json:"prepay_invoice,omitempty"` PrepayInvoice string `protobuf:"bytes,2,opt,name=prepay_invoice,json=prepayInvoice,proto3" json:"prepay_invoice,omitempty"`
SenderKey []byte `protobuf:"bytes,3,opt,name=sender_key,json=senderKey,proto3" json:"sender_key,omitempty"` SenderKey []byte `protobuf:"bytes,3,opt,name=sender_key,json=senderKey,proto3" json:"sender_key,omitempty"`
@ -88,89 +88,89 @@ type ServerUnchargeSwapResponse struct {
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *ServerUnchargeSwapResponse) Reset() { *m = ServerUnchargeSwapResponse{} } func (m *ServerLoopOutResponse) Reset() { *m = ServerLoopOutResponse{} }
func (m *ServerUnchargeSwapResponse) String() string { return proto.CompactTextString(m) } func (m *ServerLoopOutResponse) String() string { return proto.CompactTextString(m) }
func (*ServerUnchargeSwapResponse) ProtoMessage() {} func (*ServerLoopOutResponse) ProtoMessage() {}
func (*ServerUnchargeSwapResponse) Descriptor() ([]byte, []int) { func (*ServerLoopOutResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_server_9aa9f93bbf0053c2, []int{1} return fileDescriptor_server_76a33eec530f39a2, []int{1}
} }
func (m *ServerUnchargeSwapResponse) XXX_Unmarshal(b []byte) error { func (m *ServerLoopOutResponse) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ServerUnchargeSwapResponse.Unmarshal(m, b) return xxx_messageInfo_ServerLoopOutResponse.Unmarshal(m, b)
} }
func (m *ServerUnchargeSwapResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ServerLoopOutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ServerUnchargeSwapResponse.Marshal(b, m, deterministic) return xxx_messageInfo_ServerLoopOutResponse.Marshal(b, m, deterministic)
} }
func (dst *ServerUnchargeSwapResponse) XXX_Merge(src proto.Message) { func (dst *ServerLoopOutResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_ServerUnchargeSwapResponse.Merge(dst, src) xxx_messageInfo_ServerLoopOutResponse.Merge(dst, src)
} }
func (m *ServerUnchargeSwapResponse) XXX_Size() int { func (m *ServerLoopOutResponse) XXX_Size() int {
return xxx_messageInfo_ServerUnchargeSwapResponse.Size(m) return xxx_messageInfo_ServerLoopOutResponse.Size(m)
} }
func (m *ServerUnchargeSwapResponse) XXX_DiscardUnknown() { func (m *ServerLoopOutResponse) XXX_DiscardUnknown() {
xxx_messageInfo_ServerUnchargeSwapResponse.DiscardUnknown(m) xxx_messageInfo_ServerLoopOutResponse.DiscardUnknown(m)
} }
var xxx_messageInfo_ServerUnchargeSwapResponse proto.InternalMessageInfo var xxx_messageInfo_ServerLoopOutResponse proto.InternalMessageInfo
func (m *ServerUnchargeSwapResponse) GetSwapInvoice() string { func (m *ServerLoopOutResponse) GetSwapInvoice() string {
if m != nil { if m != nil {
return m.SwapInvoice return m.SwapInvoice
} }
return "" return ""
} }
func (m *ServerUnchargeSwapResponse) GetPrepayInvoice() string { func (m *ServerLoopOutResponse) GetPrepayInvoice() string {
if m != nil { if m != nil {
return m.PrepayInvoice return m.PrepayInvoice
} }
return "" return ""
} }
func (m *ServerUnchargeSwapResponse) GetSenderKey() []byte { func (m *ServerLoopOutResponse) GetSenderKey() []byte {
if m != nil { if m != nil {
return m.SenderKey return m.SenderKey
} }
return nil return nil
} }
func (m *ServerUnchargeSwapResponse) GetExpiry() int32 { func (m *ServerLoopOutResponse) GetExpiry() int32 {
if m != nil { if m != nil {
return m.Expiry return m.Expiry
} }
return 0 return 0
} }
type ServerUnchargeQuoteRequest struct { type ServerLoopOutQuoteRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *ServerUnchargeQuoteRequest) Reset() { *m = ServerUnchargeQuoteRequest{} } func (m *ServerLoopOutQuoteRequest) Reset() { *m = ServerLoopOutQuoteRequest{} }
func (m *ServerUnchargeQuoteRequest) String() string { return proto.CompactTextString(m) } func (m *ServerLoopOutQuoteRequest) String() string { return proto.CompactTextString(m) }
func (*ServerUnchargeQuoteRequest) ProtoMessage() {} func (*ServerLoopOutQuoteRequest) ProtoMessage() {}
func (*ServerUnchargeQuoteRequest) Descriptor() ([]byte, []int) { func (*ServerLoopOutQuoteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_server_9aa9f93bbf0053c2, []int{2} return fileDescriptor_server_76a33eec530f39a2, []int{2}
} }
func (m *ServerUnchargeQuoteRequest) XXX_Unmarshal(b []byte) error { func (m *ServerLoopOutQuoteRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ServerUnchargeQuoteRequest.Unmarshal(m, b) return xxx_messageInfo_ServerLoopOutQuoteRequest.Unmarshal(m, b)
} }
func (m *ServerUnchargeQuoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ServerLoopOutQuoteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ServerUnchargeQuoteRequest.Marshal(b, m, deterministic) return xxx_messageInfo_ServerLoopOutQuoteRequest.Marshal(b, m, deterministic)
} }
func (dst *ServerUnchargeQuoteRequest) XXX_Merge(src proto.Message) { func (dst *ServerLoopOutQuoteRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ServerUnchargeQuoteRequest.Merge(dst, src) xxx_messageInfo_ServerLoopOutQuoteRequest.Merge(dst, src)
} }
func (m *ServerUnchargeQuoteRequest) XXX_Size() int { func (m *ServerLoopOutQuoteRequest) XXX_Size() int {
return xxx_messageInfo_ServerUnchargeQuoteRequest.Size(m) return xxx_messageInfo_ServerLoopOutQuoteRequest.Size(m)
} }
func (m *ServerUnchargeQuoteRequest) XXX_DiscardUnknown() { func (m *ServerLoopOutQuoteRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ServerUnchargeQuoteRequest.DiscardUnknown(m) xxx_messageInfo_ServerLoopOutQuoteRequest.DiscardUnknown(m)
} }
var xxx_messageInfo_ServerUnchargeQuoteRequest proto.InternalMessageInfo var xxx_messageInfo_ServerLoopOutQuoteRequest proto.InternalMessageInfo
type ServerUnchargeQuoteResponse struct { type ServerLoopOutQuote struct {
SwapPaymentDest string `protobuf:"bytes,1,opt,name=swap_payment_dest,json=swapPaymentDest,proto3" json:"swap_payment_dest,omitempty"` SwapPaymentDest string `protobuf:"bytes,1,opt,name=swap_payment_dest,json=swapPaymentDest,proto3" json:"swap_payment_dest,omitempty"`
SwapFeeBase int64 `protobuf:"varint,2,opt,name=swap_fee_base,json=swapFeeBase,proto3" json:"swap_fee_base,omitempty"` SwapFeeBase int64 `protobuf:"varint,2,opt,name=swap_fee_base,json=swapFeeBase,proto3" json:"swap_fee_base,omitempty"`
SwapFeeRate int64 `protobuf:"varint,3,opt,name=swap_fee_rate,json=swapFeeRate,proto3" json:"swap_fee_rate,omitempty"` SwapFeeRate int64 `protobuf:"varint,3,opt,name=swap_fee_rate,json=swapFeeRate,proto3" json:"swap_fee_rate,omitempty"`
@ -183,73 +183,73 @@ type ServerUnchargeQuoteResponse struct {
XXX_sizecache int32 `json:"-"` XXX_sizecache int32 `json:"-"`
} }
func (m *ServerUnchargeQuoteResponse) Reset() { *m = ServerUnchargeQuoteResponse{} } func (m *ServerLoopOutQuote) Reset() { *m = ServerLoopOutQuote{} }
func (m *ServerUnchargeQuoteResponse) String() string { return proto.CompactTextString(m) } func (m *ServerLoopOutQuote) String() string { return proto.CompactTextString(m) }
func (*ServerUnchargeQuoteResponse) ProtoMessage() {} func (*ServerLoopOutQuote) ProtoMessage() {}
func (*ServerUnchargeQuoteResponse) Descriptor() ([]byte, []int) { func (*ServerLoopOutQuote) Descriptor() ([]byte, []int) {
return fileDescriptor_server_9aa9f93bbf0053c2, []int{3} return fileDescriptor_server_76a33eec530f39a2, []int{3}
} }
func (m *ServerUnchargeQuoteResponse) XXX_Unmarshal(b []byte) error { func (m *ServerLoopOutQuote) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ServerUnchargeQuoteResponse.Unmarshal(m, b) return xxx_messageInfo_ServerLoopOutQuote.Unmarshal(m, b)
} }
func (m *ServerUnchargeQuoteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { func (m *ServerLoopOutQuote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ServerUnchargeQuoteResponse.Marshal(b, m, deterministic) return xxx_messageInfo_ServerLoopOutQuote.Marshal(b, m, deterministic)
} }
func (dst *ServerUnchargeQuoteResponse) XXX_Merge(src proto.Message) { func (dst *ServerLoopOutQuote) XXX_Merge(src proto.Message) {
xxx_messageInfo_ServerUnchargeQuoteResponse.Merge(dst, src) xxx_messageInfo_ServerLoopOutQuote.Merge(dst, src)
} }
func (m *ServerUnchargeQuoteResponse) XXX_Size() int { func (m *ServerLoopOutQuote) XXX_Size() int {
return xxx_messageInfo_ServerUnchargeQuoteResponse.Size(m) return xxx_messageInfo_ServerLoopOutQuote.Size(m)
} }
func (m *ServerUnchargeQuoteResponse) XXX_DiscardUnknown() { func (m *ServerLoopOutQuote) XXX_DiscardUnknown() {
xxx_messageInfo_ServerUnchargeQuoteResponse.DiscardUnknown(m) xxx_messageInfo_ServerLoopOutQuote.DiscardUnknown(m)
} }
var xxx_messageInfo_ServerUnchargeQuoteResponse proto.InternalMessageInfo var xxx_messageInfo_ServerLoopOutQuote proto.InternalMessageInfo
func (m *ServerUnchargeQuoteResponse) GetSwapPaymentDest() string { func (m *ServerLoopOutQuote) GetSwapPaymentDest() string {
if m != nil { if m != nil {
return m.SwapPaymentDest return m.SwapPaymentDest
} }
return "" return ""
} }
func (m *ServerUnchargeQuoteResponse) GetSwapFeeBase() int64 { func (m *ServerLoopOutQuote) GetSwapFeeBase() int64 {
if m != nil { if m != nil {
return m.SwapFeeBase return m.SwapFeeBase
} }
return 0 return 0
} }
func (m *ServerUnchargeQuoteResponse) GetSwapFeeRate() int64 { func (m *ServerLoopOutQuote) GetSwapFeeRate() int64 {
if m != nil { if m != nil {
return m.SwapFeeRate return m.SwapFeeRate
} }
return 0 return 0
} }
func (m *ServerUnchargeQuoteResponse) GetPrepayAmt() uint64 { func (m *ServerLoopOutQuote) GetPrepayAmt() uint64 {
if m != nil { if m != nil {
return m.PrepayAmt return m.PrepayAmt
} }
return 0 return 0
} }
func (m *ServerUnchargeQuoteResponse) GetMinSwapAmount() uint64 { func (m *ServerLoopOutQuote) GetMinSwapAmount() uint64 {
if m != nil { if m != nil {
return m.MinSwapAmount return m.MinSwapAmount
} }
return 0 return 0
} }
func (m *ServerUnchargeQuoteResponse) GetMaxSwapAmount() uint64 { func (m *ServerLoopOutQuote) GetMaxSwapAmount() uint64 {
if m != nil { if m != nil {
return m.MaxSwapAmount return m.MaxSwapAmount
} }
return 0 return 0
} }
func (m *ServerUnchargeQuoteResponse) GetCltvDelta() int32 { func (m *ServerLoopOutQuote) GetCltvDelta() int32 {
if m != nil { if m != nil {
return m.CltvDelta return m.CltvDelta
} }
@ -257,10 +257,10 @@ func (m *ServerUnchargeQuoteResponse) GetCltvDelta() int32 {
} }
func init() { func init() {
proto.RegisterType((*ServerUnchargeSwapRequest)(nil), "looprpc.ServerUnchargeSwapRequest") proto.RegisterType((*ServerLoopOutRequest)(nil), "looprpc.ServerLoopOutRequest")
proto.RegisterType((*ServerUnchargeSwapResponse)(nil), "looprpc.ServerUnchargeSwapResponse") proto.RegisterType((*ServerLoopOutResponse)(nil), "looprpc.ServerLoopOutResponse")
proto.RegisterType((*ServerUnchargeQuoteRequest)(nil), "looprpc.ServerUnchargeQuoteRequest") proto.RegisterType((*ServerLoopOutQuoteRequest)(nil), "looprpc.ServerLoopOutQuoteRequest")
proto.RegisterType((*ServerUnchargeQuoteResponse)(nil), "looprpc.ServerUnchargeQuoteResponse") proto.RegisterType((*ServerLoopOutQuote)(nil), "looprpc.ServerLoopOutQuote")
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -275,8 +275,8 @@ const _ = grpc.SupportPackageIsVersion4
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type SwapServerClient interface { type SwapServerClient interface {
NewUnchargeSwap(ctx context.Context, in *ServerUnchargeSwapRequest, opts ...grpc.CallOption) (*ServerUnchargeSwapResponse, error) NewLoopOutSwap(ctx context.Context, in *ServerLoopOutRequest, opts ...grpc.CallOption) (*ServerLoopOutResponse, error)
UnchargeQuote(ctx context.Context, in *ServerUnchargeQuoteRequest, opts ...grpc.CallOption) (*ServerUnchargeQuoteResponse, error) LoopOutQuote(ctx context.Context, in *ServerLoopOutQuoteRequest, opts ...grpc.CallOption) (*ServerLoopOutQuote, error)
} }
type swapServerClient struct { type swapServerClient struct {
@ -287,18 +287,18 @@ func NewSwapServerClient(cc *grpc.ClientConn) SwapServerClient {
return &swapServerClient{cc} return &swapServerClient{cc}
} }
func (c *swapServerClient) NewUnchargeSwap(ctx context.Context, in *ServerUnchargeSwapRequest, opts ...grpc.CallOption) (*ServerUnchargeSwapResponse, error) { func (c *swapServerClient) NewLoopOutSwap(ctx context.Context, in *ServerLoopOutRequest, opts ...grpc.CallOption) (*ServerLoopOutResponse, error) {
out := new(ServerUnchargeSwapResponse) out := new(ServerLoopOutResponse)
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/NewUnchargeSwap", in, out, opts...) err := c.cc.Invoke(ctx, "/looprpc.SwapServer/NewLoopOutSwap", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *swapServerClient) UnchargeQuote(ctx context.Context, in *ServerUnchargeQuoteRequest, opts ...grpc.CallOption) (*ServerUnchargeQuoteResponse, error) { func (c *swapServerClient) LoopOutQuote(ctx context.Context, in *ServerLoopOutQuoteRequest, opts ...grpc.CallOption) (*ServerLoopOutQuote, error) {
out := new(ServerUnchargeQuoteResponse) out := new(ServerLoopOutQuote)
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/UnchargeQuote", in, out, opts...) err := c.cc.Invoke(ctx, "/looprpc.SwapServer/LoopOutQuote", in, out, opts...)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -307,46 +307,46 @@ func (c *swapServerClient) UnchargeQuote(ctx context.Context, in *ServerUncharge
// SwapServerServer is the server API for SwapServer service. // SwapServerServer is the server API for SwapServer service.
type SwapServerServer interface { type SwapServerServer interface {
NewUnchargeSwap(context.Context, *ServerUnchargeSwapRequest) (*ServerUnchargeSwapResponse, error) NewLoopOutSwap(context.Context, *ServerLoopOutRequest) (*ServerLoopOutResponse, error)
UnchargeQuote(context.Context, *ServerUnchargeQuoteRequest) (*ServerUnchargeQuoteResponse, error) LoopOutQuote(context.Context, *ServerLoopOutQuoteRequest) (*ServerLoopOutQuote, error)
} }
func RegisterSwapServerServer(s *grpc.Server, srv SwapServerServer) { func RegisterSwapServerServer(s *grpc.Server, srv SwapServerServer) {
s.RegisterService(&_SwapServer_serviceDesc, srv) s.RegisterService(&_SwapServer_serviceDesc, srv)
} }
func _SwapServer_NewUnchargeSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _SwapServer_NewLoopOutSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ServerUnchargeSwapRequest) in := new(ServerLoopOutRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(SwapServerServer).NewUnchargeSwap(ctx, in) return srv.(SwapServerServer).NewLoopOutSwap(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: "/looprpc.SwapServer/NewUnchargeSwap", FullMethod: "/looprpc.SwapServer/NewLoopOutSwap",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SwapServerServer).NewUnchargeSwap(ctx, req.(*ServerUnchargeSwapRequest)) return srv.(SwapServerServer).NewLoopOutSwap(ctx, req.(*ServerLoopOutRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _SwapServer_UnchargeQuote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _SwapServer_LoopOutQuote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ServerUnchargeQuoteRequest) in := new(ServerLoopOutQuoteRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(SwapServerServer).UnchargeQuote(ctx, in) return srv.(SwapServerServer).LoopOutQuote(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: "/looprpc.SwapServer/UnchargeQuote", FullMethod: "/looprpc.SwapServer/LoopOutQuote",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SwapServerServer).UnchargeQuote(ctx, req.(*ServerUnchargeQuoteRequest)) return srv.(SwapServerServer).LoopOutQuote(ctx, req.(*ServerLoopOutQuoteRequest))
} }
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
@ -356,50 +356,50 @@ var _SwapServer_serviceDesc = grpc.ServiceDesc{
HandlerType: (*SwapServerServer)(nil), HandlerType: (*SwapServerServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{ {
MethodName: "NewUnchargeSwap", MethodName: "NewLoopOutSwap",
Handler: _SwapServer_NewUnchargeSwap_Handler, Handler: _SwapServer_NewLoopOutSwap_Handler,
}, },
{ {
MethodName: "UnchargeQuote", MethodName: "LoopOutQuote",
Handler: _SwapServer_UnchargeQuote_Handler, Handler: _SwapServer_LoopOutQuote_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "server.proto", Metadata: "server.proto",
} }
func init() { proto.RegisterFile("server.proto", fileDescriptor_server_9aa9f93bbf0053c2) } func init() { proto.RegisterFile("server.proto", fileDescriptor_server_76a33eec530f39a2) }
var fileDescriptor_server_9aa9f93bbf0053c2 = []byte{ var fileDescriptor_server_76a33eec530f39a2 = []byte{
// 471 bytes of a gzipped FileDescriptorProto // 467 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xdd, 0x6e, 0xd3, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xd1, 0x6e, 0xd3, 0x30,
0x10, 0x85, 0xe5, 0x26, 0x4d, 0xc9, 0x34, 0x21, 0xe0, 0x0b, 0x64, 0xd2, 0x56, 0x0a, 0x86, 0x42, 0x14, 0x86, 0x95, 0xb6, 0xeb, 0xe8, 0x59, 0xbb, 0x81, 0x05, 0x28, 0xb4, 0x14, 0x95, 0x48, 0x83,
0xc4, 0x45, 0x22, 0xc1, 0x13, 0xb4, 0xaa, 0x10, 0x08, 0x09, 0x81, 0x2b, 0x6e, 0x72, 0x63, 0x4d, 0x8a, 0x8b, 0x56, 0x82, 0x27, 0xd8, 0x34, 0x21, 0x10, 0x88, 0x42, 0x76, 0xc7, 0x4d, 0x74, 0xda,
0x9c, 0xc1, 0x5e, 0x61, 0xef, 0x2e, 0xbb, 0x9b, 0xbf, 0x87, 0x41, 0xbc, 0x0c, 0x0f, 0x86, 0xf6, 0x1e, 0x12, 0x8b, 0xc4, 0x36, 0xb1, 0xd3, 0x36, 0x2f, 0x82, 0x78, 0x0a, 0x9e, 0x11, 0xd9, 0xf1,
0xa7, 0x90, 0xa0, 0xb6, 0x77, 0xc9, 0xd9, 0x6f, 0x67, 0xce, 0x9c, 0x59, 0x43, 0x4f, 0x93, 0x5a, 0x60, 0x85, 0xb1, 0xbb, 0xe4, 0x3f, 0xdf, 0xf1, 0xf9, 0xfd, 0xe7, 0x04, 0xfa, 0x9a, 0xca, 0x0d,
0x91, 0x9a, 0x48, 0x25, 0x8c, 0x88, 0x8f, 0x6a, 0x21, 0xa4, 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, 0x13, 0x00, 0x00, 0xff, 0xff, 0x55, 0x2e, 0xbb, 0xee, 0xdf, 0x78, 0xf5, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x94, 0x23, 0x1c, 0x6e, 0x52,
0xfc, 0x38, 0x76, 0x7c, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00,
} }

@ -7,34 +7,44 @@ package looprpc;
option go_package = "github.com/lightninglabs/loop/looprpc"; option go_package = "github.com/lightninglabs/loop/looprpc";
service SwapServer { service SwapServer {
rpc NewUnchargeSwap(ServerUnchargeSwapRequest) returns (ServerUnchargeSwapResponse); rpc NewLoopOutSwap(ServerLoopOutRequest) returns (ServerLoopOutResponse);
rpc UnchargeQuote(ServerUnchargeQuoteRequest) returns (ServerUnchargeQuoteResponse); rpc LoopOutQuote(ServerLoopOutQuoteRequest) returns (ServerLoopOutQuote);
} }
message ServerUnchargeSwapRequest { message ServerLoopOutRequest {
bytes receiver_key = 1; bytes receiver_key = 1;
bytes swap_hash = 2; bytes swap_hash = 2;
uint64 amt = 3; uint64 amt = 3;
} }
message ServerUnchargeSwapResponse { message ServerLoopOutResponse {
string swap_invoice= 1; string swap_invoice= 1;
string prepay_invoice = 2; string prepay_invoice = 2;
bytes sender_key = 3; bytes sender_key = 3;
int32 expiry = 4; int32 expiry = 4;
} }
message ServerUnchargeQuoteRequest { message ServerLoopOutQuoteRequest {
} }
message ServerUnchargeQuoteResponse { message ServerLoopOutQuote {
string swap_payment_dest = 1; string swap_payment_dest = 1;
int64 swap_fee_base = 2; int64 swap_fee_base = 2;
int64 swap_fee_rate = 3; int64 swap_fee_rate = 3;
uint64 prepay_amt = 4; uint64 prepay_amt = 4;
uint64 min_swap_amount = 5; uint64 min_swap_amount = 5;
uint64 max_swap_amount = 6; uint64 max_swap_amount = 6;
int32 cltv_delta = 7; int32 cltv_delta = 7;
} }

Loading…
Cancel
Save