Merge pull request #88 from halseth/proto-quote-amount

server proto: add amt to ServerLoopOutQuoteRequest
pull/93/head
Johan T. Halseth 5 years ago committed by GitHub
commit 9039e5f97a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -353,11 +353,14 @@ func (s *Client) LoopOutQuote(ctx context.Context,
return nil, ErrSwapAmountTooHigh return nil, ErrSwapAmountTooHigh
} }
logger.Infof("Offchain swap destination: %x", terms.SwapPaymentDest) quote, err := s.Server.GetLoopOutQuote(ctx, request.Amount)
if err != nil {
return nil, err
}
swapFee := swap.CalcFee( logger.Infof("Offchain swap destination: %x", quote.SwapPaymentDest)
request.Amount, terms.SwapFeeBase, terms.SwapFeeRate,
) swapFee := quote.SwapFee
// Generate dummy p2wsh address for fee estimation. The p2wsh address // Generate dummy p2wsh address for fee estimation. The p2wsh address
// type is chosen because it adds the most weight of all output types // type is chosen because it adds the most weight of all output types
@ -379,9 +382,11 @@ func (s *Client) LoopOutQuote(ctx context.Context,
} }
return &LoopOutQuote{ return &LoopOutQuote{
SwapFee: swapFee, SwapFee: swapFee,
MinerFee: minerFee, MinerFee: minerFee,
PrepayAmount: btcutil.Amount(terms.PrepayAmt), PrepayAmount: btcutil.Amount(quote.PrepayAmount),
SwapPaymentDest: quote.SwapPaymentDest,
CltvDelta: quote.CltvDelta,
}, nil }, nil
} }
@ -465,10 +470,12 @@ func (s *Client) LoopInQuote(ctx context.Context,
return nil, ErrSwapAmountTooHigh return nil, ErrSwapAmountTooHigh
} }
// Calculate swap fee. quote, err := s.Server.GetLoopInQuote(ctx, request.Amount)
swapFee := terms.SwapFeeBase + if err != nil {
request.Amount*btcutil.Amount(terms.SwapFeeRate)/ return nil, err
btcutil.Amount(swap.FeeRateTotalParts) }
swapFee := quote.SwapFee
// We don't calculate the on-chain fee if the HTLC is going to be // We don't calculate the on-chain fee if the HTLC is going to be
// published externally. // published externally.
@ -478,7 +485,7 @@ func (s *Client) LoopInQuote(ctx context.Context,
MinerFee: 0, MinerFee: 0,
}, nil }, nil
} }
// Get estimate for miner fee. // Get estimate for miner fee.
minerFee, err := s.lndServices.Client.EstimateFeeToP2WSH( minerFee, err := s.lndServices.Client.EstimateFeeToP2WSH(
ctx, request.Amount, request.HtlcConfTarget, ctx, request.Amount, request.HtlcConfTarget,
@ -488,8 +495,9 @@ func (s *Client) LoopInQuote(ctx context.Context,
} }
return &LoopInQuote{ return &LoopInQuote{
SwapFee: swapFee, SwapFee: swapFee,
MinerFee: minerFee, MinerFee: minerFee,
CltvDelta: quote.CltvDelta,
}, nil }, nil
} }

@ -8,7 +8,6 @@ import (
"github.com/btcsuite/btcutil" "github.com/btcsuite/btcutil"
"github.com/lightninglabs/loop/looprpc" "github.com/lightninglabs/loop/looprpc"
"github.com/lightninglabs/loop/swap"
) )
var termsCommand = cli.Command{ var termsCommand = cli.Command{
@ -29,13 +28,6 @@ func terms(ctx *cli.Context) error {
btcutil.Amount(terms.MinSwapAmount), btcutil.Amount(terms.MinSwapAmount),
btcutil.Amount(terms.MaxSwapAmount), btcutil.Amount(terms.MaxSwapAmount),
) )
fmt.Printf("Fee: %d + %.4f %% (%d prepaid)\n",
btcutil.Amount(terms.SwapFeeBase),
swap.FeeRateAsPercentage(terms.SwapFeeRate),
btcutil.Amount(terms.PrepayAmt),
)
fmt.Printf("Cltv delta: %v blocks\n", terms.CltvDelta)
} }
fmt.Println("Loop Out") fmt.Println("Loop Out")

@ -244,10 +244,6 @@ func (s *swapClientServer) LoopOutTerms(ctx context.Context,
return &looprpc.TermsResponse{ return &looprpc.TermsResponse{
MinSwapAmount: int64(terms.MinSwapAmount), MinSwapAmount: int64(terms.MinSwapAmount),
MaxSwapAmount: int64(terms.MaxSwapAmount), MaxSwapAmount: int64(terms.MaxSwapAmount),
PrepayAmt: int64(terms.PrepayAmt),
SwapFeeBase: int64(terms.SwapFeeBase),
SwapFeeRate: int64(terms.SwapFeeRate),
CltvDelta: int32(terms.CltvDelta),
}, nil }, nil
} }
@ -269,10 +265,13 @@ func (s *swapClientServer) LoopOutQuote(ctx context.Context,
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &looprpc.QuoteResponse{ return &looprpc.QuoteResponse{
MinerFee: int64(quote.MinerFee), MinerFee: int64(quote.MinerFee),
PrepayAmt: int64(quote.PrepayAmount), PrepayAmt: int64(quote.PrepayAmount),
SwapFee: int64(quote.SwapFee), SwapFee: int64(quote.SwapFee),
SwapPaymentDest: quote.SwapPaymentDest[:],
CltvDelta: quote.CltvDelta,
}, nil }, nil
} }
@ -291,9 +290,6 @@ func (s *swapClientServer) GetLoopInTerms(ctx context.Context, req *looprpc.Term
return &looprpc.TermsResponse{ return &looprpc.TermsResponse{
MinSwapAmount: int64(terms.MinSwapAmount), MinSwapAmount: int64(terms.MinSwapAmount),
MaxSwapAmount: int64(terms.MaxSwapAmount), MaxSwapAmount: int64(terms.MaxSwapAmount),
SwapFeeBase: int64(terms.SwapFeeBase),
SwapFeeRate: int64(terms.SwapFeeRate),
CltvDelta: int32(terms.CltvDelta),
}, nil }, nil
} }

