diff --git a/cmd/loop/quote.go b/cmd/loop/quote.go index 08d62c4..2c7fdfd 100644 --- a/cmd/loop/quote.go +++ b/cmd/loop/quote.go @@ -12,12 +12,22 @@ var quoteCommand = cli.Command{ Usage: "get a quote for the cost of a swap", ArgsUsage: "amt", Description: "Allows to determine the cost of a swap up front", - Action: quote, + Flags: []cli.Flag{ + cli.Uint64Flag{ + Name: "conf_target", + Usage: "the number of blocks from the swap " + + "initiation height that the on-chain HTLC " + + "should be swept within in a Loop Out", + Value: 6, + }, + }, + Action: quote, } func quote(ctx *cli.Context) error { - // Show command help if no arguments and flags were provided. - if ctx.NArg() < 1 { + // Show command help if the incorrect number arguments and/or flags were + // provided. + if ctx.NArg() != 1 || ctx.NumFlags() > 1 { cli.ShowCommandHelp(ctx, "quote") return nil } @@ -36,7 +46,8 @@ func quote(ctx *cli.Context) error { ctxb := context.Background() resp, err := client.LoopOutQuote(ctxb, &looprpc.QuoteRequest{ - Amt: int64(amt), + Amt: int64(amt), + ConfTarget: int32(ctx.Uint64("conf_target")), }) if err != nil { return err diff --git a/cmd/loopd/swapclient_server.go b/cmd/loopd/swapclient_server.go index 5221a6c..0898a73 100644 --- a/cmd/loopd/swapclient_server.go +++ b/cmd/loopd/swapclient_server.go @@ -16,7 +16,14 @@ import ( "github.com/lightninglabs/loop/looprpc" ) -const completedSwapsCount = 5 +const ( + completedSwapsCount = 5 + + // minConfTarget is the minimum confirmation target we'll allow clients + // to specify. This is driven by the minimum confirmation target allowed + // by the backing fee estimator. + minConfTarget = 2 +) // swapClientServer implements the grpc service exposed by loopd. type swapClientServer struct { @@ -242,9 +249,13 @@ func (s *swapClientServer) LoopOutTerms(ctx context.Context, func (s *swapClientServer) LoopOutQuote(ctx context.Context, req *looprpc.QuoteRequest) (*looprpc.QuoteResponse, error) { + confTarget, err := validateConfTarget(req.ConfTarget, defaultConfTarget) + if err != nil { + return nil, err + } quote, err := s.impl.LoopOutQuote(ctx, &loop.LoopOutQuoteRequest{ Amount: btcutil.Amount(req.Amt), - SweepConfTarget: defaultConfTarget, + SweepConfTarget: confTarget, }) if err != nil { return nil, err @@ -323,3 +334,17 @@ func (s *swapClientServer) LoopIn(ctx context.Context, HtlcAddress: htlc.String(), }, nil } + +// validateConfTarget ensures the given confirmation target is valid. If one +// isn't specified (0 value), then the default target is used. +func validateConfTarget(target, defaultTarget int32) (int32, error) { + switch { + // Ensure the target respects our minimum threshold. + case target < minConfTarget: + return 0, fmt.Errorf("a confirmation target of at least %v "+ + "must be provided", minConfTarget) + + default: + return target, nil + } +} diff --git a/looprpc/client.pb.go b/looprpc/client.pb.go index 5d75f5a..cc9a0bc 100644 --- a/looprpc/client.pb.go +++ b/looprpc/client.pb.go @@ -683,7 +683,13 @@ func (m *TermsResponse) GetCltvDelta() int32 { type QuoteRequest struct { //* //The amount to swap in satoshis. - Amt int64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"` + Amt int64 `protobuf:"varint,1,opt,name=amt,proto3" json:"amt,omitempty"` + //* + //The confirmation target that should be used either for the sweep of the + //on-chain HTLC broadcast by the swap server in the case of a Loop Out, or for + //the confirmation of the on-chain HTLC broadcast by the swap client in the + //case of a Loop In. + ConfTarget int32 `protobuf:"varint,2,opt,name=conf_target,json=confTarget,proto3" json:"conf_target,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -721,6 +727,13 @@ func (m *QuoteRequest) GetAmt() int64 { return 0 } +func (m *QuoteRequest) GetConfTarget() int32 { + if m != nil { + return m.ConfTarget + } + return 0 +} + type QuoteResponse struct { //* //The fee that the swap server is charging for the swap. @@ -799,69 +812,71 @@ func init() { func init() { proto.RegisterFile("client.proto", fileDescriptor_014de31d7ac8c57c) } var fileDescriptor_014de31d7ac8c57c = []byte{ - // 992 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56,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e, 0xc3, 0xb1, 0xa7, 0x56, 0x5e, 0x12, 0x82, 0x9e, 0xc3, 0x91, 0xd8, 0x10, 0x27, - 0x24, 0xc6, 0x77, 0x85, 0x2d, 0x15, 0xb9, 0xe5, 0x30, 0xc2, 0xcb, 0x89, 0x5c, 0x5c, 0xdb, 0xd4, - 0x01, 0x33, 0x3f, 0x45, 0x50, 0x77, 0x24, 0x15, 0xb4, 0xba, 0x60, 0x7c, 0x05, 0xd6, 0x9a, 0xac, - 0x28, 0x7c, 0x57, 0x72, 0xcc, 0x5c, 0xae, 0x1f, 0x71, 0x64, 0x43, 0x43, 0xb0, 0xa2, 0x80, 0x92, - 0x44, 0x0a, 0x55, 0x25, 0x69, 0x2f, 0xc2, 0xcb, 0x73, 0x81, 0x09, 0xa5, 0x2e, 0x34, 0x45, 0xcf, - 0x7c, 0x96, 0x71, 0x7f, 0x7e, 0x83, 0x29, 0x25, 0x61, 0xab, 0xd6, 0x29, 0x75, 0x2b, 0x9e, 0x15, - 0xaa, 0x0e, 0x0d, 0x14, 0x6a, 0xff, 0x5d, 0x82, 0x86, 0x68, 0x9a, 0x4b, 0xef, 0xef, 0xd9, 0x66, - 0xe5, 0xc6, 0x56, 0xe5, 0x5b, 0x35, 0x95, 0xb7, 0x6b, 0x7a, 0x06, 0xfb, 0xb2, 0xa6, 0x80, 0xe6, - 0x25, 0x55, 0x64, 0x49, 0x8d, 0x50, 0x9e, 0xaf, 0x2b, 0x42, 0x5f, 0x42, 0x83, 0x2c, 0x39, 0x49, - 0x28, 0x0e, 0xfd, 0x1b, 0x1e, 0xce, 0x65, 0xa3, 0x6a, 0x9e, 0xb9, 0x02, 0xcf, 0x78, 0x38, 0xb7, - 0xfb, 0x60, 0xca, 0x99, 0x90, 0x34, 0x66, 0x34, 0x25, 0xc8, 0x02, 0x23, 0x58, 0xc8, 0x9a, 0xeb, - 0x9e, 0x11, 0x2c, 0xd0, 0x17, 0x60, 0x8a, 0xbd, 0x3e, 0x5e, 0x2c, 0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 0xc5, 0xf8, 0x2e, 0x22, 0x94, 0xfb, 0x32, 0xab, 0x6a, 0xac, 0xfb, 0x62, 0x61, - 0xa2, 0xf0, 0xa1, 0x30, 0xaa, 0x0d, 0x8d, 0x95, 0x25, 0xfd, 0x37, 0x38, 0x5d, 0xf9, 0x72, 0x2f, - 0x55, 0xa6, 0x7c, 0x81, 0x53, 0x52, 0xe0, 0x24, 0x62, 0x04, 0xe5, 0x02, 0xc7, 0x13, 0x4d, 0x7f, - 0x02, 0xb0, 0x16, 0x39, 0x95, 0xe0, 0x7a, 0x9c, 0xe7, 0xed, 0x19, 0xec, 0x47, 0x01, 0x55, 0xee, - 0xc7, 0x11, 0xcb, 0x28, 0xd7, 0x33, 0x69, 0x44, 0x01, 0x15, 0x13, 0xec, 0x4b, 0x50, 0xf2, 0x56, - 0x29, 0xd1, 0xbc, 0x5d, 0xcd, 0x53, 0x41, 0xd1, 0xbc, 0x27, 0x00, 0xf3, 0x90, 0xdf, 0xfa, 0x0b, - 0x12, 0x72, 0x2c, 0xc7, 0xb1, 0xe3, 0xd5, 0x05, 0x32, 0x14, 0x80, 0xdd, 0x01, 0xf3, 0xa7, 0x8c, - 0x71, 0x72, 0x6f, 0x1c, 0xed, 0x2b, 0x68, 0x68, 0x86, 0x6e, 0xda, 0x27, 0x50, 0xcb, 0xb3, 0xa9, - 0x78, 0x55, 0x7d, 0xbf, 0x8d, 0xbb, 0x19, 0x9b, 0x77, 0xfb, 0x14, 0xea, 0x9b, 0x99, 0xad, 0x45, - 0x3a, 0xb0, 0xc7, 0x4f, 0xa1, 0xb6, 0x32, 0x32, 0x32, 0xa1, 0x36, 0x1a, 0x8f, 0x27, 0xfe, 0xf8, - 0x72, 0xd6, 0x7c, 0x80, 0xf6, 0xa0, 0x2a, 0xff, 0x72, 0x2f, 0x9a, 0xa5, 0xe3, 0x14, 0xea, 0xb9, - 0x8f, 0x51, 0x03, 0xea, 0xee, 0x85, 0x3b, 0x73, 0xfb, 0x33, 0x67, 0x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0xb8, 0x94, - 0xf2, 0x73, 0x69, 0x69, 0x9e, 0x35, 0xe9, 0x75, 0xbb, 0xad, 0x49, 0x17, 0x3c, 0x66, 0x77, 0xa4, - 0x74, 0x1b, 0xb5, 0x0a, 0xd2, 0x6f, 0x05, 0xa7, 0xf7, 0x0b, 0x8e, 0xf8, 0xaf, 0xe8, 0x47, 0xb0, - 0x5e, 0x11, 0xae, 0x3a, 0xf4, 0x31, 0xd5, 0x17, 0x04, 0x3e, 0xa6, 0xc6, 0x37, 0xbb, 0xf2, 0xff, - 0x80, 0xe7, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0xf8, 0xf2, 0xb9, 0x76, 0x3e, 0x08, 0x00, 0x00, + // 1009 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcd, 0x6e, 0xdb, 0x46, + 0x18, 0x8c, 0x28, 0xd9, 0x92, 0x3e, 0x53, 0xb4, 0xbc, 0x4e, 0x1c, 0x55, 0x6d, 0x50, 0x97, 0x6d, + 0x52, 0xc3, 0x07, 0xab, 0x75, 0x0e, 0x45, 0x7b, 0x29, 0x14, 0x99, 0x89, 0x09, 0xc8, 0x96, 0x4a, + 0xd1, 0x01, 0x7a, 0x22, 0x36, 0xd2, 0xca, 0x26, 0x40, 0xee, 0x32, 0xe4, 0xd2, 0x91, 0x51, 0xf4, + 0xd2, 0x37, 0x68, 0xfb, 0x26, 0x45, 0xdf, 0xa4, 0xf7, 0x9e, 0xfa, 0x20, 0xc5, 0xfe, 0x88, 0x11, + 0xa5, 0xf8, 0x92, 0x9b, 0x3c, 0x3b, 0x3b, 0xfb, 0xed, 0xf7, 0xcd, 0x2c, 0x0d, 0xe6, 0x34, 0x0a, + 0x09, 0xe5, 0x27, 0x49, 0xca, 0x38, 0x43, 0xf5, 0x88, 0xb1, 0x24, 0x4d, 0xa6, 0xdd, 0xcf, 0xae, + 0x19, 0xbb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0x19, + 0xe6, 0x44, 0x31, 0x95, 0x59, 0x2c, 0x81, 0x5f, 0x49, 0x58, 0x32, 0xd7, 0x3b, 0x51, 0xdf, 0xe8, + 0x04, 0xfa, 0x1c, 0x76, 0xa6, 0x2c, 0xe3, 0x41, 0x46, 0xd2, 0x5b, 0x92, 0x4a, 0xa3, 0x54, 0x3d, + 0x10, 0xd0, 0x44, 0x22, 0x42, 0x43, 0x12, 0x18, 0x9d, 0xde, 0xe0, 0x90, 0x76, 0x9a, 0x6a, 0xba, + 0x02, 0x1b, 0x29, 0x48, 0x4c, 0x4d, 0x51, 0xe6, 0x73, 0xc5, 0x01, 0x65, 0x5d, 0xc9, 0xd1, 0x98, + 0x6d, 0x81, 0xe9, 0x93, 0x34, 0xce, 0x96, 0x0d, 0xff, 0xdd, 0x80, 0x96, 0x06, 0xf4, 0x1c, 0x8f, + 0x61, 0x4f, 0xda, 0x2c, 0xc1, 0x77, 0x31, 0xa1, 0x3c, 0x90, 0x59, 0x55, 0x63, 0xdd, 0x15, 0x0b, + 0x63, 0x85, 0x9f, 0x09, 0xa3, 0xda, 0xd0, 0x5a, 0x5a, 0x32, 0x78, 0x83, 0xb3, 0xa5, 0x2f, 0x77, + 0x32, 0x65, 0xca, 0x17, 0x38, 0x23, 0x25, 0x4e, 0x2a, 0x46, 0x50, 0x2d, 0x71, 0x3c, 0xd1, 0xf4, + 0x27, 0x00, 0x2b, 0x91, 0x53, 0x09, 0x6e, 0x26, 0x45, 0xde, 0x9e, 0xc1, 0x6e, 0x1c, 0x52, 0xe5, + 0x7e, 0x1c, 0xb3, 0x9c, 0x72, 0x3d, 0x93, 0x56, 0x1c, 0x52, 0x31, 0xc1, 0xbe, 0x04, 0x25, 0x6f, + 0x99, 0x12, 0xcd, 0xdb, 0xd6, 0x3c, 0x15, 0x14, 0xcd, 0x7b, 0x02, 0x30, 0x8d, 0xf8, 0x6d, 0x30, + 0x23, 0x11, 0xc7, 0x72, 0x1c, 0x5b, 0x5e, 0x53, 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 0xf5, 0xa7, + 0x01, 0x3d, 0x2e, 0xe2, 0x57, 0xfe, 0x58, 0x74, 0x1f, 0x95, 0x72, 0xb9, 0x6c, 0x9e, 0xfd, 0xf8, + 0xb7, 0x7f, 0xfe, 0xfb, 0xd3, 0xd8, 0xb3, 0xcd, 0xde, 0xed, 0xb7, 0x3d, 0xc1, 0xe8, 0xb1, 0x9c, + 0xff, 0x50, 0x39, 0x46, 0xdf, 0xc1, 0xb6, 0x7a, 0x39, 0xd1, 0x41, 0x49, 0xb2, 0x78, 0x4a, 0xef, + 0x51, 0x44, 0xdf, 0x43, 0x5d, 0xbf, 0x3c, 0x2b, 0xc5, 0x94, 0xdf, 0xa2, 0xee, 0xfe, 0xc6, 0x23, + 0x91, 0x67, 0xdf, 0x54, 0xd0, 0xcf, 0x60, 0xea, 0xaa, 0x65, 0x6e, 0xd0, 0xfb, 0x13, 0x56, 0x83, + 0xd5, 0x3d, 0x58, 0x87, 0xf5, 0x5d, 0xba, 0xf2, 0x2e, 0x0f, 0x11, 0x5a, 0xbd, 0x4b, 0x8f, 0x4b, + 0xa9, 0xa0, 0x90, 0x96, 0xe6, 0x59, 0x91, 0x5e, 0xf5, 0xe3, 0x8a, 0x74, 0xc9, 0x63, 0xf6, 0xa1, + 0x94, 0xee, 0xa2, 0x4e, 0x49, 0xfa, 0xad, 0xe0, 0xf4, 0x7e, 0xc1, 0x31, 0xff, 0x15, 0xfd, 0x08, + 0xd6, 0x2b, 0xc2, 0x55, 0x87, 0x3e, 0xa6, 0xfa, 0x92, 0xc0, 0xc7, 0xd4, 0xf8, 0x66, 0x5b, 0xfe, + 0xa3, 0xf0, 0xfc, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xec, 0x90, 0x5b, 0x65, 0x5f, 0x08, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/looprpc/client.pb.gw.go b/looprpc/client.pb.gw.go index 390078f..500982e 100644 --- a/looprpc/client.pb.gw.go +++ b/looprpc/client.pb.gw.go @@ -50,6 +50,10 @@ func request_SwapClient_LoopOutTerms_0(ctx context.Context, marshaler runtime.Ma } +var ( + filter_SwapClient_LoopOutQuote_0 = &utilities.DoubleArray{Encoding: map[string]int{"amt": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + func request_SwapClient_LoopOutQuote_0(ctx context.Context, marshaler runtime.Marshaler, client SwapClientClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QuoteRequest var metadata runtime.ServerMetadata @@ -72,6 +76,10 @@ func request_SwapClient_LoopOutQuote_0(ctx context.Context, marshaler runtime.Ma return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "amt", err) } + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_SwapClient_LoopOutQuote_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + msg, err := client.LoopOutQuote(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err diff --git a/looprpc/client.proto b/looprpc/client.proto index 5665e86..8390167 100644 --- a/looprpc/client.proto +++ b/looprpc/client.proto @@ -328,6 +328,14 @@ message QuoteRequest { The amount to swap in satoshis. */ int64 amt = 1; + + /** + The confirmation target that should be used either for the sweep of the + on-chain HTLC broadcast by the swap server in the case of a Loop Out, or for + the confirmation of the on-chain HTLC broadcast by the swap client in the + case of a Loop In. + */ + int32 conf_target = 2; } message QuoteResponse { diff --git a/looprpc/client.swagger.json b/looprpc/client.swagger.json index f80e5f9..eabec20 100644 --- a/looprpc/client.swagger.json +++ b/looprpc/client.swagger.json @@ -61,6 +61,14 @@ "required": true, "type": "string", "format": "int64" + }, + { + "name": "conf_target", + "description": "*\nThe confirmation target that should be used either for the sweep of the\non-chain HTLC broadcast by the swap server in the case of a Loop Out, or for\nthe confirmation of the on-chain HTLC broadcast by the swap client in the\ncase of a Loop In.", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" } ], "tags": [