@ -105,6 +105,17 @@ type LoopOutQuoteRequest struct {
// final cltv delta values for the off-chain payments. // final cltv delta values for the off-chain payments.
} }
// LoopOutTerms are the server terms on which it executes swaps.
type LoopOutTerms struct {
// MinSwapAmount is the minimum amount that the server requires for a
// swap.
MinSwapAmount btcutil.Amount
// MaxSwapAmount is the maximum amount that the server accepts for a
// swap.
MaxSwapAmount btcutil.Amount
}
// LoopOutQuote contains estimates for the fees making up the total swap cost // LoopOutQuote contains estimates for the fees making up the total swap cost
// for the client. // for the client.
type LoopOutQuote struct { type LoopOutQuote struct {
@ -118,27 +129,6 @@ type LoopOutQuote struct {
// MinerFee is an estimate of the on-chain fee that needs to be paid to // MinerFee is an estimate of the on-chain fee that needs to be paid to
// sweep the htlc. // sweep the htlc.
MinerFee btcutil.Amount MinerFee btcutil.Amount
}
// LoopOutTerms are the server terms on which it executes swaps.
type LoopOutTerms struct {
// SwapFeeBase is the fixed per-swap base fee.
SwapFeeBase btcutil.Amount
// SwapFeeRate is the variable fee in parts per million.
SwapFeeRate int64
// PrepayAmt is the fixed part of the swap fee that needs to be
// prepaid.
PrepayAmt btcutil.Amount
// MinSwapAmount is the minimum amount that the server requires for a
// swap.
MinSwapAmount btcutil.Amount
// MaxSwapAmount is the maximum amount that the server accepts for a
// swap.
MaxSwapAmount btcutil.Amount
// Time lock delta relative to current block height that swap server // Time lock delta relative to current block height that swap server
// will accept on the swap initiation call. // will accept on the swap initiation call.
@ -185,12 +175,6 @@ type LoopInRequest struct {
// LoopInTerms are the server terms on which it executes charge swaps. // LoopInTerms are the server terms on which it executes charge swaps.
type LoopInTerms struct { type LoopInTerms struct {
// SwapFeeBase is the fixed per-swap base fee.
SwapFeeBase btcutil.Amount
// SwapFeeRate is the variable fee in parts per million.
SwapFeeRate int64
// MinSwapAmount is the minimum amount that the server requires for a // MinSwapAmount is the minimum amount that the server requires for a
// swap. // swap.
MinSwapAmount btcutil.Amount MinSwapAmount btcutil.Amount
@ -198,10 +182,6 @@ type LoopInTerms struct {
// MaxSwapAmount is the maximum amount that the server accepts for a // MaxSwapAmount is the maximum amount that the server accepts for a
// swap. // swap.
MaxSwapAmount btcutil.Amount MaxSwapAmount btcutil.Amount
// Time lock delta relative to current block height that swap server
// will accept on the swap initiation call.
CltvDelta int32
} }
// In contains status information for a loop in swap. // In contains status information for a loop in swap.
@ -239,6 +219,10 @@ type LoopInQuote struct {
// MinerFee is an estimate of the on-chain fee that needs to be paid to // MinerFee is an estimate of the on-chain fee that needs to be paid to
// sweep the htlc. // sweep the htlc.
MinerFee btcutil.Amount MinerFee btcutil.Amount
// Time lock delta relative to current block height that swap server
// will accept on the swap initiation call.
CltvDelta int32
} }
// SwapInfoKit contains common swap info fields. // SwapInfoKit contains common swap info fields.

@ -60,14 +60,12 @@ func newLoopInSwap(globalCtx context.Context, cfg *swapConfig,
// Request current server loop in terms and use these to calculate the // Request current server loop in terms and use these to calculate the
// swap fee that we should subtract from the swap amount in the payment // swap fee that we should subtract from the swap amount in the payment
// request that we send to the server. // request that we send to the server.
quote, err := cfg.server.GetLoopInTerms(globalCtx) quote, err := cfg.server.GetLoopInQuote(globalCtx, request.Amount)
if err != nil { if err != nil {
return nil, fmt.Errorf("loop in terms: %v", err) return nil, fmt.Errorf("loop in terms: %v", err)
} }
swapFee := swap.CalcFee( swapFee := quote.SwapFee
request.Amount, quote.SwapFeeBase, quote.SwapFeeRate,
)
if swapFee > request.MaxSwapFee { if swapFee > request.MaxSwapFee {
logger.Warnf("Swap fee %v exceeding maximum of %v", logger.Warnf("Swap fee %v exceeding maximum of %v",

@ -590,28 +590,12 @@ func (m *TermsRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_TermsRequest proto.InternalMessageInfo var xxx_messageInfo_TermsRequest proto.InternalMessageInfo
type TermsResponse struct { type TermsResponse struct {
//*
//The node pubkey where the swap payment needs to be paid
//to. This can be used to test connectivity before initiating the swap.
SwapPaymentDest string `protobuf:"bytes,1,opt,name=swap_payment_dest,json=swapPaymentDest,proto3" json:"swap_payment_dest,omitempty"`
//*
//The base fee for a swap (sat)
SwapFeeBase int64 `protobuf:"varint,2,opt,name=swap_fee_base,json=swapFeeBase,proto3" json:"swap_fee_base,omitempty"`
//*
//The fee rate for a swap (parts per million)
SwapFeeRate int64 `protobuf:"varint,3,opt,name=swap_fee_rate,json=swapFeeRate,proto3" json:"swap_fee_rate,omitempty"`
//*
//Required prepay amount
PrepayAmt int64 `protobuf:"varint,4,opt,name=prepay_amt,json=prepayAmt,proto3" json:"prepay_amt,omitempty"`
//* //*
//Minimum swap amount (sat) //Minimum swap amount (sat)
MinSwapAmount int64 `protobuf:"varint,5,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"` MinSwapAmount int64 `protobuf:"varint,5,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"`
//* //*
//Maximum swap amount (sat) //Maximum swap amount (sat)
MaxSwapAmount int64 `protobuf:"varint,6,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"` MaxSwapAmount int64 `protobuf:"varint,6,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"`
//*
//On-chain cltv expiry delta
CltvDelta int32 `protobuf:"varint,7,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,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:"-"`
@ -642,34 +626,6 @@ func (m *TermsResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_TermsResponse proto.InternalMessageInfo var xxx_messageInfo_TermsResponse proto.InternalMessageInfo
func (m *TermsResponse) GetSwapPaymentDest() string {
if m != nil {
return m.SwapPaymentDest
}
return ""
}
func (m *TermsResponse) GetSwapFeeBase() int64 {
if m != nil {
return m.SwapFeeBase
}
return 0
}
func (m *TermsResponse) GetSwapFeeRate() int64 {
if m != nil {
return m.SwapFeeRate
}
return 0
}
func (m *TermsResponse) GetPrepayAmt() int64 {
if m != nil {
return m.PrepayAmt
}
return 0
}
func (m *TermsResponse) GetMinSwapAmount() int64 { func (m *TermsResponse) GetMinSwapAmount() int64 {
if m != nil { if m != nil {
return m.MinSwapAmount return m.MinSwapAmount
@ -684,13 +640,6 @@ func (m *TermsResponse) GetMaxSwapAmount() int64 {
return 0 return 0
} }
func (m *TermsResponse) GetCltvDelta() int32 {
if m != nil {
return m.CltvDelta
}
return 0
}
type QuoteRequest struct { type QuoteRequest struct {
//* //*
//The amount to swap in satoshis. //The amount to swap in satoshis.
@ -765,7 +714,14 @@ type QuoteResponse struct {
PrepayAmt int64 `protobuf:"varint,2,opt,name=prepay_amt,json=prepayAmt,proto3" json:"prepay_amt,omitempty"` PrepayAmt int64 `protobuf:"varint,2,opt,name=prepay_amt,json=prepayAmt,proto3" json:"prepay_amt,omitempty"`
//* //*
//An estimate of the on-chain fee that needs to be paid to sweep the HTLC. //An estimate of the on-chain fee that needs to be paid to sweep the HTLC.
MinerFee int64 `protobuf:"varint,3,opt,name=miner_fee,json=minerFee,proto3" json:"miner_fee,omitempty"` MinerFee int64 `protobuf:"varint,3,opt,name=miner_fee,json=minerFee,proto3" json:"miner_fee,omitempty"`
//*
//The node pubkey where the swap payment needs to be paid
//to. This can be used to test connectivity before initiating the swap.
SwapPaymentDest []byte `protobuf:"bytes,4,opt,name=swap_payment_dest,json=swapPaymentDest,proto3" json:"swap_payment_dest,omitempty"`
//*
//On-chain cltv expiry delta
CltvDelta int32 `protobuf:"varint,5,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,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:"-"`
@ -817,6 +773,20 @@ func (m *QuoteResponse) GetMinerFee() int64 {
return 0 return 0
} }
func (m *QuoteResponse) GetSwapPaymentDest() []byte {
if m != nil {
return m.SwapPaymentDest
}
return nil
}
func (m *QuoteResponse) GetCltvDelta() int32 {
if m != nil {
return m.CltvDelta
}
return 0
}
func init() { func init() {
proto.RegisterEnum("looprpc.SwapType", SwapType_name, SwapType_value) proto.RegisterEnum("looprpc.SwapType", SwapType_name, SwapType_value)
proto.RegisterEnum("looprpc.SwapState", SwapState_name, SwapState_value) proto.RegisterEnum("looprpc.SwapState", SwapState_name, SwapState_value)
@ -834,74 +804,74 @@ func init() {
func init() { proto.RegisterFile("client.proto", fileDescriptor_014de31d7ac8c57c) } func init() { proto.RegisterFile("client.proto", fileDescriptor_014de31d7ac8c57c) }
var fileDescriptor_014de31d7ac8c57c = []byte{ var fileDescriptor_014de31d7ac8c57c = []byte{
// 1065 bytes of a gzipped FileDescriptorProto // 1061 bytes of a gzipped FileDescri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xa4, 0xee, 0xdc, 0x67, 0x55, 0xbf, 0x8f, 0x47, 0xec, 0x70, 0xde, 0x32, 0xa9, 0x37, 0xf7, 0x49, 0xdd, 0x3f, 0xc3, 0x12, 0xdb, 0xa4, 0x96, 0xdb, 0x67,
0x90, 0x46, 0xa6, 0x9f, 0x49, 0xf1, 0x3f, 0x67, 0xb4, 0x3f, 0xab, 0xfc, 0x17, 0xa8, 0xbd, 0x4f, 0xda, 0xfc, 0x2f, 0x39, 0xed, 0x4f, 0x6a, 0xff, 0x05, 0x6a, 0x3f, 0x23, 0x4f, 0xf3, 0xda, 0xb9,
0xf6, 0xb2, 0xda, 0x99, 0xea, 0x3f, 0x6c, 0xe3, 0x7f, 0x33, 0xaf, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xee, 0x7f, 0xdd, 0xc0, 0x7f, 0x42, 0x5e, 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x26, 0x06, 0x26,
0xff, 0x71, 0xf8, 0xf7, 0x7c, 0x04, 0x09, 0x00, 0x00, 0x30, 0xbb, 0x08, 0x00, 0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.

@ -305,26 +305,8 @@ message TermsRequest {
} }
message TermsResponse { message TermsResponse {
/**
The node pubkey where the swap payment needs to be paid
to. This can be used to test connectivity before initiating the swap.
*/
string swap_payment_dest = 1;
/** reserved 1,2,3,4,7;
The base fee for a swap (sat)
*/
int64 swap_fee_base = 2;
/**
The fee rate for a swap (parts per million)
*/
int64 swap_fee_rate = 3;
/**
Required prepay amount
*/
int64 prepay_amt = 4;
/** /**
Minimum swap amount (sat) Minimum swap amount (sat)
@ -335,11 +317,6 @@ message TermsResponse {
Maximum swap amount (sat) Maximum swap amount (sat)
*/ */
int64 max_swap_amount = 6; int64 max_swap_amount = 6;
/**
On-chain cltv expiry delta
*/
int32 cltv_delta = 7;
} }
message QuoteRequest { message QuoteRequest {
@ -378,4 +355,15 @@ message QuoteResponse {
An estimate of the on-chain fee that needs to be paid to sweep the HTLC. An estimate of the on-chain fee that needs to be paid to sweep the HTLC.
*/ */
int64 miner_fee = 3; int64 miner_fee = 3;
/**
The node pubkey where the swap payment needs to be paid
to. This can be used to test connectivity before initiating the swap.
*/
bytes swap_payment_dest = 4;
/**
On-chain cltv expiry delta
*/
int32 cltv_delta = 5;
} }

@ -285,6 +285,16 @@
"type": "string", "type": "string",
"format": "int64", "format": "int64",
"description": "*\nAn estimate of the on-chain fee that needs to be paid to sweep the HTLC." "description": "*\nAn estimate of the on-chain fee that needs to be paid to sweep the HTLC."
},
"swap_payment_dest": {
"type": "string",
"format": "byte",
"description": "*\nThe node pubkey where the swap payment needs to be paid\nto. This can be used to test connectivity before initiating the swap."
},
"cltv_delta": {
"type": "integer",
"format": "int32",
"title": "*\nOn-chain cltv expiry delta"
} }
} }
}, },
@ -377,25 +387,6 @@
"looprpcTermsResponse": { "looprpcTermsResponse": {
"type": "object", "type": "object",
"properties": { "properties": {
"swap_payment_dest": {
"type": "string",
"description": "*\nThe node pubkey where the swap payment needs to be paid\nto. This can be used to test connectivity before initiating the swap."
},
"swap_fee_base": {
"type": "string",
"format": "int64",
"title": "*\nThe base fee for a swap (sat)"
},
"swap_fee_rate": {
"type": "string",
"format": "int64",
"title": "*\nThe fee rate for a swap (parts per million)"
},
"prepay_amt": {
"type": "string",
"format": "int64",
"title": "*\nRequired prepay amount"
},
"min_swap_amount": { "min_swap_amount": {
"type": "string", "type": "string",
"format": "int64", "format": "int64",
@ -405,11 +396,6 @@
"type": "string", "type": "string",
"format": "int64", "format": "int64",
"title": "*\nMaximum swap amount (sat)" "title": "*\nMaximum swap amount (sat)"
},
"cltv_delta": {
"type": "integer",
"format": "int32",
"title": "*\nOn-chain cltv expiry delta"
} }
} }
} }

@ -142,6 +142,8 @@ func (m *ServerLoopOutResponse) GetExpiry() int32 {
} }
type ServerLoopOutQuoteRequest struct { type ServerLoopOutQuoteRequest struct {
/// The swap amount. If zero, a quote for a maximum amt swap will be given.
Amt uint64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,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:"-"`
@ -172,13 +174,22 @@ func (m *ServerLoopOutQuoteRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_ServerLoopOutQuoteRequest proto.InternalMessageInfo var xxx_messageInfo_ServerLoopOutQuoteRequest proto.InternalMessageInfo
func (m *ServerLoopOutQuoteRequest) GetAmt() uint64 {
if m != nil {
return m.Amt
}
return 0
}
type ServerLoopOutQuote 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"` /// The total estimated swap fee given the quote amt.
SwapFeeRate int64 `protobuf:"varint,3,opt,name=swap_fee_rate,json=swapFeeRate,proto3" json:"swap_fee_rate,omitempty"` SwapFee int64 `protobuf:"varint,2,opt,name=swap_fee,json=swapFee,proto3" json:"swap_fee,omitempty"`
/// Deprecated, total swap fee given quote amt is calculated in swap_fee.
SwapFeeRate int64 `protobuf:"varint,3,opt,name=swap_fee_rate,json=swapFeeRate,proto3" json:"swap_fee_rate,omitempty"` // Deprecated: Do not use.
PrepayAmt uint64 `protobuf:"varint,4,opt,name=prepay_amt,json=prepayAmt,proto3" json:"prepay_amt,omitempty"` PrepayAmt uint64 `protobuf:"varint,4,opt,name=prepay_amt,json=prepayAmt,proto3" json:"prepay_amt,omitempty"`
MinSwapAmount uint64 `protobuf:"varint,5,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"` MinSwapAmount uint64 `protobuf:"varint,5,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"` // Deprecated: Do not use.
MaxSwapAmount uint64 `protobuf:"varint,6,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"` MaxSwapAmount uint64 `protobuf:"varint,6,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"` // Deprecated: Do not use.
CltvDelta int32 `protobuf:"varint,7,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,omitempty"` CltvDelta int32 `protobuf:"varint,7,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
@ -217,13 +228,14 @@ func (m *ServerLoopOutQuote) GetSwapPaymentDest() string {
return "" return ""
} }
func (m *ServerLoopOutQuote) GetSwapFeeBase() int64 { func (m *ServerLoopOutQuote) GetSwapFee() int64 {
if m != nil { if m != nil {
return m.SwapFeeBase return m.SwapFee
} }
return 0 return 0
} }
// Deprecated: Do not use.
func (m *ServerLoopOutQuote) GetSwapFeeRate() int64 { func (m *ServerLoopOutQuote) GetSwapFeeRate() int64 {
if m != nil { if m != nil {
return m.SwapFeeRate return m.SwapFeeRate
@ -238,6 +250,7 @@ func (m *ServerLoopOutQuote) GetPrepayAmt() uint64 {
return 0 return 0
} }
// Deprecated: Do not use.
func (m *ServerLoopOutQuote) GetMinSwapAmount() uint64 { func (m *ServerLoopOutQuote) GetMinSwapAmount() uint64 {
if m != nil { if m != nil {
return m.MinSwapAmount return m.MinSwapAmount
@ -245,6 +258,7 @@ func (m *ServerLoopOutQuote) GetMinSwapAmount() uint64 {
return 0 return 0
} }
// Deprecated: Do not use.
func (m *ServerLoopOutQuote) GetMaxSwapAmount() uint64 { func (m *ServerLoopOutQuote) GetMaxSwapAmount() uint64 {
if m != nil { if m != nil {
return m.MaxSwapAmount return m.MaxSwapAmount
@ -259,6 +273,84 @@ func (m *ServerLoopOutQuote) GetCltvDelta() int32 {
return 0 return 0
} }
type ServerLoopOutTermsRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ServerLoopOutTermsRequest) Reset() { *m = ServerLoopOutTermsRequest{} }
func (m *ServerLoopOutTermsRequest) String() string { return proto.CompactTextString(m) }
func (*ServerLoopOutTermsRequest) ProtoMessage() {}
func (*ServerLoopOutTermsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_ad098daeda4239f7, []int{4}
}
func (m *ServerLoopOutTermsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ServerLoopOutTermsRequest.Unmarshal(m, b)
}
func (m *ServerLoopOutTermsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ServerLoopOutTermsRequest.Marshal(b, m, deterministic)
}
func (m *ServerLoopOutTermsRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ServerLoopOutTermsRequest.Merge(m, src)
}
func (m *ServerLoopOutTermsRequest) XXX_Size() int {
return xxx_messageInfo_ServerLoopOutTermsRequest.Size(m)
}
func (m *ServerLoopOutTermsRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ServerLoopOutTermsRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ServerLoopOutTermsRequest proto.InternalMessageInfo
type ServerLoopOutTerms struct {
MinSwapAmount uint64 `protobuf:"varint,1,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"`
MaxSwapAmount uint64 `protobuf:"varint,2,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ServerLoopOutTerms) Reset() { *m = ServerLoopOutTerms{} }
func (m *ServerLoopOutTerms) String() string { return proto.CompactTextString(m) }
func (*ServerLoopOutTerms) ProtoMessage() {}
func (*ServerLoopOutTerms) Descriptor() ([]byte, []int) {
return fileDescriptor_ad098daeda4239f7, []int{5}
}
func (m *ServerLoopOutTerms) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ServerLoopOutTerms.Unmarshal(m, b)
}
func (m *ServerLoopOutTerms) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ServerLoopOutTerms.Marshal(b, m, deterministic)
}
func (m *ServerLoopOutTerms) XXX_Merge(src proto.Message) {
xxx_messageInfo_ServerLoopOutTerms.Merge(m, src)
}
func (m *ServerLoopOutTerms) XXX_Size() int {
return xxx_messageInfo_ServerLoopOutTerms.Size(m)
}
func (m *ServerLoopOutTerms) XXX_DiscardUnknown() {
xxx_messageInfo_ServerLoopOutTerms.DiscardUnknown(m)
}
var xxx_messageInfo_ServerLoopOutTerms proto.InternalMessageInfo
func (m *ServerLoopOutTerms) GetMinSwapAmount() uint64 {
if m != nil {
return m.MinSwapAmount
}
return 0
}
func (m *ServerLoopOutTerms) GetMaxSwapAmount() uint64 {
if m != nil {
return m.MaxSwapAmount
}
return 0
}
type ServerLoopInRequest struct { type ServerLoopInRequest struct {
SenderKey []byte `protobuf:"bytes,1,opt,name=sender_key,json=senderKey,proto3" json:"sender_key,omitempty"` SenderKey []byte `protobuf:"bytes,1,opt,name=sender_key,json=senderKey,proto3" json:"sender_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"`
@ -273,7 +365,7 @@ func (m *ServerLoopInRequest) Reset() { *m = ServerLoopInRequest{} }
func (m *ServerLoopInRequest) String() string { return proto.CompactTextString(m) } func (m *ServerLoopInRequest) String() string { return proto.CompactTextString(m) }
func (*ServerLoopInRequest) ProtoMessage() {} func (*ServerLoopInRequest) ProtoMessage() {}
func (*ServerLoopInRequest) Descriptor() ([]byte, []int) { func (*ServerLoopInRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_ad098daeda4239f7, []int{4} return fileDescriptor_ad098daeda4239f7, []int{6}
} }
func (m *ServerLoopInRequest) XXX_Unmarshal(b []byte) error { func (m *ServerLoopInRequest) XXX_Unmarshal(b []byte) error {
@ -334,7 +426,7 @@ func (m *ServerLoopInResponse) Reset() { *m = ServerLoopInResponse{} }
func (m *ServerLoopInResponse) String() string { return proto.CompactTextString(m) } func (m *ServerLoopInResponse) String() string { return proto.CompactTextString(m) }
func (*ServerLoopInResponse) ProtoMessage() {} func (*ServerLoopInResponse) ProtoMessage() {}
func (*ServerLoopInResponse) Descriptor() ([]byte, []int) { func (*ServerLoopInResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_ad098daeda4239f7, []int{5} return fileDescriptor_ad098daeda4239f7, []int{7}
} }
func (m *ServerLoopInResponse) XXX_Unmarshal(b []byte) error { func (m *ServerLoopInResponse) XXX_Unmarshal(b []byte) error {
@ -370,6 +462,8 @@ func (m *ServerLoopInResponse) GetExpiry() int32 {
} }
type ServerLoopInQuoteRequest struct { type ServerLoopInQuoteRequest struct {
/// The swap amount. If zero, a quote for a maximum amt swap will be given.
Amt uint64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,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:"-"`
@ -379,7 +473,7 @@ func (m *ServerLoopInQuoteRequest) Reset() { *m = ServerLoopInQuoteReque
func (m *ServerLoopInQuoteRequest) String() string { return proto.CompactTextString(m) } func (m *ServerLoopInQuoteRequest) String() string { return proto.CompactTextString(m) }
func (*ServerLoopInQuoteRequest) ProtoMessage() {} func (*ServerLoopInQuoteRequest) ProtoMessage() {}
func (*ServerLoopInQuoteRequest) Descriptor() ([]byte, []int) { func (*ServerLoopInQuoteRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_ad098daeda4239f7, []int{6} return fileDescriptor_ad098daeda4239f7, []int{8}
} }
func (m *ServerLoopInQuoteRequest) XXX_Unmarshal(b []byte) error { func (m *ServerLoopInQuoteRequest) XXX_Unmarshal(b []byte) error {
@ -400,11 +494,18 @@ func (m *ServerLoopInQuoteRequest) XXX_DiscardUnknown() {
var xxx_messageInfo_ServerLoopInQuoteRequest proto.InternalMessageInfo var xxx_messageInfo_ServerLoopInQuoteRequest proto.InternalMessageInfo
func (m *ServerLoopInQuoteRequest) GetAmt() uint64 {
if m != nil {
return m.Amt
}
return 0
}
type ServerLoopInQuoteResponse struct { type ServerLoopInQuoteResponse struct {
SwapFeeBase int64 `protobuf:"varint,1,opt,name=swap_fee_base,json=swapFeeBase,proto3" json:"swap_fee_base,omitempty"` SwapFee int64 `protobuf:"varint,1,opt,name=swap_fee,json=swapFee,proto3" json:"swap_fee,omitempty"`
SwapFeeRate int64 `protobuf:"varint,2,opt,name=swap_fee_rate,json=swapFeeRate,proto3" json:"swap_fee_rate,omitempty"` SwapFeeRate int64 `protobuf:"varint,2,opt,name=swap_fee_rate,json=swapFeeRate,proto3" json:"swap_fee_rate,omitempty"` // Deprecated: Do not use.
MinSwapAmount uint64 `protobuf:"varint,4,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"` MinSwapAmount uint64 `protobuf:"varint,4,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"` // Deprecated: Do not use.
MaxSwapAmount uint64 `protobuf:"varint,5,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"` MaxSwapAmount uint64 `protobuf:"varint,5,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"` // Deprecated: Do not use.
CltvDelta int32 `protobuf:"varint,6,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,omitempty"` CltvDelta int32 `protobuf:"varint,6,opt,name=cltv_delta,json=cltvDelta,proto3" json:"cltv_delta,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"` XXX_unrecognized []byte `json:"-"`
@ -415,7 +516,7 @@ func (m *ServerLoopInQuoteResponse) Reset() { *m = ServerLoopInQuoteResp
func (m *ServerLoopInQuoteResponse) String() string { return proto.CompactTextString(m) } func (m *ServerLoopInQuoteResponse) String() string { return proto.CompactTextString(m) }
func (*ServerLoopInQuoteResponse) ProtoMessage() {} func (*ServerLoopInQuoteResponse) ProtoMessage() {}
func (*ServerLoopInQuoteResponse) Descriptor() ([]byte, []int) { func (*ServerLoopInQuoteResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_ad098daeda4239f7, []int{7} return fileDescriptor_ad098daeda4239f7, []int{9}
} }
func (m *ServerLoopInQuoteResponse) XXX_Unmarshal(b []byte) error { func (m *ServerLoopInQuoteResponse) XXX_Unmarshal(b []byte) error {
@ -436,13 +537,14 @@ func (m *ServerLoopInQuoteResponse) XXX_DiscardUnknown() {
var xxx_messageInfo_ServerLoopInQuoteResponse proto.InternalMessageInfo var xxx_messageInfo_ServerLoopInQuoteResponse proto.InternalMessageInfo
func (m *ServerLoopInQuoteResponse) GetSwapFeeBase() int64 { func (m *ServerLoopInQuoteResponse) GetSwapFee() int64 {
if m != nil { if m != nil {
return m.SwapFeeBase return m.SwapFee
} }
return 0 return 0
} }
// Deprecated: Do not use.
func (m *ServerLoopInQuoteResponse) GetSwapFeeRate() int64 { func (m *ServerLoopInQuoteResponse) GetSwapFeeRate() int64 {
if m != nil { if m != nil {
return m.SwapFeeRate return m.SwapFeeRate
@ -450,6 +552,7 @@ func (m *ServerLoopInQuoteResponse) GetSwapFeeRate() int64 {
return 0 return 0
} }
// Deprecated: Do not use.
func (m *ServerLoopInQuoteResponse) GetMinSwapAmount() uint64 { func (m *ServerLoopInQuoteResponse) GetMinSwapAmount() uint64 {
if m != nil { if m != nil {
return m.MinSwapAmount return m.MinSwapAmount
@ -457,6 +560,7 @@ func (m *ServerLoopInQuoteResponse) GetMinSwapAmount() uint64 {
return 0 return 0
} }
// Deprecated: Do not use.
func (m *ServerLoopInQuoteResponse) GetMaxSwapAmount() uint64 { func (m *ServerLoopInQuoteResponse) GetMaxSwapAmount() uint64 {
if m != nil { if m != nil {
return m.MaxSwapAmount return m.MaxSwapAmount
@ -471,58 +575,144 @@ func (m *ServerLoopInQuoteResponse) GetCltvDelta() int32 {
return 0 return 0
} }
type ServerLoopInTermsRequest struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ServerLoopInTermsRequest) Reset() { *m = ServerLoopInTermsRequest{} }
func (m *ServerLoopInTermsRequest) String() string { return proto.CompactTextString(m) }
func (*ServerLoopInTermsRequest) ProtoMessage() {}
func (*ServerLoopInTermsRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_ad098daeda4239f7, []int{10}
}
func (m *ServerLoopInTermsRequest) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ServerLoopInTermsRequest.Unmarshal(m, b)
}
func (m *ServerLoopInTermsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ServerLoopInTermsRequest.Marshal(b, m, deterministic)
}
func (m *ServerLoopInTermsRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_ServerLoopInTermsRequest.Merge(m, src)
}
func (m *ServerLoopInTermsRequest) XXX_Size() int {
return xxx_messageInfo_ServerLoopInTermsRequest.Size(m)
}
func (m *ServerLoopInTermsRequest) XXX_DiscardUnknown() {
xxx_messageInfo_ServerLoopInTermsRequest.DiscardUnknown(m)
}
var xxx_messageInfo_ServerLoopInTermsRequest proto.InternalMessageInfo
type ServerLoopInTerms struct {
MinSwapAmount uint64 `protobuf:"varint,1,opt,name=min_swap_amount,json=minSwapAmount,proto3" json:"min_swap_amount,omitempty"`
MaxSwapAmount uint64 `protobuf:"varint,2,opt,name=max_swap_amount,json=maxSwapAmount,proto3" json:"max_swap_amount,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (m *ServerLoopInTerms) Reset() { *m = ServerLoopInTerms{} }
func (m *ServerLoopInTerms) String() string { return proto.CompactTextString(m) }
func (*ServerLoopInTerms) ProtoMessage() {}
func (*ServerLoopInTerms) Descriptor() ([]byte, []int) {
return fileDescriptor_ad098daeda4239f7, []int{11}
}
func (m *ServerLoopInTerms) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ServerLoopInTerms.Unmarshal(m, b)
}
func (m *ServerLoopInTerms) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ServerLoopInTerms.Marshal(b, m, deterministic)
}
func (m *ServerLoopInTerms) XXX_Merge(src proto.Message) {
xxx_messageInfo_ServerLoopInTerms.Merge(m, src)
}
func (m *ServerLoopInTerms) XXX_Size() int {
return xxx_messageInfo_ServerLoopInTerms.Size(m)
}
func (m *ServerLoopInTerms) XXX_DiscardUnknown() {
xxx_messageInfo_ServerLoopInTerms.DiscardUnknown(m)
}
var xxx_messageInfo_ServerLoopInTerms proto.InternalMessageInfo
func (m *ServerLoopInTerms) GetMinSwapAmount() uint64 {
if m != nil {
return m.MinSwapAmount
}
return 0
}
func (m *ServerLoopInTerms) GetMaxSwapAmount() uint64 {
if m != nil {
return m.MaxSwapAmount
}
return 0
}
func init() { func init() {
proto.RegisterType((*ServerLoopOutRequest)(nil), "looprpc.ServerLoopOutRequest") proto.RegisterType((*ServerLoopOutRequest)(nil), "looprpc.ServerLoopOutRequest")
proto.RegisterType((*ServerLoopOutResponse)(nil), "looprpc.ServerLoopOutResponse") proto.RegisterType((*ServerLoopOutResponse)(nil), "looprpc.ServerLoopOutResponse")
proto.RegisterType((*ServerLoopOutQuoteRequest)(nil), "looprpc.ServerLoopOutQuoteRequest") proto.RegisterType((*ServerLoopOutQuoteRequest)(nil), "looprpc.ServerLoopOutQuoteRequest")
proto.RegisterType((*ServerLoopOutQuote)(nil), "looprpc.ServerLoopOutQuote") proto.RegisterType((*ServerLoopOutQuote)(nil), "looprpc.ServerLoopOutQuote")
proto.RegisterType((*ServerLoopOutTermsRequest)(nil), "looprpc.ServerLoopOutTermsRequest")
proto.RegisterType((*ServerLoopOutTerms)(nil), "looprpc.ServerLoopOutTerms")
proto.RegisterType((*ServerLoopInRequest)(nil), "looprpc.ServerLoopInRequest") proto.RegisterType((*ServerLoopInRequest)(nil), "looprpc.ServerLoopInRequest")
proto.RegisterType((*ServerLoopInResponse)(nil), "looprpc.ServerLoopInResponse") proto.RegisterType((*ServerLoopInResponse)(nil), "looprpc.ServerLoopInResponse")
proto.RegisterType((*ServerLoopInQuoteRequest)(nil), "looprpc.ServerLoopInQuoteRequest") proto.RegisterType((*ServerLoopInQuoteRequest)(nil), "looprpc.ServerLoopInQuoteRequest")
proto.RegisterType((*ServerLoopInQuoteResponse)(nil), "looprpc.ServerLoopInQuoteResponse") proto.RegisterType((*ServerLoopInQuoteResponse)(nil), "looprpc.ServerLoopInQuoteResponse")
proto.RegisterType((*ServerLoopInTermsRequest)(nil), "looprpc.ServerLoopInTermsRequest")
proto.RegisterType((*ServerLoopInTerms)(nil), "looprpc.ServerLoopInTerms")
} }
func init() { proto.RegisterFile("server.proto", fileDescriptor_ad098daeda4239f7) } func init() { proto.RegisterFile("server.proto", fileDescriptor_ad098daeda4239f7) }
var fileDescriptor_ad098daeda4239f7 = []byte{ var fileDescriptor_ad098daeda4239f7 = []byte{
// 589 bytes of a gzipped FileDescriptorProto // 641 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08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0x72, 0x10, 0x19, 0xd4, 0xd3, 0xb3, 0x6e, 0x2f, 0x9a,
0x1b, 0x26, 0xb4, 0x27, 0xbb, 0xfa, 0xeb, 0xae, 0x5d, 0xd1, 0xab, 0x99, 0xc7, 0xf8, 0xfd, 0xdf, 0xca, 0xe6, 0xae, 0x17, 0x0a, 0xf5, 0xb7, 0xaa, 0x41, 0x61, 0x3e, 0x4f, 0x4d, 0x0a, 0x75, 0x83,
0x00, 0x00, 0x00, 0xff, 0xff, 0x94, 0xad, 0x2a, 0x29, 0xc3, 0x05, 0x00, 0x00, 0x33, 0x58, 0xc9, 0x1b, 0xbc, 0x53, 0xc3, 0x2d, 0x5e, 0x4c, 0xbf, 0xdf, 0x4c, 0x21, 0x67, 0xd0,
0x33, 0xfb, 0x9e, 0xaa, 0xeb, 0x20, 0x5b, 0xb5, 0xe4, 0xac, 0xd5, 0xa0, 0xa1, 0x6a, 0x96, 0xbd,
0xca, 0xb4, 0x69, 0xa9, 0xf5, 0xda, 0x0a, 0xab, 0x7a, 0xf7, 0x51, 0x74, 0xd7, 0xcf, 0x6d, 0xf5,
0x83, 0xf9, 0xf6, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf1, 0xf9, 0x2f, 0x6f, 0x67, 0x07, 0x00,
0x00,
} }
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
@ -537,8 +727,10 @@ 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 {
LoopOutTerms(ctx context.Context, in *ServerLoopOutTermsRequest, opts ...grpc.CallOption) (*ServerLoopOutTerms, error)
NewLoopOutSwap(ctx context.Context, in *ServerLoopOutRequest, opts ...grpc.CallOption) (*ServerLoopOutResponse, error) NewLoopOutSwap(ctx context.Context, in *ServerLoopOutRequest, opts ...grpc.CallOption) (*ServerLoopOutResponse, error)
LoopOutQuote(ctx context.Context, in *ServerLoopOutQuoteRequest, opts ...grpc.CallOption) (*ServerLoopOutQuote, 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) NewLoopInSwap(ctx context.Context, in *ServerLoopInRequest, opts ...grpc.CallOption) (*ServerLoopInResponse, error)
LoopInQuote(ctx context.Context, in *ServerLoopInQuoteRequest, opts ...grpc.CallOption) (*ServerLoopInQuoteResponse, error) LoopInQuote(ctx context.Context, in *ServerLoopInQuoteRequest, opts ...grpc.CallOption) (*ServerLoopInQuoteResponse, error)
} }
@ -551,6 +743,15 @@ func NewSwapServerClient(cc *grpc.ClientConn) SwapServerClient {
return &swapServerClient{cc} 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) { func (c *swapServerClient) NewLoopOutSwap(ctx context.Context, in *ServerLoopOutRequest, opts ...grpc.CallOption) (*ServerLoopOutResponse, error) {
out := new(ServerLoopOutResponse) out := new(ServerLoopOutResponse)
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/NewLoopOutSwap", in, out, opts...) err := c.cc.Invoke(ctx, "/looprpc.SwapServer/NewLoopOutSwap", in, out, opts...)
@ -569,6 +770,15 @@ func (c *swapServerClient) LoopOutQuote(ctx context.Context, in *ServerLoopOutQu
return out, nil 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) { func (c *swapServerClient) NewLoopInSwap(ctx context.Context, in *ServerLoopInRequest, opts ...grpc.CallOption) (*ServerLoopInResponse, error) {
out := new(ServerLoopInResponse) out := new(ServerLoopInResponse)
err := c.cc.Invoke(ctx, "/looprpc.SwapServer/NewLoopInSwap", in, out, opts...) err := c.cc.Invoke(ctx, "/looprpc.SwapServer/NewLoopInSwap", in, out, opts...)
@ -589,8 +799,10 @@ func (c *swapServerClient) LoopInQuote(ctx context.Context, in *ServerLoopInQuot
// SwapServerServer is the server API for SwapServer service. // SwapServerServer is the server API for SwapServer service.
type SwapServerServer interface { type SwapServerServer interface {
LoopOutTerms(context.Context, *ServerLoopOutTermsRequest) (*ServerLoopOutTerms, error)
NewLoopOutSwap(context.Context, *ServerLoopOutRequest) (*ServerLoopOutResponse, error) NewLoopOutSwap(context.Context, *ServerLoopOutRequest) (*ServerLoopOutResponse, error)
LoopOutQuote(context.Context, *ServerLoopOutQuoteRequest) (*ServerLoopOutQuote, error) LoopOutQuote(context.Context, *ServerLoopOutQuoteRequest) (*ServerLoopOutQuote, error)
LoopInTerms(context.Context, *ServerLoopInTermsRequest) (*ServerLoopInTerms, error)
NewLoopInSwap(context.Context, *ServerLoopInRequest) (*ServerLoopInResponse, error) NewLoopInSwap(context.Context, *ServerLoopInRequest) (*ServerLoopInResponse, error)
LoopInQuote(context.Context, *ServerLoopInQuoteRequest) (*ServerLoopInQuoteResponse, error) LoopInQuote(context.Context, *ServerLoopInQuoteRequest) (*ServerLoopInQuoteResponse, error)
} }
@ -599,6 +811,24 @@ func RegisterSwapServerServer(s *grpc.Server, srv SwapServerServer) {
s.RegisterService(&_SwapServer_serviceDesc, srv) 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) { func _SwapServer_NewLoopOutSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ServerLoopOutRequest) in := new(ServerLoopOutRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -635,6 +865,24 @@ func _SwapServer_LoopOutQuote_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler) 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) { func _SwapServer_NewLoopInSwap_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ServerLoopInRequest) in := new(ServerLoopInRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -675,6 +923,10 @@ var _SwapServer_serviceDesc = grpc.ServiceDesc{
ServiceName: "looprpc.SwapServer", ServiceName: "looprpc.SwapServer",
HandlerType: (*SwapServerServer)(nil), HandlerType: (*SwapServerServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{
MethodName: "LoopOutTerms",
Handler: _SwapServer_LoopOutTerms_Handler,
},
{ {
MethodName: "NewLoopOutSwap", MethodName: "NewLoopOutSwap",
Handler: _SwapServer_NewLoopOutSwap_Handler, Handler: _SwapServer_NewLoopOutSwap_Handler,
@ -683,6 +935,10 @@ var _SwapServer_serviceDesc = grpc.ServiceDesc{
MethodName: "LoopOutQuote", MethodName: "LoopOutQuote",
Handler: _SwapServer_LoopOutQuote_Handler, Handler: _SwapServer_LoopOutQuote_Handler,
}, },
{
MethodName: "LoopInTerms",
Handler: _SwapServer_LoopInTerms_Handler,
},
{ {
MethodName: "NewLoopInSwap", MethodName: "NewLoopInSwap",
Handler: _SwapServer_NewLoopInSwap_Handler, Handler: _SwapServer_NewLoopInSwap_Handler,

@ -4,13 +4,15 @@ import "google/api/annotations.proto";
package looprpc; package looprpc;
option go_package = "github.com/lightninglabs/loop/looprpc";
service SwapServer { service SwapServer {
rpc LoopOutTerms(ServerLoopOutTermsRequest) returns (ServerLoopOutTerms);
rpc NewLoopOutSwap(ServerLoopOutRequest) returns (ServerLoopOutResponse); rpc NewLoopOutSwap(ServerLoopOutRequest) returns (ServerLoopOutResponse);
rpc LoopOutQuote(ServerLoopOutQuoteRequest) returns (ServerLoopOutQuote); rpc LoopOutQuote(ServerLoopOutQuoteRequest) returns (ServerLoopOutQuote);
rpc LoopInTerms(ServerLoopInTermsRequest) returns (ServerLoopInTerms);
rpc NewLoopInSwap(ServerLoopInRequest) returns (ServerLoopInResponse); rpc NewLoopInSwap(ServerLoopInRequest) returns (ServerLoopInResponse);
rpc LoopInQuote(ServerLoopInQuoteRequest) returns (ServerLoopInQuoteResponse); rpc LoopInQuote(ServerLoopInQuoteRequest) returns (ServerLoopInQuoteResponse);
@ -35,24 +37,36 @@ message ServerLoopOutResponse {
} }
message ServerLoopOutQuoteRequest { message ServerLoopOutQuoteRequest {
/// The swap amount. If zero, a quote for a maximum amt swap will be given.
uint64 amt = 1;
} }
message ServerLoopOutQuote { message ServerLoopOutQuote {
string swap_payment_dest = 1; string swap_payment_dest = 1;
int64 swap_fee_base = 2; /// The total estimated swap fee given the quote amt.
int64 swap_fee = 2;
int64 swap_fee_rate = 3; /// Deprecated, total swap fee given quote amt is calculated in swap_fee.
int64 swap_fee_rate = 3 [deprecated = true];
uint64 prepay_amt = 4; uint64 prepay_amt = 4;
uint64 min_swap_amount = 5; uint64 min_swap_amount = 5 [deprecated = true];
uint64 max_swap_amount = 6; uint64 max_swap_amount = 6 [deprecated = true];
int32 cltv_delta = 7; int32 cltv_delta = 7;
} }
message ServerLoopOutTermsRequest {
}
message ServerLoopOutTerms {
uint64 min_swap_amount = 1;
uint64 max_swap_amount = 2;
}
message ServerLoopInRequest { message ServerLoopInRequest {
bytes sender_key = 1; bytes sender_key = 1;
bytes swap_hash = 2; bytes swap_hash = 2;
@ -66,12 +80,22 @@ message ServerLoopInResponse {
} }
message ServerLoopInQuoteRequest { message ServerLoopInQuoteRequest {
/// The swap amount. If zero, a quote for a maximum amt swap will be given.
uint64 amt = 1;
} }
message ServerLoopInQuoteResponse { message ServerLoopInQuoteResponse {
int64 swap_fee_base = 1; int64 swap_fee = 1;
int64 swap_fee_rate = 2; int64 swap_fee_rate = 2 [deprecated=true];
uint64 min_swap_amount = 4; uint64 min_swap_amount = 4 [deprecated=true];
uint64 max_swap_amount = 5; uint64 max_swap_amount = 5 [deprecated=true];
int32 cltv_delta = 6; int32 cltv_delta = 6;
} }
message ServerLoopInTermsRequest {
}
message ServerLoopInTerms {
uint64 min_swap_amount = 1;
uint64 max_swap_amount = 2;
}

@ -21,8 +21,7 @@ var (
testLoopOutOnChainCltvDelta = int32(30) testLoopOutOnChainCltvDelta = int32(30)
testChargeOnChainCltvDelta = int32(100) testChargeOnChainCltvDelta = int32(100)
testCltvDelta = 50 testCltvDelta = 50
testSwapFeeBase = btcutil.Amount(21) testSwapFee = btcutil.Amount(210)
testSwapFeeRate = int64(100)
testInvoiceExpiry = 180 * time.Second testInvoiceExpiry = 180 * time.Second
testFixedPrepayAmount = btcutil.Amount(100) testFixedPrepayAmount = btcutil.Amount(100)
testMinSwapAmount = btcutil.Amount(10000) testMinSwapAmount = btcutil.Amount(10000)
@ -45,6 +44,8 @@ type serverMock struct {
swapHash lntypes.Hash swapHash lntypes.Hash
} }
var _ swapServerClient = (*serverMock)(nil)
func newServerMock() *serverMock { func newServerMock() *serverMock {
return &serverMock{ return &serverMock{
expectedSwapAmt: 50000, expectedSwapAmt: 50000,
@ -94,16 +95,22 @@ func (s *serverMock) NewLoopOutSwap(ctx context.Context,
func (s *serverMock) GetLoopOutTerms(ctx context.Context) ( func (s *serverMock) GetLoopOutTerms(ctx context.Context) (
*LoopOutTerms, error) { *LoopOutTerms, error) {
return &LoopOutTerms{
MinSwapAmount: testMinSwapAmount,
MaxSwapAmount: testMaxSwapAmount,
}, nil
}
func (s *serverMock) GetLoopOutQuote(ctx context.Context, amt btcutil.Amount) (
*LoopOutQuote, error) {
dest := [33]byte{1, 2, 3} dest := [33]byte{1, 2, 3}
return &LoopOutTerms{ return &LoopOutQuote{
SwapFeeBase: testSwapFeeBase, SwapFee: testSwapFee,
SwapFeeRate: testSwapFeeRate,
SwapPaymentDest: dest, SwapPaymentDest: dest,
CltvDelta: testLoopOutOnChainCltvDelta, CltvDelta: testLoopOutOnChainCltvDelta,
MinSwapAmount: testMinSwapAmount, PrepayAmount: testFixedPrepayAmount,
MaxSwapAmount: testMaxSwapAmount,
PrepayAmt: testFixedPrepayAmount,
}, nil }, nil
} }
@ -154,10 +161,16 @@ func (s *serverMock) GetLoopInTerms(ctx context.Context) (
*LoopInTerms, error) { *LoopInTerms, error) {
return &LoopInTerms{ return &LoopInTerms{
SwapFeeBase: testSwapFeeBase,
SwapFeeRate: testSwapFeeRate,
CltvDelta: testChargeOnChainCltvDelta,
MinSwapAmount: testMinSwapAmount, MinSwapAmount: testMinSwapAmount,
MaxSwapAmount: testMaxSwapAmount, MaxSwapAmount: testMaxSwapAmount,
}, nil }, nil
} }
func (s *serverMock) GetLoopInQuote(ctx context.Context, amt btcutil.Amount) (
*LoopInQuote, error) {
return &LoopInQuote{
SwapFee: testSwapFee,
CltvDelta: testChargeOnChainCltvDelta,
}, nil
}

@ -20,9 +20,15 @@ type swapServerClient interface {
GetLoopOutTerms(ctx context.Context) ( GetLoopOutTerms(ctx context.Context) (
*LoopOutTerms, error) *LoopOutTerms, error)
GetLoopOutQuote(ctx context.Context, amt btcutil.Amount) (
*LoopOutQuote, error)
GetLoopInTerms(ctx context.Context) ( GetLoopInTerms(ctx context.Context) (
*LoopInTerms, error) *LoopInTerms, error)
GetLoopInQuote(ctx context.Context, amt btcutil.Amount) (
*LoopInQuote, error)
NewLoopOutSwap(ctx context.Context, NewLoopOutSwap(ctx context.Context,
swapHash lntypes.Hash, amount btcutil.Amount, swapHash lntypes.Hash, amount btcutil.Amount,
receiverKey [33]byte) ( receiverKey [33]byte) (
@ -39,6 +45,8 @@ type grpcSwapServerClient struct {
conn *grpc.ClientConn conn *grpc.ClientConn
} }
var _ swapServerClient = (*grpcSwapServerClient)(nil)
func newSwapServerClient(address string, func newSwapServerClient(address string,
insecure bool) (*grpcSwapServerClient, error) { insecure bool) (*grpcSwapServerClient, error) {
@ -58,10 +66,30 @@ func newSwapServerClient(address string,
func (s *grpcSwapServerClient) GetLoopOutTerms(ctx context.Context) ( func (s *grpcSwapServerClient) GetLoopOutTerms(ctx context.Context) (
*LoopOutTerms, error) { *LoopOutTerms, error) {
rpcCtx, rpcCancel := context.WithTimeout(ctx, serverRPCTimeout)
defer rpcCancel()
terms, err := s.server.LoopOutTerms(rpcCtx,
&looprpc.ServerLoopOutTermsRequest{},
)
if err != nil {
return nil, err
}
return &LoopOutTerms{
MinSwapAmount: btcutil.Amount(terms.MinSwapAmount),
MaxSwapAmount: btcutil.Amount(terms.MaxSwapAmount),
}, nil
}
func (s *grpcSwapServerClient) GetLoopOutQuote(ctx context.Context,
amt btcutil.Amount) (*LoopOutQuote, error) {
rpcCtx, rpcCancel := context.WithTimeout(ctx, serverRPCTimeout) rpcCtx, rpcCancel := context.WithTimeout(ctx, serverRPCTimeout)
defer rpcCancel() defer rpcCancel()
quoteResp, err := s.server.LoopOutQuote(rpcCtx, quoteResp, err := s.server.LoopOutQuote(rpcCtx,
&looprpc.ServerLoopOutQuoteRequest{}, &looprpc.ServerLoopOutQuoteRequest{
Amt: uint64(amt),
},
) )
if err != nil { if err != nil {
return nil, err return nil, err
@ -77,12 +105,9 @@ func (s *grpcSwapServerClient) GetLoopOutTerms(ctx context.Context) (
var destArray [33]byte var destArray [33]byte
copy(destArray[:], dest) copy(destArray[:], dest)
return &LoopOutTerms{ return &LoopOutQuote{
MinSwapAmount: btcutil.Amount(quoteResp.MinSwapAmount), PrepayAmount: btcutil.Amount(quoteResp.PrepayAmt),
MaxSwapAmount: btcutil.Amount(quoteResp.MaxSwapAmount), SwapFee: btcutil.Amount(quoteResp.SwapFee),
PrepayAmt: btcutil.Amount(quoteResp.PrepayAmt),
SwapFeeBase: btcutil.Amount(quoteResp.SwapFeeBase),
SwapFeeRate: quoteResp.SwapFeeRate,
CltvDelta: quoteResp.CltvDelta, CltvDelta: quoteResp.CltvDelta,
SwapPaymentDest: destArray, SwapPaymentDest: destArray,
}, nil }, nil
@ -93,19 +118,36 @@ func (s *grpcSwapServerClient) GetLoopInTerms(ctx context.Context) (
rpcCtx, rpcCancel := context.WithTimeout(ctx, serverRPCTimeout) rpcCtx, rpcCancel := context.WithTimeout(ctx, serverRPCTimeout)
defer rpcCancel() defer rpcCancel()
quoteResp, err := s.server.LoopInQuote(rpcCtx, terms, err := s.server.LoopInTerms(rpcCtx,
&looprpc.ServerLoopInQuoteRequest{}, &looprpc.ServerLoopInTermsRequest{},
) )
if err != nil { if err != nil {
return nil, err return nil, err
} }
return &LoopInTerms{ return &LoopInTerms{
MinSwapAmount: btcutil.Amount(quoteResp.MinSwapAmount), MinSwapAmount: btcutil.Amount(terms.MinSwapAmount),
MaxSwapAmount: btcutil.Amount(quoteResp.MaxSwapAmount), MaxSwapAmount: btcutil.Amount(terms.MaxSwapAmount),
SwapFeeBase: btcutil.Amount(quoteResp.SwapFeeBase), }, nil
SwapFeeRate: quoteResp.SwapFeeRate, }
CltvDelta: quoteResp.CltvDelta,
func (s *grpcSwapServerClient) GetLoopInQuote(ctx context.Context,
amt btcutil.Amount) (*LoopInQuote, error) {
rpcCtx, rpcCancel := context.WithTimeout(ctx, serverRPCTimeout)
defer rpcCancel()
quoteResp, err := s.server.LoopInQuote(rpcCtx,
&looprpc.ServerLoopInQuoteRequest{
Amt: uint64(amt),
},
)
if err != nil {
return nil, err
}
return &LoopInQuote{
SwapFee: btcutil.Amount(quoteResp.SwapFee),
CltvDelta: quoteResp.CltvDelta,
}, nil }, nil
} }

Loading…
Cancel
Save