diff --git a/lib/grpc_services/autopilotrpc/autopilot_pb.rb b/lib/grpc_services/autopilotrpc/autopilot_pb.rb new file mode 100644 index 0000000..0ed07e2 --- /dev/null +++ b/lib/grpc_services/autopilotrpc/autopilot_pb.rb @@ -0,0 +1,48 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: autopilotrpc/autopilot.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("autopilotrpc/autopilot.proto", :syntax => :proto3) do + add_message "autopilotrpc.StatusRequest" do + end + add_message "autopilotrpc.StatusResponse" do + optional :active, :bool, 1 + end + add_message "autopilotrpc.ModifyStatusRequest" do + optional :enable, :bool, 1 + end + add_message "autopilotrpc.ModifyStatusResponse" do + end + add_message "autopilotrpc.QueryScoresRequest" do + repeated :pubkeys, :string, 1 + optional :ignore_local_state, :bool, 2 + end + add_message "autopilotrpc.QueryScoresResponse" do + repeated :results, :message, 1, "autopilotrpc.QueryScoresResponse.HeuristicResult" + end + add_message "autopilotrpc.QueryScoresResponse.HeuristicResult" do + optional :heuristic, :string, 1 + map :scores, :string, :double, 2 + end + add_message "autopilotrpc.SetScoresRequest" do + optional :heuristic, :string, 1 + map :scores, :string, :double, 2 + end + add_message "autopilotrpc.SetScoresResponse" do + end + end +end + +module Autopilotrpc + StatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.StatusRequest").msgclass + StatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.StatusResponse").msgclass + ModifyStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.ModifyStatusRequest").msgclass + ModifyStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.ModifyStatusResponse").msgclass + QueryScoresRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.QueryScoresRequest").msgclass + QueryScoresResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.QueryScoresResponse").msgclass + QueryScoresResponse::HeuristicResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.QueryScoresResponse.HeuristicResult").msgclass + SetScoresRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.SetScoresRequest").msgclass + SetScoresResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.SetScoresResponse").msgclass +end diff --git a/lib/grpc_services/autopilotrpc/autopilot_services_pb.rb b/lib/grpc_services/autopilotrpc/autopilot_services_pb.rb new file mode 100644 index 0000000..661a489 --- /dev/null +++ b/lib/grpc_services/autopilotrpc/autopilot_services_pb.rb @@ -0,0 +1,40 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: autopilotrpc/autopilot.proto for package 'autopilotrpc' + +require 'grpc' +require 'autopilotrpc/autopilot_pb' + +module Autopilotrpc + module Autopilot + # Autopilot is a service that can be used to get information about the current + # state of the daemon's autopilot agent, and also supply it with information + # that can be used when deciding where to open channels. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'autopilotrpc.Autopilot' + + # + # Status returns whether the daemon's autopilot agent is active. + rpc :Status, StatusRequest, StatusResponse + # + # ModifyStatus is used to modify the status of the autopilot agent, like + # enabling or disabling it. + rpc :ModifyStatus, ModifyStatusRequest, ModifyStatusResponse + # + # QueryScores queries all available autopilot heuristics, in addition to any + # active combination of these heruristics, for the scores they would give to + # the given nodes. + rpc :QueryScores, QueryScoresRequest, QueryScoresResponse + # + # SetScores attempts to set the scores used by the running autopilot agent, + # if the external scoring heuristic is enabled. + rpc :SetScores, SetScoresRequest, SetScoresResponse + end + + Stub = Service.rpc_stub_class + end +end diff --git a/lib/grpc_services/chainrpc/chainnotifier_pb.rb b/lib/grpc_services/chainrpc/chainnotifier_pb.rb new file mode 100644 index 0000000..8fcd8ba --- /dev/null +++ b/lib/grpc_services/chainrpc/chainnotifier_pb.rb @@ -0,0 +1,67 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: chainrpc/chainnotifier.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("chainrpc/chainnotifier.proto", :syntax => :proto3) do + add_message "chainrpc.ConfRequest" do + optional :txid, :bytes, 1 + optional :script, :bytes, 2 + optional :num_confs, :uint32, 3 + optional :height_hint, :uint32, 4 + end + add_message "chainrpc.ConfDetails" do + optional :raw_tx, :bytes, 1 + optional :block_hash, :bytes, 2 + optional :block_height, :uint32, 3 + optional :tx_index, :uint32, 4 + end + add_message "chainrpc.Reorg" do + end + add_message "chainrpc.ConfEvent" do + oneof :event do + optional :conf, :message, 1, "chainrpc.ConfDetails" + optional :reorg, :message, 2, "chainrpc.Reorg" + end + end + add_message "chainrpc.Outpoint" do + optional :hash, :bytes, 1 + optional :index, :uint32, 2 + end + add_message "chainrpc.SpendRequest" do + optional :outpoint, :message, 1, "chainrpc.Outpoint" + optional :script, :bytes, 2 + optional :height_hint, :uint32, 3 + end + add_message "chainrpc.SpendDetails" do + optional :spending_outpoint, :message, 1, "chainrpc.Outpoint" + optional :raw_spending_tx, :bytes, 2 + optional :spending_tx_hash, :bytes, 3 + optional :spending_input_index, :uint32, 4 + optional :spending_height, :uint32, 5 + end + add_message "chainrpc.SpendEvent" do + oneof :event do + optional :spend, :message, 1, "chainrpc.SpendDetails" + optional :reorg, :message, 2, "chainrpc.Reorg" + end + end + add_message "chainrpc.BlockEpoch" do + optional :hash, :bytes, 1 + optional :height, :uint32, 2 + end + end +end + +module Chainrpc + ConfRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.ConfRequest").msgclass + ConfDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.ConfDetails").msgclass + Reorg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.Reorg").msgclass + ConfEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.ConfEvent").msgclass + Outpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.Outpoint").msgclass + SpendRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.SpendRequest").msgclass + SpendDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.SpendDetails").msgclass + SpendEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.SpendEvent").msgclass + BlockEpoch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.BlockEpoch").msgclass +end diff --git a/lib/grpc_services/chainrpc/chainnotifier_services_pb.rb b/lib/grpc_services/chainrpc/chainnotifier_services_pb.rb new file mode 100644 index 0000000..5be66dc --- /dev/null +++ b/lib/grpc_services/chainrpc/chainnotifier_services_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: chainrpc/chainnotifier.proto for package 'chainrpc' + +require 'grpc' +require 'chainrpc/chainnotifier_pb' + +module Chainrpc + module ChainNotifier + # ChainNotifier is a service that can be used to get information about the + # chain backend by registering notifiers for chain events. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'chainrpc.ChainNotifier' + + # + # RegisterConfirmationsNtfn is a synchronous response-streaming RPC that + # registers an intent for a client to be notified once a confirmation request + # has reached its required number of confirmations on-chain. + # + # A client can specify whether the confirmation request should be for a + # particular transaction by its hash or for an output script by specifying a + # zero hash. + rpc :RegisterConfirmationsNtfn, ConfRequest, stream(ConfEvent) + # + # RegisterSpendNtfn is a synchronous response-streaming RPC that registers an + # intent for a client to be notification once a spend request has been spent + # by a transaction that has confirmed on-chain. + # + # A client can specify whether the spend request should be for a particular + # outpoint or for an output script by specifying a zero outpoint. + rpc :RegisterSpendNtfn, SpendRequest, stream(SpendEvent) + # + # RegisterBlockEpochNtfn is a synchronous response-streaming RPC that + # registers an intent for a client to be notified of blocks in the chain. The + # stream will return a hash and height tuple of a block for each new/stale + # block in the chain. It is the client's responsibility to determine whether + # the tuple returned is for a new or stale block in the chain. + # + # A client can also request a historical backlog of blocks from a particular + # point. This allows clients to be idempotent by ensuring that they do not + # missing processing a single block within the chain. + rpc :RegisterBlockEpochNtfn, BlockEpoch, stream(BlockEpoch) + end + + Stub = Service.rpc_stub_class + end +end diff --git a/lib/grpc_services/invoicesrpc/invoices_pb.rb b/lib/grpc_services/invoicesrpc/invoices_pb.rb new file mode 100644 index 0000000..86ba421 --- /dev/null +++ b/lib/grpc_services/invoicesrpc/invoices_pb.rb @@ -0,0 +1,48 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: invoicesrpc/invoices.proto + +require 'google/protobuf' + +require 'rpc_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("invoicesrpc/invoices.proto", :syntax => :proto3) do + add_message "invoicesrpc.CancelInvoiceMsg" do + optional :payment_hash, :bytes, 1 + end + add_message "invoicesrpc.CancelInvoiceResp" do + end + add_message "invoicesrpc.AddHoldInvoiceRequest" do + optional :memo, :string, 1 + optional :hash, :bytes, 2 + optional :value, :int64, 3 + optional :value_msat, :int64, 10 + optional :description_hash, :bytes, 4 + optional :expiry, :int64, 5 + optional :fallback_addr, :string, 6 + optional :cltv_expiry, :uint64, 7 + repeated :route_hints, :message, 8, "lnrpc.RouteHint" + optional :private, :bool, 9 + end + add_message "invoicesrpc.AddHoldInvoiceResp" do + optional :payment_request, :string, 1 + end + add_message "invoicesrpc.SettleInvoiceMsg" do + optional :preimage, :bytes, 1 + end + add_message "invoicesrpc.SettleInvoiceResp" do + end + add_message "invoicesrpc.SubscribeSingleInvoiceRequest" do + optional :r_hash, :bytes, 2 + end + end +end + +module Invoicesrpc + CancelInvoiceMsg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.CancelInvoiceMsg").msgclass + CancelInvoiceResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.CancelInvoiceResp").msgclass + AddHoldInvoiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.AddHoldInvoiceRequest").msgclass + AddHoldInvoiceResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.AddHoldInvoiceResp").msgclass + SettleInvoiceMsg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.SettleInvoiceMsg").msgclass + SettleInvoiceResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.SettleInvoiceResp").msgclass + SubscribeSingleInvoiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.SubscribeSingleInvoiceRequest").msgclass +end diff --git a/lib/grpc_services/invoicesrpc/invoices_services_pb.rb b/lib/grpc_services/invoicesrpc/invoices_services_pb.rb new file mode 100644 index 0000000..fa0d659 --- /dev/null +++ b/lib/grpc_services/invoicesrpc/invoices_services_pb.rb @@ -0,0 +1,41 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: invoicesrpc/invoices.proto for package 'invoicesrpc' + +require 'grpc' +require 'invoicesrpc/invoices_pb' + +module Invoicesrpc + module Invoices + # Invoices is a service that can be used to create, accept, settle and cancel + # invoices. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'invoicesrpc.Invoices' + + # + # SubscribeSingleInvoice returns a uni-directional stream (server -> client) + # to notify the client of state transitions of the specified invoice. + # Initially the current invoice state is always sent out. + rpc :SubscribeSingleInvoice, SubscribeSingleInvoiceRequest, stream(Lnrpc::Invoice) + # + # CancelInvoice cancels a currently open invoice. If the invoice is already + # canceled, this call will succeed. If the invoice is already settled, it will + # fail. + rpc :CancelInvoice, CancelInvoiceMsg, CancelInvoiceResp + # + # AddHoldInvoice creates a hold invoice. It ties the invoice to the hash + # supplied in the request. + rpc :AddHoldInvoice, AddHoldInvoiceRequest, AddHoldInvoiceResp + # + # SettleInvoice settles an accepted invoice. If the invoice is already + # settled, this call will succeed. + rpc :SettleInvoice, SettleInvoiceMsg, SettleInvoiceResp + end + + Stub = Service.rpc_stub_class + end +end diff --git a/lib/grpc_services/lnclipb/lncli_pb.rb b/lib/grpc_services/lnclipb/lncli_pb.rb new file mode 100644 index 0000000..c473e4d --- /dev/null +++ b/lib/grpc_services/lnclipb/lncli_pb.rb @@ -0,0 +1,18 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: lnclipb/lncli.proto + +require 'google/protobuf' + +require 'verrpc/verrpc_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("lnclipb/lncli.proto", :syntax => :proto3) do + add_message "lnclipb.VersionResponse" do + optional :lncli, :message, 1, "verrpc.Version" + optional :lnd, :message, 2, "verrpc.Version" + end + end +end + +module Lnclipb + VersionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnclipb.VersionResponse").msgclass +end diff --git a/lib/grpc_services/routerrpc/router_pb.rb b/lib/grpc_services/routerrpc/router_pb.rb new file mode 100644 index 0000000..3dae26a --- /dev/null +++ b/lib/grpc_services/routerrpc/router_pb.rb @@ -0,0 +1,229 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: routerrpc/router.proto + +require 'google/protobuf' + +require 'rpc_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("routerrpc/router.proto", :syntax => :proto3) do + add_message "routerrpc.SendPaymentRequest" do + optional :dest, :bytes, 1 + optional :amt, :int64, 2 + optional :amt_msat, :int64, 12 + optional :payment_hash, :bytes, 3 + optional :final_cltv_delta, :int32, 4 + optional :payment_request, :string, 5 + optional :timeout_seconds, :int32, 6 + optional :fee_limit_sat, :int64, 7 + optional :fee_limit_msat, :int64, 13 + optional :outgoing_chan_id, :uint64, 8 + repeated :outgoing_chan_ids, :uint64, 19 + optional :last_hop_pubkey, :bytes, 14 + optional :cltv_limit, :int32, 9 + repeated :route_hints, :message, 10, "lnrpc.RouteHint" + map :dest_custom_records, :uint64, :bytes, 11 + optional :allow_self_payment, :bool, 15 + repeated :dest_features, :enum, 16, "lnrpc.FeatureBit" + optional :max_parts, :uint32, 17 + optional :no_inflight_updates, :bool, 18 + end + add_message "routerrpc.TrackPaymentRequest" do + optional :payment_hash, :bytes, 1 + optional :no_inflight_updates, :bool, 2 + end + add_message "routerrpc.RouteFeeRequest" do + optional :dest, :bytes, 1 + optional :amt_sat, :int64, 2 + end + add_message "routerrpc.RouteFeeResponse" do + optional :routing_fee_msat, :int64, 1 + optional :time_lock_delay, :int64, 2 + end + add_message "routerrpc.SendToRouteRequest" do + optional :payment_hash, :bytes, 1 + optional :route, :message, 2, "lnrpc.Route" + end + add_message "routerrpc.SendToRouteResponse" do + optional :preimage, :bytes, 1 + optional :failure, :message, 2, "lnrpc.Failure" + end + add_message "routerrpc.ResetMissionControlRequest" do + end + add_message "routerrpc.ResetMissionControlResponse" do + end + add_message "routerrpc.QueryMissionControlRequest" do + end + add_message "routerrpc.QueryMissionControlResponse" do + repeated :pairs, :message, 2, "routerrpc.PairHistory" + end + add_message "routerrpc.PairHistory" do + optional :node_from, :bytes, 1 + optional :node_to, :bytes, 2 + optional :history, :message, 7, "routerrpc.PairData" + end + add_message "routerrpc.PairData" do + optional :fail_time, :int64, 1 + optional :fail_amt_sat, :int64, 2 + optional :fail_amt_msat, :int64, 4 + optional :success_time, :int64, 5 + optional :success_amt_sat, :int64, 6 + optional :success_amt_msat, :int64, 7 + end + add_message "routerrpc.QueryProbabilityRequest" do + optional :from_node, :bytes, 1 + optional :to_node, :bytes, 2 + optional :amt_msat, :int64, 3 + end + add_message "routerrpc.QueryProbabilityResponse" do + optional :probability, :double, 1 + optional :history, :message, 2, "routerrpc.PairData" + end + add_message "routerrpc.BuildRouteRequest" do + optional :amt_msat, :int64, 1 + optional :final_cltv_delta, :int32, 2 + optional :outgoing_chan_id, :uint64, 3 + repeated :hop_pubkeys, :bytes, 4 + end + add_message "routerrpc.BuildRouteResponse" do + optional :route, :message, 1, "lnrpc.Route" + end + add_message "routerrpc.SubscribeHtlcEventsRequest" do + end + add_message "routerrpc.HtlcEvent" do + optional :incoming_channel_id, :uint64, 1 + optional :outgoing_channel_id, :uint64, 2 + optional :incoming_htlc_id, :uint64, 3 + optional :outgoing_htlc_id, :uint64, 4 + optional :timestamp_ns, :uint64, 5 + optional :event_type, :enum, 6, "routerrpc.HtlcEvent.EventType" + oneof :event do + optional :forward_event, :message, 7, "routerrpc.ForwardEvent" + optional :forward_fail_event, :message, 8, "routerrpc.ForwardFailEvent" + optional :settle_event, :message, 9, "routerrpc.SettleEvent" + optional :link_fail_event, :message, 10, "routerrpc.LinkFailEvent" + end + end + add_enum "routerrpc.HtlcEvent.EventType" do + value :UNKNOWN, 0 + value :SEND, 1 + value :RECEIVE, 2 + value :FORWARD, 3 + end + add_message "routerrpc.HtlcInfo" do + optional :incoming_timelock, :uint32, 1 + optional :outgoing_timelock, :uint32, 2 + optional :incoming_amt_msat, :uint64, 3 + optional :outgoing_amt_msat, :uint64, 4 + end + add_message "routerrpc.ForwardEvent" do + optional :info, :message, 1, "routerrpc.HtlcInfo" + end + add_message "routerrpc.ForwardFailEvent" do + end + add_message "routerrpc.SettleEvent" do + end + add_message "routerrpc.LinkFailEvent" do + optional :info, :message, 1, "routerrpc.HtlcInfo" + optional :wire_failure, :enum, 2, "lnrpc.Failure.FailureCode" + optional :failure_detail, :enum, 3, "routerrpc.FailureDetail" + optional :failure_string, :string, 4 + end + add_message "routerrpc.PaymentStatus" do + optional :state, :enum, 1, "routerrpc.PaymentState" + optional :preimage, :bytes, 2 + repeated :htlcs, :message, 4, "lnrpc.HTLCAttempt" + end + add_message "routerrpc.CircuitKey" do + optional :chan_id, :uint64, 1 + optional :htlc_id, :uint64, 2 + end + add_message "routerrpc.ForwardHtlcInterceptRequest" do + optional :incoming_circuit_key, :message, 1, "routerrpc.CircuitKey" + optional :incoming_amount_msat, :uint64, 5 + optional :incoming_expiry, :uint32, 6 + optional :payment_hash, :bytes, 2 + optional :outgoing_requested_chan_id, :uint64, 7 + optional :outgoing_amount_msat, :uint64, 3 + optional :outgoing_expiry, :uint32, 4 + map :custom_records, :uint64, :bytes, 8 + end + add_message "routerrpc.ForwardHtlcInterceptResponse" do + optional :incoming_circuit_key, :message, 1, "routerrpc.CircuitKey" + optional :action, :enum, 2, "routerrpc.ResolveHoldForwardAction" + optional :preimage, :bytes, 3 + end + add_enum "routerrpc.FailureDetail" do + value :UNKNOWN, 0 + value :NO_DETAIL, 1 + value :ONION_DECODE, 2 + value :LINK_NOT_ELIGIBLE, 3 + value :ON_CHAIN_TIMEOUT, 4 + value :HTLC_EXCEEDS_MAX, 5 + value :INSUFFICIENT_BALANCE, 6 + value :INCOMPLETE_FORWARD, 7 + value :HTLC_ADD_FAILED, 8 + value :FORWARDS_DISABLED, 9 + value :INVOICE_CANCELED, 10 + value :INVOICE_UNDERPAID, 11 + value :INVOICE_EXPIRY_TOO_SOON, 12 + value :INVOICE_NOT_OPEN, 13 + value :MPP_INVOICE_TIMEOUT, 14 + value :ADDRESS_MISMATCH, 15 + value :SET_TOTAL_MISMATCH, 16 + value :SET_TOTAL_TOO_LOW, 17 + value :SET_OVERPAID, 18 + value :UNKNOWN_INVOICE, 19 + value :INVALID_KEYSEND, 20 + value :MPP_IN_PROGRESS, 21 + value :CIRCULAR_ROUTE, 22 + end + add_enum "routerrpc.PaymentState" do + value :IN_FLIGHT, 0 + value :SUCCEEDED, 1 + value :FAILED_TIMEOUT, 2 + value :FAILED_NO_ROUTE, 3 + value :FAILED_ERROR, 4 + value :FAILED_INCORRECT_PAYMENT_DETAILS, 5 + value :FAILED_INSUFFICIENT_BALANCE, 6 + end + add_enum "routerrpc.ResolveHoldForwardAction" do + value :SETTLE, 0 + value :FAIL, 1 + value :RESUME, 2 + end + end +end + +module Routerrpc + SendPaymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SendPaymentRequest").msgclass + TrackPaymentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.TrackPaymentRequest").msgclass + RouteFeeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.RouteFeeRequest").msgclass + RouteFeeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.RouteFeeResponse").msgclass + SendToRouteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SendToRouteRequest").msgclass + SendToRouteResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SendToRouteResponse").msgclass + ResetMissionControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ResetMissionControlRequest").msgclass + ResetMissionControlResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ResetMissionControlResponse").msgclass + QueryMissionControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryMissionControlRequest").msgclass + QueryMissionControlResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryMissionControlResponse").msgclass + PairHistory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PairHistory").msgclass + PairData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PairData").msgclass + QueryProbabilityRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryProbabilityRequest").msgclass + QueryProbabilityResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryProbabilityResponse").msgclass + BuildRouteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.BuildRouteRequest").msgclass + BuildRouteResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.BuildRouteResponse").msgclass + SubscribeHtlcEventsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SubscribeHtlcEventsRequest").msgclass + HtlcEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.HtlcEvent").msgclass + HtlcEvent::EventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.HtlcEvent.EventType").enummodule + HtlcInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.HtlcInfo").msgclass + ForwardEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ForwardEvent").msgclass + ForwardFailEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ForwardFailEvent").msgclass + SettleEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SettleEvent").msgclass + LinkFailEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.LinkFailEvent").msgclass + PaymentStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PaymentStatus").msgclass + CircuitKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.CircuitKey").msgclass + ForwardHtlcInterceptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ForwardHtlcInterceptRequest").msgclass + ForwardHtlcInterceptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ForwardHtlcInterceptResponse").msgclass + FailureDetail = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.FailureDetail").enummodule + PaymentState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PaymentState").enummodule + ResolveHoldForwardAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ResolveHoldForwardAction").enummodule +end diff --git a/lib/lnrpc/router_services_pb.rb b/lib/grpc_services/routerrpc/router_services_pb.rb similarity index 64% rename from lib/lnrpc/router_services_pb.rb rename to lib/grpc_services/routerrpc/router_services_pb.rb index e58da1a..3aad783 100644 --- a/lib/lnrpc/router_services_pb.rb +++ b/lib/grpc_services/routerrpc/router_services_pb.rb @@ -1,11 +1,13 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: router.proto for package 'routerrpc' +# Source: routerrpc/router.proto for package 'routerrpc' require 'grpc' -require_relative 'router_pb' +require 'routerrpc/router_pb' module Routerrpc module Router + # Router is a service that offers advanced interaction with the router + # subsystem of the daemon. class Service include GRPC::GenericService @@ -14,54 +16,69 @@ module Routerrpc self.unmarshal_class_method = :decode self.service_name = 'routerrpc.Router' - # * + # # SendPaymentV2 attempts to route a payment described by the passed # PaymentRequest to the final destination. The call returns a stream of # payment updates. rpc :SendPaymentV2, SendPaymentRequest, stream(Lnrpc::Payment) - # * + # # TrackPaymentV2 returns an update stream for the payment identified by the # payment hash. rpc :TrackPaymentV2, TrackPaymentRequest, stream(Lnrpc::Payment) - # * + # # EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it # may cost to send an HTLC to the target end destination. rpc :EstimateRouteFee, RouteFeeRequest, RouteFeeResponse - # * - # SendToRoute attempts to make a payment via the specified route. This method - # differs from SendPayment in that it allows users to specify a full route - # manually. This can be used for things like rebalancing, and atomic swaps. + # + # Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via + # the specified route. This method differs from SendPayment in that it + # allows users to specify a full route manually. This can be used for + # things like rebalancing, and atomic swaps. It differs from the newer + # SendToRouteV2 in that it doesn't return the full HTLC information. rpc :SendToRoute, SendToRouteRequest, SendToRouteResponse - # * + # + # SendToRouteV2 attempts to make a payment via the specified route. This + # method differs from SendPayment in that it allows users to specify a full + # route manually. This can be used for things like rebalancing, and atomic + # swaps. + rpc :SendToRouteV2, SendToRouteRequest, Lnrpc::HTLCAttempt + # # ResetMissionControl clears all mission control state and starts with a clean # slate. rpc :ResetMissionControl, ResetMissionControlRequest, ResetMissionControlResponse - # * + # # QueryMissionControl exposes the internal mission control state to callers. # It is a development feature. rpc :QueryMissionControl, QueryMissionControlRequest, QueryMissionControlResponse - # * + # # QueryProbability returns the current success probability estimate for a # given node pair and amount. rpc :QueryProbability, QueryProbabilityRequest, QueryProbabilityResponse - # * + # # BuildRoute builds a fully specified route based on a list of hop public # keys. It retrieves the relevant channel policies from the graph in order to # calculate the correct fees and time locks. rpc :BuildRoute, BuildRouteRequest, BuildRouteResponse - # * + # # SubscribeHtlcEvents creates a uni-directional stream from the server to # the client which delivers a stream of htlc events. rpc :SubscribeHtlcEvents, SubscribeHtlcEventsRequest, stream(HtlcEvent) - # * + # # Deprecated, use SendPaymentV2. SendPayment attempts to route a payment # described by the passed PaymentRequest to the final destination. The call # returns a stream of payment status updates. rpc :SendPayment, SendPaymentRequest, stream(PaymentStatus) - # * + # # Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for # the payment identified by the payment hash. rpc :TrackPayment, TrackPaymentRequest, stream(PaymentStatus) + # * + # HtlcInterceptor dispatches a bi-directional streaming RPC in which + # Forwarded HTLC requests are sent to the client and the client responds with + # a boolean that tells LND if this htlc should be intercepted. + # In case of interception, the htlc can be either settled, cancelled or + # resumed later by using the ResolveHoldForward endpoint. + rpc :HtlcInterceptor, stream(ForwardHtlcInterceptResponse), stream(ForwardHtlcInterceptRequest) end Stub = Service.rpc_stub_class diff --git a/lib/grpc_services/rpc_pb.rb b/lib/grpc_services/rpc_pb.rb new file mode 100644 index 0000000..2ceb4dc --- /dev/null +++ b/lib/grpc_services/rpc_pb.rb @@ -0,0 +1,1265 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: rpc.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("rpc.proto", :syntax => :proto3) do + add_message "lnrpc.Utxo" do + optional :address_type, :enum, 1, "lnrpc.AddressType" + optional :address, :string, 2 + optional :amount_sat, :int64, 3 + optional :pk_script, :string, 4 + optional :outpoint, :message, 5, "lnrpc.OutPoint" + optional :confirmations, :int64, 6 + end + add_message "lnrpc.Transaction" do + optional :tx_hash, :string, 1 + optional :amount, :int64, 2 + optional :num_confirmations, :int32, 3 + optional :block_hash, :string, 4 + optional :block_height, :int32, 5 + optional :time_stamp, :int64, 6 + optional :total_fees, :int64, 7 + repeated :dest_addresses, :string, 8 + optional :raw_tx_hex, :string, 9 + optional :label, :string, 10 + end + add_message "lnrpc.GetTransactionsRequest" do + optional :start_height, :int32, 1 + optional :end_height, :int32, 2 + end + add_message "lnrpc.TransactionDetails" do + repeated :transactions, :message, 1, "lnrpc.Transaction" + end + add_message "lnrpc.FeeLimit" do + oneof :limit do + optional :fixed, :int64, 1 + optional :fixed_msat, :int64, 3 + optional :percent, :int64, 2 + end + end + add_message "lnrpc.SendRequest" do + optional :dest, :bytes, 1 + optional :dest_string, :string, 2 + optional :amt, :int64, 3 + optional :amt_msat, :int64, 12 + optional :payment_hash, :bytes, 4 + optional :payment_hash_string, :string, 5 + optional :payment_request, :string, 6 + optional :final_cltv_delta, :int32, 7 + optional :fee_limit, :message, 8, "lnrpc.FeeLimit" + optional :outgoing_chan_id, :uint64, 9 + optional :last_hop_pubkey, :bytes, 13 + optional :cltv_limit, :uint32, 10 + map :dest_custom_records, :uint64, :bytes, 11 + optional :allow_self_payment, :bool, 14 + repeated :dest_features, :enum, 15, "lnrpc.FeatureBit" + end + add_message "lnrpc.SendResponse" do + optional :payment_error, :string, 1 + optional :payment_preimage, :bytes, 2 + optional :payment_route, :message, 3, "lnrpc.Route" + optional :payment_hash, :bytes, 4 + end + add_message "lnrpc.SendToRouteRequest" do + optional :payment_hash, :bytes, 1 + optional :payment_hash_string, :string, 2 + optional :route, :message, 4, "lnrpc.Route" + end + add_message "lnrpc.ChannelAcceptRequest" do + optional :node_pubkey, :bytes, 1 + optional :chain_hash, :bytes, 2 + optional :pending_chan_id, :bytes, 3 + optional :funding_amt, :uint64, 4 + optional :push_amt, :uint64, 5 + optional :dust_limit, :uint64, 6 + optional :max_value_in_flight, :uint64, 7 + optional :channel_reserve, :uint64, 8 + optional :min_htlc, :uint64, 9 + optional :fee_per_kw, :uint64, 10 + optional :csv_delay, :uint32, 11 + optional :max_accepted_htlcs, :uint32, 12 + optional :channel_flags, :uint32, 13 + end + add_message "lnrpc.ChannelAcceptResponse" do + optional :accept, :bool, 1 + optional :pending_chan_id, :bytes, 2 + end + add_message "lnrpc.ChannelPoint" do + optional :output_index, :uint32, 3 + oneof :funding_txid do + optional :funding_txid_bytes, :bytes, 1 + optional :funding_txid_str, :string, 2 + end + end + add_message "lnrpc.OutPoint" do + optional :txid_bytes, :bytes, 1 + optional :txid_str, :string, 2 + optional :output_index, :uint32, 3 + end + add_message "lnrpc.LightningAddress" do + optional :pubkey, :string, 1 + optional :host, :string, 2 + end + add_message "lnrpc.EstimateFeeRequest" do + map :AddrToAmount, :string, :int64, 1 + optional :target_conf, :int32, 2 + end + add_message "lnrpc.EstimateFeeResponse" do + optional :fee_sat, :int64, 1 + optional :feerate_sat_per_byte, :int64, 2 + end + add_message "lnrpc.SendManyRequest" do + map :AddrToAmount, :string, :int64, 1 + optional :target_conf, :int32, 3 + optional :sat_per_byte, :int64, 5 + optional :label, :string, 6 + end + add_message "lnrpc.SendManyResponse" do + optional :txid, :string, 1 + end + add_message "lnrpc.SendCoinsRequest" do + optional :addr, :string, 1 + optional :amount, :int64, 2 + optional :target_conf, :int32, 3 + optional :sat_per_byte, :int64, 5 + optional :send_all, :bool, 6 + optional :label, :string, 7 + end + add_message "lnrpc.SendCoinsResponse" do + optional :txid, :string, 1 + end + add_message "lnrpc.ListUnspentRequest" do + optional :min_confs, :int32, 1 + optional :max_confs, :int32, 2 + end + add_message "lnrpc.ListUnspentResponse" do + repeated :utxos, :message, 1, "lnrpc.Utxo" + end + add_message "lnrpc.NewAddressRequest" do + optional :type, :enum, 1, "lnrpc.AddressType" + end + add_message "lnrpc.NewAddressResponse" do + optional :address, :string, 1 + end + add_message "lnrpc.SignMessageRequest" do + optional :msg, :bytes, 1 + end + add_message "lnrpc.SignMessageResponse" do + optional :signature, :string, 1 + end + add_message "lnrpc.VerifyMessageRequest" do + optional :msg, :bytes, 1 + optional :signature, :string, 2 + end + add_message "lnrpc.VerifyMessageResponse" do + optional :valid, :bool, 1 + optional :pubkey, :string, 2 + end + add_message "lnrpc.ConnectPeerRequest" do + optional :addr, :message, 1, "lnrpc.LightningAddress" + optional :perm, :bool, 2 + end + add_message "lnrpc.ConnectPeerResponse" do + end + add_message "lnrpc.DisconnectPeerRequest" do + optional :pub_key, :string, 1 + end + add_message "lnrpc.DisconnectPeerResponse" do + end + add_message "lnrpc.HTLC" do + optional :incoming, :bool, 1 + optional :amount, :int64, 2 + optional :hash_lock, :bytes, 3 + optional :expiration_height, :uint32, 4 + end + add_message "lnrpc.ChannelConstraints" do + optional :csv_delay, :uint32, 1 + optional :chan_reserve_sat, :uint64, 2 + optional :dust_limit_sat, :uint64, 3 + optional :max_pending_amt_msat, :uint64, 4 + optional :min_htlc_msat, :uint64, 5 + optional :max_accepted_htlcs, :uint32, 6 + end + add_message "lnrpc.Channel" do + optional :active, :bool, 1 + optional :remote_pubkey, :string, 2 + optional :channel_point, :string, 3 + optional :chan_id, :uint64, 4 + optional :capacity, :int64, 5 + optional :local_balance, :int64, 6 + optional :remote_balance, :int64, 7 + optional :commit_fee, :int64, 8 + optional :commit_weight, :int64, 9 + optional :fee_per_kw, :int64, 10 + optional :unsettled_balance, :int64, 11 + optional :total_satoshis_sent, :int64, 12 + optional :total_satoshis_received, :int64, 13 + optional :num_updates, :uint64, 14 + repeated :pending_htlcs, :message, 15, "lnrpc.HTLC" + optional :csv_delay, :uint32, 16 + optional :private, :bool, 17 + optional :initiator, :bool, 18 + optional :chan_status_flags, :string, 19 + optional :local_chan_reserve_sat, :int64, 20 + optional :remote_chan_reserve_sat, :int64, 21 + optional :static_remote_key, :bool, 22 + optional :commitment_type, :enum, 26, "lnrpc.CommitmentType" + optional :lifetime, :int64, 23 + optional :uptime, :int64, 24 + optional :close_address, :string, 25 + optional :push_amount_sat, :uint64, 27 + optional :thaw_height, :uint32, 28 + optional :local_constraints, :message, 29, "lnrpc.ChannelConstraints" + optional :remote_constraints, :message, 30, "lnrpc.ChannelConstraints" + end + add_message "lnrpc.ListChannelsRequest" do + optional :active_only, :bool, 1 + optional :inactive_only, :bool, 2 + optional :public_only, :bool, 3 + optional :private_only, :bool, 4 + optional :peer, :bytes, 5 + end + add_message "lnrpc.ListChannelsResponse" do + repeated :channels, :message, 11, "lnrpc.Channel" + end + add_message "lnrpc.ChannelCloseSummary" do + optional :channel_point, :string, 1 + optional :chan_id, :uint64, 2 + optional :chain_hash, :string, 3 + optional :closing_tx_hash, :string, 4 + optional :remote_pubkey, :string, 5 + optional :capacity, :int64, 6 + optional :close_height, :uint32, 7 + optional :settled_balance, :int64, 8 + optional :time_locked_balance, :int64, 9 + optional :close_type, :enum, 10, "lnrpc.ChannelCloseSummary.ClosureType" + optional :open_initiator, :enum, 11, "lnrpc.Initiator" + optional :close_initiator, :enum, 12, "lnrpc.Initiator" + repeated :resolutions, :message, 13, "lnrpc.Resolution" + end + add_enum "lnrpc.ChannelCloseSummary.ClosureType" do + value :COOPERATIVE_CLOSE, 0 + value :LOCAL_FORCE_CLOSE, 1 + value :REMOTE_FORCE_CLOSE, 2 + value :BREACH_CLOSE, 3 + value :FUNDING_CANCELED, 4 + value :ABANDONED, 5 + end + add_message "lnrpc.Resolution" do + optional :resolution_type, :enum, 1, "lnrpc.ResolutionType" + optional :outcome, :enum, 2, "lnrpc.ResolutionOutcome" + optional :outpoint, :message, 3, "lnrpc.OutPoint" + optional :amount_sat, :uint64, 4 + optional :sweep_txid, :string, 5 + end + add_message "lnrpc.ClosedChannelsRequest" do + optional :cooperative, :bool, 1 + optional :local_force, :bool, 2 + optional :remote_force, :bool, 3 + optional :breach, :bool, 4 + optional :funding_canceled, :bool, 5 + optional :abandoned, :bool, 6 + end + add_message "lnrpc.ClosedChannelsResponse" do + repeated :channels, :message, 1, "lnrpc.ChannelCloseSummary" + end + add_message "lnrpc.Peer" do + optional :pub_key, :string, 1 + optional :address, :string, 3 + optional :bytes_sent, :uint64, 4 + optional :bytes_recv, :uint64, 5 + optional :sat_sent, :int64, 6 + optional :sat_recv, :int64, 7 + optional :inbound, :bool, 8 + optional :ping_time, :int64, 9 + optional :sync_type, :enum, 10, "lnrpc.Peer.SyncType" + map :features, :uint32, :message, 11, "lnrpc.Feature" + repeated :errors, :message, 12, "lnrpc.TimestampedError" + end + add_enum "lnrpc.Peer.SyncType" do + value :UNKNOWN_SYNC, 0 + value :ACTIVE_SYNC, 1 + value :PASSIVE_SYNC, 2 + end + add_message "lnrpc.TimestampedError" do + optional :timestamp, :uint64, 1 + optional :error, :string, 2 + end + add_message "lnrpc.ListPeersRequest" do + optional :latest_error, :bool, 1 + end + add_message "lnrpc.ListPeersResponse" do + repeated :peers, :message, 1, "lnrpc.Peer" + end + add_message "lnrpc.PeerEventSubscription" do + end + add_message "lnrpc.PeerEvent" do + optional :pub_key, :string, 1 + optional :type, :enum, 2, "lnrpc.PeerEvent.EventType" + end + add_enum "lnrpc.PeerEvent.EventType" do + value :PEER_ONLINE, 0 + value :PEER_OFFLINE, 1 + end + add_message "lnrpc.GetInfoRequest" do + end + add_message "lnrpc.GetInfoResponse" do + optional :version, :string, 14 + optional :commit_hash, :string, 20 + optional :identity_pubkey, :string, 1 + optional :alias, :string, 2 + optional :color, :string, 17 + optional :num_pending_channels, :uint32, 3 + optional :num_active_channels, :uint32, 4 + optional :num_inactive_channels, :uint32, 15 + optional :num_peers, :uint32, 5 + optional :block_height, :uint32, 6 + optional :block_hash, :string, 8 + optional :best_header_timestamp, :int64, 13 + optional :synced_to_chain, :bool, 9 + optional :synced_to_graph, :bool, 18 + optional :testnet, :bool, 10 + repeated :chains, :message, 16, "lnrpc.Chain" + repeated :uris, :string, 12 + map :features, :uint32, :message, 19, "lnrpc.Feature" + end + add_message "lnrpc.GetRecoveryInfoRequest" do + end + add_message "lnrpc.GetRecoveryInfoResponse" do + optional :recovery_mode, :bool, 1 + optional :recovery_finished, :bool, 2 + optional :progress, :double, 3 + end + add_message "lnrpc.Chain" do + optional :chain, :string, 1 + optional :network, :string, 2 + end + add_message "lnrpc.ConfirmationUpdate" do + optional :block_sha, :bytes, 1 + optional :block_height, :int32, 2 + optional :num_confs_left, :uint32, 3 + end + add_message "lnrpc.ChannelOpenUpdate" do + optional :channel_point, :message, 1, "lnrpc.ChannelPoint" + end + add_message "lnrpc.ChannelCloseUpdate" do + optional :closing_txid, :bytes, 1 + optional :success, :bool, 2 + end + add_message "lnrpc.CloseChannelRequest" do + optional :channel_point, :message, 1, "lnrpc.ChannelPoint" + optional :force, :bool, 2 + optional :target_conf, :int32, 3 + optional :sat_per_byte, :int64, 4 + optional :delivery_address, :string, 5 + end + add_message "lnrpc.CloseStatusUpdate" do + oneof :update do + optional :close_pending, :message, 1, "lnrpc.PendingUpdate" + optional :chan_close, :message, 3, "lnrpc.ChannelCloseUpdate" + end + end + add_message "lnrpc.PendingUpdate" do + optional :txid, :bytes, 1 + optional :output_index, :uint32, 2 + end + add_message "lnrpc.ReadyForPsbtFunding" do + optional :funding_address, :string, 1 + optional :funding_amount, :int64, 2 + optional :psbt, :bytes, 3 + end + add_message "lnrpc.OpenChannelRequest" do + optional :node_pubkey, :bytes, 2 + optional :node_pubkey_string, :string, 3 + optional :local_funding_amount, :int64, 4 + optional :push_sat, :int64, 5 + optional :target_conf, :int32, 6 + optional :sat_per_byte, :int64, 7 + optional :private, :bool, 8 + optional :min_htlc_msat, :int64, 9 + optional :remote_csv_delay, :uint32, 10 + optional :min_confs, :int32, 11 + optional :spend_unconfirmed, :bool, 12 + optional :close_address, :string, 13 + optional :funding_shim, :message, 14, "lnrpc.FundingShim" + optional :remote_max_value_in_flight_msat, :uint64, 15 + end + add_message "lnrpc.OpenStatusUpdate" do + optional :pending_chan_id, :bytes, 4 + oneof :update do + optional :chan_pending, :message, 1, "lnrpc.PendingUpdate" + optional :chan_open, :message, 3, "lnrpc.ChannelOpenUpdate" + optional :psbt_fund, :message, 5, "lnrpc.ReadyForPsbtFunding" + end + end + add_message "lnrpc.KeyLocator" do + optional :key_family, :int32, 1 + optional :key_index, :int32, 2 + end + add_message "lnrpc.KeyDescriptor" do + optional :raw_key_bytes, :bytes, 1 + optional :key_loc, :message, 2, "lnrpc.KeyLocator" + end + add_message "lnrpc.ChanPointShim" do + optional :amt, :int64, 1 + optional :chan_point, :message, 2, "lnrpc.ChannelPoint" + optional :local_key, :message, 3, "lnrpc.KeyDescriptor" + optional :remote_key, :bytes, 4 + optional :pending_chan_id, :bytes, 5 + optional :thaw_height, :uint32, 6 + end + add_message "lnrpc.PsbtShim" do + optional :pending_chan_id, :bytes, 1 + optional :base_psbt, :bytes, 2 + optional :no_publish, :bool, 3 + end + add_message "lnrpc.FundingShim" do + oneof :shim do + optional :chan_point_shim, :message, 1, "lnrpc.ChanPointShim" + optional :psbt_shim, :message, 2, "lnrpc.PsbtShim" + end + end + add_message "lnrpc.FundingShimCancel" do + optional :pending_chan_id, :bytes, 1 + end + add_message "lnrpc.FundingPsbtVerify" do + optional :funded_psbt, :bytes, 1 + optional :pending_chan_id, :bytes, 2 + end + add_message "lnrpc.FundingPsbtFinalize" do + optional :signed_psbt, :bytes, 1 + optional :pending_chan_id, :bytes, 2 + end + add_message "lnrpc.FundingTransitionMsg" do + oneof :trigger do + optional :shim_register, :message, 1, "lnrpc.FundingShim" + optional :shim_cancel, :message, 2, "lnrpc.FundingShimCancel" + optional :psbt_verify, :message, 3, "lnrpc.FundingPsbtVerify" + optional :psbt_finalize, :message, 4, "lnrpc.FundingPsbtFinalize" + end + end + add_message "lnrpc.FundingStateStepResp" do + end + add_message "lnrpc.PendingHTLC" do + optional :incoming, :bool, 1 + optional :amount, :int64, 2 + optional :outpoint, :string, 3 + optional :maturity_height, :uint32, 4 + optional :blocks_til_maturity, :int32, 5 + optional :stage, :uint32, 6 + end + add_message "lnrpc.PendingChannelsRequest" do + end + add_message "lnrpc.PendingChannelsResponse" do + optional :total_limbo_balance, :int64, 1 + repeated :pending_open_channels, :message, 2, "lnrpc.PendingChannelsResponse.PendingOpenChannel" + repeated :pending_closing_channels, :message, 3, "lnrpc.PendingChannelsResponse.ClosedChannel" + repeated :pending_force_closing_channels, :message, 4, "lnrpc.PendingChannelsResponse.ForceClosedChannel" + repeated :waiting_close_channels, :message, 5, "lnrpc.PendingChannelsResponse.WaitingCloseChannel" + end + add_message "lnrpc.PendingChannelsResponse.PendingChannel" do + optional :remote_node_pub, :string, 1 + optional :channel_point, :string, 2 + optional :capacity, :int64, 3 + optional :local_balance, :int64, 4 + optional :remote_balance, :int64, 5 + optional :local_chan_reserve_sat, :int64, 6 + optional :remote_chan_reserve_sat, :int64, 7 + optional :initiator, :enum, 8, "lnrpc.Initiator" + optional :commitment_type, :enum, 9, "lnrpc.CommitmentType" + end + add_message "lnrpc.PendingChannelsResponse.PendingOpenChannel" do + optional :channel, :message, 1, "lnrpc.PendingChannelsResponse.PendingChannel" + optional :confirmation_height, :uint32, 2 + optional :commit_fee, :int64, 4 + optional :commit_weight, :int64, 5 + optional :fee_per_kw, :int64, 6 + end + add_message "lnrpc.PendingChannelsResponse.WaitingCloseChannel" do + optional :channel, :message, 1, "lnrpc.PendingChannelsResponse.PendingChannel" + optional :limbo_balance, :int64, 2 + optional :commitments, :message, 3, "lnrpc.PendingChannelsResponse.Commitments" + end + add_message "lnrpc.PendingChannelsResponse.Commitments" do + optional :local_txid, :string, 1 + optional :remote_txid, :string, 2 + optional :remote_pending_txid, :string, 3 + optional :local_commit_fee_sat, :uint64, 4 + optional :remote_commit_fee_sat, :uint64, 5 + optional :remote_pending_commit_fee_sat, :uint64, 6 + end + add_message "lnrpc.PendingChannelsResponse.ClosedChannel" do + optional :channel, :message, 1, "lnrpc.PendingChannelsResponse.PendingChannel" + optional :closing_txid, :string, 2 + end + add_message "lnrpc.PendingChannelsResponse.ForceClosedChannel" do + optional :channel, :message, 1, "lnrpc.PendingChannelsResponse.PendingChannel" + optional :closing_txid, :string, 2 + optional :limbo_balance, :int64, 3 + optional :maturity_height, :uint32, 4 + optional :blocks_til_maturity, :int32, 5 + optional :recovered_balance, :int64, 6 + repeated :pending_htlcs, :message, 8, "lnrpc.PendingHTLC" + optional :anchor, :enum, 9, "lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState" + end + add_enum "lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState" do + value :LIMBO, 0 + value :RECOVERED, 1 + value :LOST, 2 + end + add_message "lnrpc.ChannelEventSubscription" do + end + add_message "lnrpc.ChannelEventUpdate" do + optional :type, :enum, 5, "lnrpc.ChannelEventUpdate.UpdateType" + oneof :channel do + optional :open_channel, :message, 1, "lnrpc.Channel" + optional :closed_channel, :message, 2, "lnrpc.ChannelCloseSummary" + optional :active_channel, :message, 3, "lnrpc.ChannelPoint" + optional :inactive_channel, :message, 4, "lnrpc.ChannelPoint" + optional :pending_open_channel, :message, 6, "lnrpc.PendingUpdate" + end + end + add_enum "lnrpc.ChannelEventUpdate.UpdateType" do + value :OPEN_CHANNEL, 0 + value :CLOSED_CHANNEL, 1 + value :ACTIVE_CHANNEL, 2 + value :INACTIVE_CHANNEL, 3 + value :PENDING_OPEN_CHANNEL, 4 + end + add_message "lnrpc.WalletBalanceRequest" do + end + add_message "lnrpc.WalletBalanceResponse" do + optional :total_balance, :int64, 1 + optional :confirmed_balance, :int64, 2 + optional :unconfirmed_balance, :int64, 3 + end + add_message "lnrpc.ChannelBalanceRequest" do + end + add_message "lnrpc.ChannelBalanceResponse" do + optional :balance, :int64, 1 + optional :pending_open_balance, :int64, 2 + end + add_message "lnrpc.QueryRoutesRequest" do + optional :pub_key, :string, 1 + optional :amt, :int64, 2 + optional :amt_msat, :int64, 12 + optional :final_cltv_delta, :int32, 4 + optional :fee_limit, :message, 5, "lnrpc.FeeLimit" + repeated :ignored_nodes, :bytes, 6 + repeated :ignored_edges, :message, 7, "lnrpc.EdgeLocator" + optional :source_pub_key, :string, 8 + optional :use_mission_control, :bool, 9 + repeated :ignored_pairs, :message, 10, "lnrpc.NodePair" + optional :cltv_limit, :uint32, 11 + map :dest_custom_records, :uint64, :bytes, 13 + optional :outgoing_chan_id, :uint64, 14 + optional :last_hop_pubkey, :bytes, 15 + repeated :route_hints, :message, 16, "lnrpc.RouteHint" + repeated :dest_features, :enum, 17, "lnrpc.FeatureBit" + end + add_message "lnrpc.NodePair" do + optional :from, :bytes, 1 + optional :to, :bytes, 2 + end + add_message "lnrpc.EdgeLocator" do + optional :channel_id, :uint64, 1 + optional :direction_reverse, :bool, 2 + end + add_message "lnrpc.QueryRoutesResponse" do + repeated :routes, :message, 1, "lnrpc.Route" + optional :success_prob, :double, 2 + end + add_message "lnrpc.Hop" do + optional :chan_id, :uint64, 1 + optional :chan_capacity, :int64, 2 + optional :amt_to_forward, :int64, 3 + optional :fee, :int64, 4 + optional :expiry, :uint32, 5 + optional :amt_to_forward_msat, :int64, 6 + optional :fee_msat, :int64, 7 + optional :pub_key, :string, 8 + optional :tlv_payload, :bool, 9 + optional :mpp_record, :message, 10, "lnrpc.MPPRecord" + map :custom_records, :uint64, :bytes, 11 + end + add_message "lnrpc.MPPRecord" do + optional :payment_addr, :bytes, 11 + optional :total_amt_msat, :int64, 10 + end + add_message "lnrpc.Route" do + optional :total_time_lock, :uint32, 1 + optional :total_fees, :int64, 2 + optional :total_amt, :int64, 3 + repeated :hops, :message, 4, "lnrpc.Hop" + optional :total_fees_msat, :int64, 5 + optional :total_amt_msat, :int64, 6 + end + add_message "lnrpc.NodeInfoRequest" do + optional :pub_key, :string, 1 + optional :include_channels, :bool, 2 + end + add_message "lnrpc.NodeInfo" do + optional :node, :message, 1, "lnrpc.LightningNode" + optional :num_channels, :uint32, 2 + optional :total_capacity, :int64, 3 + repeated :channels, :message, 4, "lnrpc.ChannelEdge" + end + add_message "lnrpc.LightningNode" do + optional :last_update, :uint32, 1 + optional :pub_key, :string, 2 + optional :alias, :string, 3 + repeated :addresses, :message, 4, "lnrpc.NodeAddress" + optional :color, :string, 5 + map :features, :uint32, :message, 6, "lnrpc.Feature" + end + add_message "lnrpc.NodeAddress" do + optional :network, :string, 1 + optional :addr, :string, 2 + end + add_message "lnrpc.RoutingPolicy" do + optional :time_lock_delta, :uint32, 1 + optional :min_htlc, :int64, 2 + optional :fee_base_msat, :int64, 3 + optional :fee_rate_milli_msat, :int64, 4 + optional :disabled, :bool, 5 + optional :max_htlc_msat, :uint64, 6 + optional :last_update, :uint32, 7 + end + add_message "lnrpc.ChannelEdge" do + optional :channel_id, :uint64, 1 + optional :chan_point, :string, 2 + optional :last_update, :uint32, 3 + optional :node1_pub, :string, 4 + optional :node2_pub, :string, 5 + optional :capacity, :int64, 6 + optional :node1_policy, :message, 7, "lnrpc.RoutingPolicy" + optional :node2_policy, :message, 8, "lnrpc.RoutingPolicy" + end + add_message "lnrpc.ChannelGraphRequest" do + optional :include_unannounced, :bool, 1 + end + add_message "lnrpc.ChannelGraph" do + repeated :nodes, :message, 1, "lnrpc.LightningNode" + repeated :edges, :message, 2, "lnrpc.ChannelEdge" + end + add_message "lnrpc.NodeMetricsRequest" do + repeated :types, :enum, 1, "lnrpc.NodeMetricType" + end + add_message "lnrpc.NodeMetricsResponse" do + map :betweenness_centrality, :string, :message, 1, "lnrpc.FloatMetric" + end + add_message "lnrpc.FloatMetric" do + optional :value, :double, 1 + optional :normalized_value, :double, 2 + end + add_message "lnrpc.ChanInfoRequest" do + optional :chan_id, :uint64, 1 + end + add_message "lnrpc.NetworkInfoRequest" do + end + add_message "lnrpc.NetworkInfo" do + optional :graph_diameter, :uint32, 1 + optional :avg_out_degree, :double, 2 + optional :max_out_degree, :uint32, 3 + optional :num_nodes, :uint32, 4 + optional :num_channels, :uint32, 5 + optional :total_network_capacity, :int64, 6 + optional :avg_channel_size, :double, 7 + optional :min_channel_size, :int64, 8 + optional :max_channel_size, :int64, 9 + optional :median_channel_size_sat, :int64, 10 + optional :num_zombie_chans, :uint64, 11 + end + add_message "lnrpc.StopRequest" do + end + add_message "lnrpc.StopResponse" do + end + add_message "lnrpc.GraphTopologySubscription" do + end + add_message "lnrpc.GraphTopologyUpdate" do + repeated :node_updates, :message, 1, "lnrpc.NodeUpdate" + repeated :channel_updates, :message, 2, "lnrpc.ChannelEdgeUpdate" + repeated :closed_chans, :message, 3, "lnrpc.ClosedChannelUpdate" + end + add_message "lnrpc.NodeUpdate" do + repeated :addresses, :string, 1 + optional :identity_key, :string, 2 + optional :global_features, :bytes, 3 + optional :alias, :string, 4 + optional :color, :string, 5 + end + add_message "lnrpc.ChannelEdgeUpdate" do + optional :chan_id, :uint64, 1 + optional :chan_point, :message, 2, "lnrpc.ChannelPoint" + optional :capacity, :int64, 3 + optional :routing_policy, :message, 4, "lnrpc.RoutingPolicy" + optional :advertising_node, :string, 5 + optional :connecting_node, :string, 6 + end + add_message "lnrpc.ClosedChannelUpdate" do + optional :chan_id, :uint64, 1 + optional :capacity, :int64, 2 + optional :closed_height, :uint32, 3 + optional :chan_point, :message, 4, "lnrpc.ChannelPoint" + end + add_message "lnrpc.HopHint" do + optional :node_id, :string, 1 + optional :chan_id, :uint64, 2 + optional :fee_base_msat, :uint32, 3 + optional :fee_proportional_millionths, :uint32, 4 + optional :cltv_expiry_delta, :uint32, 5 + end + add_message "lnrpc.RouteHint" do + repeated :hop_hints, :message, 1, "lnrpc.HopHint" + end + add_message "lnrpc.Invoice" do + optional :memo, :string, 1 + optional :r_preimage, :bytes, 3 + optional :r_hash, :bytes, 4 + optional :value, :int64, 5 + optional :value_msat, :int64, 23 + optional :settled, :bool, 6 + optional :creation_date, :int64, 7 + optional :settle_date, :int64, 8 + optional :payment_request, :string, 9 + optional :description_hash, :bytes, 10 + optional :expiry, :int64, 11 + optional :fallback_addr, :string, 12 + optional :cltv_expiry, :uint64, 13 + repeated :route_hints, :message, 14, "lnrpc.RouteHint" + optional :private, :bool, 15 + optional :add_index, :uint64, 16 + optional :settle_index, :uint64, 17 + optional :amt_paid, :int64, 18 + optional :amt_paid_sat, :int64, 19 + optional :amt_paid_msat, :int64, 20 + optional :state, :enum, 21, "lnrpc.Invoice.InvoiceState" + repeated :htlcs, :message, 22, "lnrpc.InvoiceHTLC" + map :features, :uint32, :message, 24, "lnrpc.Feature" + optional :is_keysend, :bool, 25 + end + add_enum "lnrpc.Invoice.InvoiceState" do + value :OPEN, 0 + value :SETTLED, 1 + value :CANCELED, 2 + value :ACCEPTED, 3 + end + add_message "lnrpc.InvoiceHTLC" do + optional :chan_id, :uint64, 1 + optional :htlc_index, :uint64, 2 + optional :amt_msat, :uint64, 3 + optional :accept_height, :int32, 4 + optional :accept_time, :int64, 5 + optional :resolve_time, :int64, 6 + optional :expiry_height, :int32, 7 + optional :state, :enum, 8, "lnrpc.InvoiceHTLCState" + map :custom_records, :uint64, :bytes, 9 + optional :mpp_total_amt_msat, :uint64, 10 + end + add_message "lnrpc.AddInvoiceResponse" do + optional :r_hash, :bytes, 1 + optional :payment_request, :string, 2 + optional :add_index, :uint64, 16 + end + add_message "lnrpc.PaymentHash" do + optional :r_hash_str, :string, 1 + optional :r_hash, :bytes, 2 + end + add_message "lnrpc.ListInvoiceRequest" do + optional :pending_only, :bool, 1 + optional :index_offset, :uint64, 4 + optional :num_max_invoices, :uint64, 5 + optional :reversed, :bool, 6 + end + add_message "lnrpc.ListInvoiceResponse" do + repeated :invoices, :message, 1, "lnrpc.Invoice" + optional :last_index_offset, :uint64, 2 + optional :first_index_offset, :uint64, 3 + end + add_message "lnrpc.InvoiceSubscription" do + optional :add_index, :uint64, 1 + optional :settle_index, :uint64, 2 + end + add_message "lnrpc.Payment" do + optional :payment_hash, :string, 1 + optional :value, :int64, 2 + optional :creation_date, :int64, 3 + optional :fee, :int64, 5 + optional :payment_preimage, :string, 6 + optional :value_sat, :int64, 7 + optional :value_msat, :int64, 8 + optional :payment_request, :string, 9 + optional :status, :enum, 10, "lnrpc.Payment.PaymentStatus" + optional :fee_sat, :int64, 11 + optional :fee_msat, :int64, 12 + optional :creation_time_ns, :int64, 13 + repeated :htlcs, :message, 14, "lnrpc.HTLCAttempt" + optional :payment_index, :uint64, 15 + optional :failure_reason, :enum, 16, "lnrpc.PaymentFailureReason" + end + add_enum "lnrpc.Payment.PaymentStatus" do + value :UNKNOWN, 0 + value :IN_FLIGHT, 1 + value :SUCCEEDED, 2 + value :FAILED, 3 + end + add_message "lnrpc.HTLCAttempt" do + optional :status, :enum, 1, "lnrpc.HTLCAttempt.HTLCStatus" + optional :route, :message, 2, "lnrpc.Route" + optional :attempt_time_ns, :int64, 3 + optional :resolve_time_ns, :int64, 4 + optional :failure, :message, 5, "lnrpc.Failure" + optional :preimage, :bytes, 6 + end + add_enum "lnrpc.HTLCAttempt.HTLCStatus" do + value :IN_FLIGHT, 0 + value :SUCCEEDED, 1 + value :FAILED, 2 + end + add_message "lnrpc.ListPaymentsRequest" do + optional :include_incomplete, :bool, 1 + optional :index_offset, :uint64, 2 + optional :max_payments, :uint64, 3 + optional :reversed, :bool, 4 + end + add_message "lnrpc.ListPaymentsResponse" do + repeated :payments, :message, 1, "lnrpc.Payment" + optional :first_index_offset, :uint64, 2 + optional :last_index_offset, :uint64, 3 + end + add_message "lnrpc.DeleteAllPaymentsRequest" do + end + add_message "lnrpc.DeleteAllPaymentsResponse" do + end + add_message "lnrpc.AbandonChannelRequest" do + optional :channel_point, :message, 1, "lnrpc.ChannelPoint" + end + add_message "lnrpc.AbandonChannelResponse" do + end + add_message "lnrpc.DebugLevelRequest" do + optional :show, :bool, 1 + optional :level_spec, :string, 2 + end + add_message "lnrpc.DebugLevelResponse" do + optional :sub_systems, :string, 1 + end + add_message "lnrpc.PayReqString" do + optional :pay_req, :string, 1 + end + add_message "lnrpc.PayReq" do + optional :destination, :string, 1 + optional :payment_hash, :string, 2 + optional :num_satoshis, :int64, 3 + optional :timestamp, :int64, 4 + optional :expiry, :int64, 5 + optional :description, :string, 6 + optional :description_hash, :string, 7 + optional :fallback_addr, :string, 8 + optional :cltv_expiry, :int64, 9 + repeated :route_hints, :message, 10, "lnrpc.RouteHint" + optional :payment_addr, :bytes, 11 + optional :num_msat, :int64, 12 + map :features, :uint32, :message, 13, "lnrpc.Feature" + end + add_message "lnrpc.Feature" do + optional :name, :string, 2 + optional :is_required, :bool, 3 + optional :is_known, :bool, 4 + end + add_message "lnrpc.FeeReportRequest" do + end + add_message "lnrpc.ChannelFeeReport" do + optional :chan_id, :uint64, 5 + optional :channel_point, :string, 1 + optional :base_fee_msat, :int64, 2 + optional :fee_per_mil, :int64, 3 + optional :fee_rate, :double, 4 + end + add_message "lnrpc.FeeReportResponse" do + repeated :channel_fees, :message, 1, "lnrpc.ChannelFeeReport" + optional :day_fee_sum, :uint64, 2 + optional :week_fee_sum, :uint64, 3 + optional :month_fee_sum, :uint64, 4 + end + add_message "lnrpc.PolicyUpdateRequest" do + optional :base_fee_msat, :int64, 3 + optional :fee_rate, :double, 4 + optional :time_lock_delta, :uint32, 5 + optional :max_htlc_msat, :uint64, 6 + optional :min_htlc_msat, :uint64, 7 + optional :min_htlc_msat_specified, :bool, 8 + oneof :scope do + optional :global, :bool, 1 + optional :chan_point, :message, 2, "lnrpc.ChannelPoint" + end + end + add_message "lnrpc.PolicyUpdateResponse" do + end + add_message "lnrpc.ForwardingHistoryRequest" do + optional :start_time, :uint64, 1 + optional :end_time, :uint64, 2 + optional :index_offset, :uint32, 3 + optional :num_max_events, :uint32, 4 + end + add_message "lnrpc.ForwardingEvent" do + optional :timestamp, :uint64, 1 + optional :chan_id_in, :uint64, 2 + optional :chan_id_out, :uint64, 4 + optional :amt_in, :uint64, 5 + optional :amt_out, :uint64, 6 + optional :fee, :uint64, 7 + optional :fee_msat, :uint64, 8 + optional :amt_in_msat, :uint64, 9 + optional :amt_out_msat, :uint64, 10 + end + add_message "lnrpc.ForwardingHistoryResponse" do + repeated :forwarding_events, :message, 1, "lnrpc.ForwardingEvent" + optional :last_offset_index, :uint32, 2 + end + add_message "lnrpc.ExportChannelBackupRequest" do + optional :chan_point, :message, 1, "lnrpc.ChannelPoint" + end + add_message "lnrpc.ChannelBackup" do + optional :chan_point, :message, 1, "lnrpc.ChannelPoint" + optional :chan_backup, :bytes, 2 + end + add_message "lnrpc.MultiChanBackup" do + repeated :chan_points, :message, 1, "lnrpc.ChannelPoint" + optional :multi_chan_backup, :bytes, 2 + end + add_message "lnrpc.ChanBackupExportRequest" do + end + add_message "lnrpc.ChanBackupSnapshot" do + optional :single_chan_backups, :message, 1, "lnrpc.ChannelBackups" + optional :multi_chan_backup, :message, 2, "lnrpc.MultiChanBackup" + end + add_message "lnrpc.ChannelBackups" do + repeated :chan_backups, :message, 1, "lnrpc.ChannelBackup" + end + add_message "lnrpc.RestoreChanBackupRequest" do + oneof :backup do + optional :chan_backups, :message, 1, "lnrpc.ChannelBackups" + optional :multi_chan_backup, :bytes, 2 + end + end + add_message "lnrpc.RestoreBackupResponse" do + end + add_message "lnrpc.ChannelBackupSubscription" do + end + add_message "lnrpc.VerifyChanBackupResponse" do + end + add_message "lnrpc.MacaroonPermission" do + optional :entity, :string, 1 + optional :action, :string, 2 + end + add_message "lnrpc.BakeMacaroonRequest" do + repeated :permissions, :message, 1, "lnrpc.MacaroonPermission" + end + add_message "lnrpc.BakeMacaroonResponse" do + optional :macaroon, :string, 1 + end + add_message "lnrpc.Failure" do + optional :code, :enum, 1, "lnrpc.Failure.FailureCode" + optional :channel_update, :message, 3, "lnrpc.ChannelUpdate" + optional :htlc_msat, :uint64, 4 + optional :onion_sha_256, :bytes, 5 + optional :cltv_expiry, :uint32, 6 + optional :flags, :uint32, 7 + optional :failure_source_index, :uint32, 8 + optional :height, :uint32, 9 + end + add_enum "lnrpc.Failure.FailureCode" do + value :RESERVED, 0 + value :INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS, 1 + value :INCORRECT_PAYMENT_AMOUNT, 2 + value :FINAL_INCORRECT_CLTV_EXPIRY, 3 + value :FINAL_INCORRECT_HTLC_AMOUNT, 4 + value :FINAL_EXPIRY_TOO_SOON, 5 + value :INVALID_REALM, 6 + value :EXPIRY_TOO_SOON, 7 + value :INVALID_ONION_VERSION, 8 + value :INVALID_ONION_HMAC, 9 + value :INVALID_ONION_KEY, 10 + value :AMOUNT_BELOW_MINIMUM, 11 + value :FEE_INSUFFICIENT, 12 + value :INCORRECT_CLTV_EXPIRY, 13 + value :CHANNEL_DISABLED, 14 + value :TEMPORARY_CHANNEL_FAILURE, 15 + value :REQUIRED_NODE_FEATURE_MISSING, 16 + value :REQUIRED_CHANNEL_FEATURE_MISSING, 17 + value :UNKNOWN_NEXT_PEER, 18 + value :TEMPORARY_NODE_FAILURE, 19 + value :PERMANENT_NODE_FAILURE, 20 + value :PERMANENT_CHANNEL_FAILURE, 21 + value :EXPIRY_TOO_FAR, 22 + value :MPP_TIMEOUT, 23 + value :INTERNAL_FAILURE, 997 + value :UNKNOWN_FAILURE, 998 + value :UNREADABLE_FAILURE, 999 + end + add_message "lnrpc.ChannelUpdate" do + optional :signature, :bytes, 1 + optional :chain_hash, :bytes, 2 + optional :chan_id, :uint64, 3 + optional :timestamp, :uint32, 4 + optional :message_flags, :uint32, 10 + optional :channel_flags, :uint32, 5 + optional :time_lock_delta, :uint32, 6 + optional :htlc_minimum_msat, :uint64, 7 + optional :base_fee, :uint32, 8 + optional :fee_rate, :uint32, 9 + optional :htlc_maximum_msat, :uint64, 11 + optional :extra_opaque_data, :bytes, 12 + end + add_enum "lnrpc.AddressType" do + value :WITNESS_PUBKEY_HASH, 0 + value :NESTED_PUBKEY_HASH, 1 + value :UNUSED_WITNESS_PUBKEY_HASH, 2 + value :UNUSED_NESTED_PUBKEY_HASH, 3 + end + add_enum "lnrpc.CommitmentType" do + value :LEGACY, 0 + value :STATIC_REMOTE_KEY, 1 + value :ANCHORS, 2 + value :UNKNOWN_COMMITMENT_TYPE, 999 + end + add_enum "lnrpc.Initiator" do + value :INITIATOR_UNKNOWN, 0 + value :INITIATOR_LOCAL, 1 + value :INITIATOR_REMOTE, 2 + value :INITIATOR_BOTH, 3 + end + add_enum "lnrpc.ResolutionType" do + value :TYPE_UNKNOWN, 0 + value :ANCHOR, 1 + value :INCOMING_HTLC, 2 + value :OUTGOING_HTLC, 3 + value :COMMIT, 4 + end + add_enum "lnrpc.ResolutionOutcome" do + value :OUTCOME_UNKNOWN, 0 + value :CLAIMED, 1 + value :UNCLAIMED, 2 + value :ABANDONED, 3 + value :FIRST_STAGE, 4 + value :TIMEOUT, 5 + end + add_enum "lnrpc.NodeMetricType" do + value :UNKNOWN, 0 + value :BETWEENNESS_CENTRALITY, 1 + end + add_enum "lnrpc.InvoiceHTLCState" do + value :ACCEPTED, 0 + value :SETTLED, 1 + value :CANCELED, 2 + end + add_enum "lnrpc.PaymentFailureReason" do + value :FAILURE_REASON_NONE, 0 + value :FAILURE_REASON_TIMEOUT, 1 + value :FAILURE_REASON_NO_ROUTE, 2 + value :FAILURE_REASON_ERROR, 3 + value :FAILURE_REASON_INCORRECT_PAYMENT_DETAILS, 4 + value :FAILURE_REASON_INSUFFICIENT_BALANCE, 5 + end + add_enum "lnrpc.FeatureBit" do + value :DATALOSS_PROTECT_REQ, 0 + value :DATALOSS_PROTECT_OPT, 1 + value :INITIAL_ROUING_SYNC, 3 + value :UPFRONT_SHUTDOWN_SCRIPT_REQ, 4 + value :UPFRONT_SHUTDOWN_SCRIPT_OPT, 5 + value :GOSSIP_QUERIES_REQ, 6 + value :GOSSIP_QUERIES_OPT, 7 + value :TLV_ONION_REQ, 8 + value :TLV_ONION_OPT, 9 + value :EXT_GOSSIP_QUERIES_REQ, 10 + value :EXT_GOSSIP_QUERIES_OPT, 11 + value :STATIC_REMOTE_KEY_REQ, 12 + value :STATIC_REMOTE_KEY_OPT, 13 + value :PAYMENT_ADDR_REQ, 14 + value :PAYMENT_ADDR_OPT, 15 + value :MPP_REQ, 16 + value :MPP_OPT, 17 + end + end +end + +module Lnrpc + Utxo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Utxo").msgclass + Transaction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Transaction").msgclass + GetTransactionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GetTransactionsRequest").msgclass + TransactionDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.TransactionDetails").msgclass + FeeLimit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FeeLimit").msgclass + SendRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendRequest").msgclass + SendResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendResponse").msgclass + SendToRouteRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendToRouteRequest").msgclass + ChannelAcceptRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelAcceptRequest").msgclass + ChannelAcceptResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelAcceptResponse").msgclass + ChannelPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelPoint").msgclass + OutPoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.OutPoint").msgclass + LightningAddress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.LightningAddress").msgclass + EstimateFeeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.EstimateFeeRequest").msgclass + EstimateFeeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.EstimateFeeResponse").msgclass + SendManyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendManyRequest").msgclass + SendManyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendManyResponse").msgclass + SendCoinsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendCoinsRequest").msgclass + SendCoinsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendCoinsResponse").msgclass + ListUnspentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListUnspentRequest").msgclass + ListUnspentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListUnspentResponse").msgclass + NewAddressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NewAddressRequest").msgclass + NewAddressResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NewAddressResponse").msgclass + SignMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SignMessageRequest").msgclass + SignMessageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SignMessageResponse").msgclass + VerifyMessageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.VerifyMessageRequest").msgclass + VerifyMessageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.VerifyMessageResponse").msgclass + ConnectPeerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ConnectPeerRequest").msgclass + ConnectPeerResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ConnectPeerResponse").msgclass + DisconnectPeerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DisconnectPeerRequest").msgclass + DisconnectPeerResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DisconnectPeerResponse").msgclass + HTLC = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.HTLC").msgclass + ChannelConstraints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelConstraints").msgclass + Channel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Channel").msgclass + ListChannelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListChannelsRequest").msgclass + ListChannelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListChannelsResponse").msgclass + ChannelCloseSummary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelCloseSummary").msgclass + ChannelCloseSummary::ClosureType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelCloseSummary.ClosureType").enummodule + Resolution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Resolution").msgclass + ClosedChannelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ClosedChannelsRequest").msgclass + ClosedChannelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ClosedChannelsResponse").msgclass + Peer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Peer").msgclass + Peer::SyncType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Peer.SyncType").enummodule + TimestampedError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.TimestampedError").msgclass + ListPeersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListPeersRequest").msgclass + ListPeersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListPeersResponse").msgclass + PeerEventSubscription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PeerEventSubscription").msgclass + PeerEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PeerEvent").msgclass + PeerEvent::EventType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PeerEvent.EventType").enummodule + GetInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GetInfoRequest").msgclass + GetInfoResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GetInfoResponse").msgclass + GetRecoveryInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GetRecoveryInfoRequest").msgclass + GetRecoveryInfoResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GetRecoveryInfoResponse").msgclass + Chain = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Chain").msgclass + ConfirmationUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ConfirmationUpdate").msgclass + ChannelOpenUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelOpenUpdate").msgclass + ChannelCloseUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelCloseUpdate").msgclass + CloseChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.CloseChannelRequest").msgclass + CloseStatusUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.CloseStatusUpdate").msgclass + PendingUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingUpdate").msgclass + ReadyForPsbtFunding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ReadyForPsbtFunding").msgclass + OpenChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.OpenChannelRequest").msgclass + OpenStatusUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.OpenStatusUpdate").msgclass + KeyLocator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.KeyLocator").msgclass + KeyDescriptor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.KeyDescriptor").msgclass + ChanPointShim = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChanPointShim").msgclass + PsbtShim = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PsbtShim").msgclass + FundingShim = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingShim").msgclass + FundingShimCancel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingShimCancel").msgclass + FundingPsbtVerify = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingPsbtVerify").msgclass + FundingPsbtFinalize = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingPsbtFinalize").msgclass + FundingTransitionMsg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingTransitionMsg").msgclass + FundingStateStepResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingStateStepResp").msgclass + PendingHTLC = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingHTLC").msgclass + PendingChannelsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsRequest").msgclass + PendingChannelsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse").msgclass + PendingChannelsResponse::PendingChannel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.PendingChannel").msgclass + PendingChannelsResponse::PendingOpenChannel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.PendingOpenChannel").msgclass + PendingChannelsResponse::WaitingCloseChannel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.WaitingCloseChannel").msgclass + PendingChannelsResponse::Commitments = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.Commitments").msgclass + PendingChannelsResponse::ClosedChannel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.ClosedChannel").msgclass + PendingChannelsResponse::ForceClosedChannel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.ForceClosedChannel").msgclass + PendingChannelsResponse::ForceClosedChannel::AnchorState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState").enummodule + ChannelEventSubscription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelEventSubscription").msgclass + ChannelEventUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelEventUpdate").msgclass + ChannelEventUpdate::UpdateType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelEventUpdate.UpdateType").enummodule + WalletBalanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.WalletBalanceRequest").msgclass + WalletBalanceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.WalletBalanceResponse").msgclass + ChannelBalanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelBalanceRequest").msgclass + ChannelBalanceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelBalanceResponse").msgclass + QueryRoutesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.QueryRoutesRequest").msgclass + NodePair = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodePair").msgclass + EdgeLocator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.EdgeLocator").msgclass + QueryRoutesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.QueryRoutesResponse").msgclass + Hop = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Hop").msgclass + MPPRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.MPPRecord").msgclass + Route = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Route").msgclass + NodeInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeInfoRequest").msgclass + NodeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeInfo").msgclass + LightningNode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.LightningNode").msgclass + NodeAddress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeAddress").msgclass + RoutingPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.RoutingPolicy").msgclass + ChannelEdge = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelEdge").msgclass + ChannelGraphRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelGraphRequest").msgclass + ChannelGraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelGraph").msgclass + NodeMetricsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeMetricsRequest").msgclass + NodeMetricsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeMetricsResponse").msgclass + FloatMetric = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FloatMetric").msgclass + ChanInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChanInfoRequest").msgclass + NetworkInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NetworkInfoRequest").msgclass + NetworkInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NetworkInfo").msgclass + StopRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.StopRequest").msgclass + StopResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.StopResponse").msgclass + GraphTopologySubscription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GraphTopologySubscription").msgclass + GraphTopologyUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GraphTopologyUpdate").msgclass + NodeUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeUpdate").msgclass + ChannelEdgeUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelEdgeUpdate").msgclass + ClosedChannelUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ClosedChannelUpdate").msgclass + HopHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.HopHint").msgclass + RouteHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.RouteHint").msgclass + Invoice = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Invoice").msgclass + Invoice::InvoiceState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Invoice.InvoiceState").enummodule + InvoiceHTLC = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.InvoiceHTLC").msgclass + AddInvoiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.AddInvoiceResponse").msgclass + PaymentHash = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PaymentHash").msgclass + ListInvoiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListInvoiceRequest").msgclass + ListInvoiceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListInvoiceResponse").msgclass + InvoiceSubscription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.InvoiceSubscription").msgclass + Payment = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Payment").msgclass + Payment::PaymentStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Payment.PaymentStatus").enummodule + HTLCAttempt = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.HTLCAttempt").msgclass + HTLCAttempt::HTLCStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.HTLCAttempt.HTLCStatus").enummodule + ListPaymentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListPaymentsRequest").msgclass + ListPaymentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListPaymentsResponse").msgclass + DeleteAllPaymentsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DeleteAllPaymentsRequest").msgclass + DeleteAllPaymentsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DeleteAllPaymentsResponse").msgclass + AbandonChannelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.AbandonChannelRequest").msgclass + AbandonChannelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.AbandonChannelResponse").msgclass + DebugLevelRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DebugLevelRequest").msgclass + DebugLevelResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DebugLevelResponse").msgclass + PayReqString = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PayReqString").msgclass + PayReq = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PayReq").msgclass + Feature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Feature").msgclass + FeeReportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FeeReportRequest").msgclass + ChannelFeeReport = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelFeeReport").msgclass + FeeReportResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FeeReportResponse").msgclass + PolicyUpdateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PolicyUpdateRequest").msgclass + PolicyUpdateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PolicyUpdateResponse").msgclass + ForwardingHistoryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ForwardingHistoryRequest").msgclass + ForwardingEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ForwardingEvent").msgclass + ForwardingHistoryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ForwardingHistoryResponse").msgclass + ExportChannelBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ExportChannelBackupRequest").msgclass + ChannelBackup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelBackup").msgclass + MultiChanBackup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.MultiChanBackup").msgclass + ChanBackupExportRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChanBackupExportRequest").msgclass + ChanBackupSnapshot = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChanBackupSnapshot").msgclass + ChannelBackups = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelBackups").msgclass + RestoreChanBackupRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.RestoreChanBackupRequest").msgclass + RestoreBackupResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.RestoreBackupResponse").msgclass + ChannelBackupSubscription = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelBackupSubscription").msgclass + VerifyChanBackupResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.VerifyChanBackupResponse").msgclass + MacaroonPermission = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.MacaroonPermission").msgclass + BakeMacaroonRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.BakeMacaroonRequest").msgclass + BakeMacaroonResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.BakeMacaroonResponse").msgclass + Failure = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Failure").msgclass + Failure::FailureCode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Failure.FailureCode").enummodule + ChannelUpdate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelUpdate").msgclass + AddressType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.AddressType").enummodule + CommitmentType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.CommitmentType").enummodule + Initiator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Initiator").enummodule + ResolutionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ResolutionType").enummodule + ResolutionOutcome = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ResolutionOutcome").enummodule + NodeMetricType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeMetricType").enummodule + InvoiceHTLCState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.InvoiceHTLCState").enummodule + PaymentFailureReason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PaymentFailureReason").enummodule + FeatureBit = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FeatureBit").enummodule +end diff --git a/lib/lnrpc/rpc_services_pb.rb b/lib/grpc_services/rpc_services_pb.rb similarity index 82% rename from lib/lnrpc/rpc_services_pb.rb rename to lib/grpc_services/rpc_services_pb.rb index 3b7f0b2..cd02013 100644 --- a/lib/lnrpc/rpc_services_pb.rb +++ b/lib/grpc_services/rpc_services_pb.rb @@ -2,19 +2,15 @@ # Source: rpc.proto for package 'lnrpc' require 'grpc' -require_relative 'rpc_pb' +require 'rpc_pb' module Lnrpc - module WalletUnlocker - # * + module Lightning + # # Comments in this file will be directly parsed into the API # Documentation as descriptions of the associated method, message, or field. # These descriptions should go right above the definition of the object, and - # can be in either block or /// comment format. - # - # One edge case exists where a // comment followed by a /// comment in the - # next line will cause the description not to show up in the documentation. In - # that instance, simply separate the two comments with a blank line. + # can be in either block or // comment format. # # An RPC method can be matched to an lncli command by placing a line in the # beginning of the description in exactly the following format: @@ -27,53 +23,7 @@ module Lnrpc # this proto file can be found here: # https://github.com/lightninglabs/lightning-api # - # The WalletUnlocker service is used to set up a wallet password for - # lnd at first startup, and unlock a previously set up wallet. - class Service - - include GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'lnrpc.WalletUnlocker' - - # * - # GenSeed is the first method that should be used to instantiate a new lnd - # instance. This method allows a caller to generate a new aezeed cipher seed - # given an optional passphrase. If provided, the passphrase will be necessary - # to decrypt the cipherseed to expose the internal wallet seed. - # - # Once the cipherseed is obtained and verified by the user, the InitWallet - # method should be used to commit the newly generated seed, and create the - # wallet. - rpc :GenSeed, GenSeedRequest, GenSeedResponse - # * - # InitWallet is used when lnd is starting up for the first time to fully - # initialize the daemon and its internal wallet. At the very least a wallet - # password must be provided. This will be used to encrypt sensitive material - # on disk. - # - # In the case of a recovery scenario, the user can also specify their aezeed - # mnemonic and passphrase. If set, then the daemon will use this prior state - # to initialize its internal wallet. - # - # Alternatively, this can be used along with the GenSeed RPC to obtain a - # seed, then present it to the user. Once it has been verified by the user, - # the seed can be fed into this RPC in order to commit the new wallet. - rpc :InitWallet, InitWalletRequest, InitWalletResponse - # * lncli: `unlock` - # UnlockWallet is used at startup of lnd to provide a password to unlock - # the wallet database. - rpc :UnlockWallet, UnlockWalletRequest, UnlockWalletResponse - # * lncli: `changepassword` - # ChangePassword changes the password of the encrypted wallet. This will - # automatically unlock the wallet database if successful. - rpc :ChangePassword, ChangePasswordRequest, ChangePasswordResponse - end - - Stub = Service.rpc_stub_class - end - module Lightning + # Lightning is the main RPC server of the daemon. class Service include GRPC::GenericService @@ -82,111 +32,123 @@ module Lnrpc self.unmarshal_class_method = :decode self.service_name = 'lnrpc.Lightning' - # * lncli: `walletbalance` + # lncli: `walletbalance` # WalletBalance returns total unspent outputs(confirmed and unconfirmed), all # confirmed unspent outputs and all unconfirmed unspent outputs under control # of the wallet. rpc :WalletBalance, WalletBalanceRequest, WalletBalanceResponse - # * lncli: `channelbalance` + # lncli: `channelbalance` # ChannelBalance returns the total funds available across all open channels # in satoshis. rpc :ChannelBalance, ChannelBalanceRequest, ChannelBalanceResponse - # * lncli: `listchaintxns` + # lncli: `listchaintxns` # GetTransactions returns a list describing all the known transactions # relevant to the wallet. rpc :GetTransactions, GetTransactionsRequest, TransactionDetails - # * lncli: `estimatefee` + # lncli: `estimatefee` # EstimateFee asks the chain backend to estimate the fee rate and total fees # for a transaction that pays to multiple specified outputs. + # + # When using REST, the `AddrToAmount` map type can be set by appending + # `&AddrToAmount[
]=` to the URL. Unfortunately this + # map type doesn't appear in the REST API documentation because of a bug in + # the grpc-gateway library. rpc :EstimateFee, EstimateFeeRequest, EstimateFeeResponse - # * lncli: `sendcoins` + # lncli: `sendcoins` # SendCoins executes a request to send coins to a particular address. Unlike # SendMany, this RPC call only allows creating a single output at a time. If # neither target_conf, or sat_per_byte are set, then the internal wallet will # consult its fee model to determine a fee for the default confirmation # target. rpc :SendCoins, SendCoinsRequest, SendCoinsResponse - # * lncli: `listunspent` + # lncli: `listunspent` + # Deprecated, use walletrpc.ListUnspent instead. + # # ListUnspent returns a list of all utxos spendable by the wallet with a # number of confirmations between the specified minimum and maximum. rpc :ListUnspent, ListUnspentRequest, ListUnspentResponse - # * + # # SubscribeTransactions creates a uni-directional stream from the server to # the client in which any newly discovered transactions relevant to the # wallet are sent over. rpc :SubscribeTransactions, GetTransactionsRequest, stream(Transaction) - # * lncli: `sendmany` + # lncli: `sendmany` # SendMany handles a request for a transaction that creates multiple specified # outputs in parallel. If neither target_conf, or sat_per_byte are set, then # the internal wallet will consult its fee model to determine a fee for the # default confirmation target. rpc :SendMany, SendManyRequest, SendManyResponse - # * lncli: `newaddress` + # lncli: `newaddress` # NewAddress creates a new address under control of the local wallet. rpc :NewAddress, NewAddressRequest, NewAddressResponse - # * lncli: `signmessage` + # lncli: `signmessage` # SignMessage signs a message with this node's private key. The returned # signature string is `zbase32` encoded and pubkey recoverable, meaning that # only the message digest and signature are needed for verification. rpc :SignMessage, SignMessageRequest, SignMessageResponse - # * lncli: `verifymessage` + # lncli: `verifymessage` # VerifyMessage verifies a signature over a msg. The signature must be # zbase32 encoded and signed by an active node in the resident node's # channel database. In addition to returning the validity of the signature, # VerifyMessage also returns the recovered pubkey from the signature. rpc :VerifyMessage, VerifyMessageRequest, VerifyMessageResponse - # * lncli: `connect` + # lncli: `connect` # ConnectPeer attempts to establish a connection to a remote peer. This is at # the networking level, and is used for communication between nodes. This is # distinct from establishing a channel with a peer. rpc :ConnectPeer, ConnectPeerRequest, ConnectPeerResponse - # * lncli: `disconnect` + # lncli: `disconnect` # DisconnectPeer attempts to disconnect one peer from another identified by a # given pubKey. In the case that we currently have a pending or active channel # with the target peer, then this action will be not be allowed. rpc :DisconnectPeer, DisconnectPeerRequest, DisconnectPeerResponse - # * lncli: `listpeers` + # lncli: `listpeers` # ListPeers returns a verbose listing of all currently active peers. rpc :ListPeers, ListPeersRequest, ListPeersResponse - # * + # # SubscribePeerEvents creates a uni-directional stream from the server to # the client in which any events relevant to the state of peers are sent # over. Events include peers going online and offline. rpc :SubscribePeerEvents, PeerEventSubscription, stream(PeerEvent) - # * lncli: `getinfo` + # lncli: `getinfo` # GetInfo returns general information concerning the lightning node including # it's identity pubkey, alias, the chains it is connected to, and information # concerning the number of open+pending channels. rpc :GetInfo, GetInfoRequest, GetInfoResponse + # * lncli: `getrecoveryinfo` + # GetRecoveryInfo returns information concerning the recovery mode including + # whether it's in a recovery mode, whether the recovery is finished, and the + # progress made so far. + rpc :GetRecoveryInfo, GetRecoveryInfoRequest, GetRecoveryInfoResponse # TODO(roasbeef): merge with below with bool? # - # * lncli: `pendingchannels` + # lncli: `pendingchannels` # PendingChannels returns a list of all the channels that are currently # considered "pending". A channel is pending if it has finished the funding # workflow and is waiting for confirmations for the funding txn, or is in the # process of closure, either initiated cooperatively or non-cooperatively. rpc :PendingChannels, PendingChannelsRequest, PendingChannelsResponse - # * lncli: `listchannels` + # lncli: `listchannels` # ListChannels returns a description of all the open channels that this node # is a participant in. rpc :ListChannels, ListChannelsRequest, ListChannelsResponse - # * + # # SubscribeChannelEvents creates a uni-directional stream from the server to # the client in which any updates relevant to the state of the channels are # sent over. Events include new active channels, inactive channels, and closed # channels. rpc :SubscribeChannelEvents, ChannelEventSubscription, stream(ChannelEventUpdate) - # * lncli: `closedchannels` + # lncli: `closedchannels` # ClosedChannels returns a description of all the closed channels that # this node was a participant in. rpc :ClosedChannels, ClosedChannelsRequest, ClosedChannelsResponse - # * + # # OpenChannelSync is a synchronous version of the OpenChannel RPC call. This # call is meant to be consumed by clients to the REST proxy. As with all # other sync calls, all byte slices are intended to be populated as hex # encoded strings. rpc :OpenChannelSync, OpenChannelRequest, ChannelPoint - # * lncli: `openchannel` + # lncli: `openchannel` # OpenChannel attempts to open a singly funded channel specified in the # request to a remote peer. Users are able to specify a target number of # blocks that the funding transaction should be confirmed in, or a manual fee @@ -196,7 +158,7 @@ module Lnrpc # arguments specified in the OpenChannelRequest, this pending channel ID can # then be used to manually progress the channel funding flow. rpc :OpenChannel, OpenChannelRequest, stream(OpenStatusUpdate) - # * + # # FundingStateStep is an advanced funding related call that allows the caller # to either execute some preparatory steps for a funding workflow, or # manually progress a funding workflow. The primary way a funding flow is @@ -206,14 +168,14 @@ module Lnrpc # Alternatively, this can be used to interactively drive PSBT signing for # funding for partially complete funding transactions. rpc :FundingStateStep, FundingTransitionMsg, FundingStateStepResp - # * + # # ChannelAcceptor dispatches a bi-directional streaming RPC in which # OpenChannel requests are sent to the client and the client responds with # a boolean that tells LND whether or not to accept the channel. This allows # node operators to specify their own criteria for accepting inbound channels # through a single persistent connection. rpc :ChannelAcceptor, stream(ChannelAcceptResponse), stream(ChannelAcceptRequest) - # * lncli: `closechannel` + # lncli: `closechannel` # CloseChannel attempts to close an active channel identified by its channel # outpoint (ChannelPoint). The actions of this method can additionally be # augmented to attempt a force close after a timeout period in the case of an @@ -222,41 +184,42 @@ module Lnrpc # closure transaction is confirmed, or a manual fee rate. If neither are # specified, then a default lax, block confirmation target is used. rpc :CloseChannel, CloseChannelRequest, stream(CloseStatusUpdate) - # * lncli: `abandonchannel` + # lncli: `abandonchannel` # AbandonChannel removes all channel state from the database except for a # close summary. This method can be used to get rid of permanently unusable # channels due to bugs fixed in newer versions of lnd. Only available # when in debug builds of lnd. rpc :AbandonChannel, AbandonChannelRequest, AbandonChannelResponse - # * lncli: `sendpayment` - # Deprecated, use routerrpc.SendPayment. SendPayment dispatches a + # lncli: `sendpayment` + # Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a # bi-directional streaming RPC for sending payments through the Lightning # Network. A single RPC invocation creates a persistent bi-directional # stream allowing clients to rapidly send payments through the Lightning # Network with a single persistent connection. rpc :SendPayment, stream(SendRequest), stream(SendResponse) - # * + # # SendPaymentSync is the synchronous non-streaming version of SendPayment. # This RPC is intended to be consumed by clients of the REST proxy. # Additionally, this RPC expects the destination's public key and the payment # hash (if any) to be encoded as hex strings. rpc :SendPaymentSync, SendRequest, SendResponse - # * lncli: `sendtoroute` - # SendToRoute is a bi-directional streaming RPC for sending payment through - # the Lightning Network. This method differs from SendPayment in that it - # allows users to specify a full route manually. This can be used for things - # like rebalancing, and atomic swaps. + # lncli: `sendtoroute` + # Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional + # streaming RPC for sending payment through the Lightning Network. This + # method differs from SendPayment in that it allows users to specify a full + # route manually. This can be used for things like rebalancing, and atomic + # swaps. rpc :SendToRoute, stream(SendToRouteRequest), stream(SendResponse) - # * + # # SendToRouteSync is a synchronous version of SendToRoute. It Will block # until the payment either fails or succeeds. rpc :SendToRouteSync, SendToRouteRequest, SendResponse - # * lncli: `addinvoice` + # lncli: `addinvoice` # AddInvoice attempts to add a new invoice to the invoice database. Any # duplicated invoices are rejected, therefore all invoices *must* have a # unique payment preimage. rpc :AddInvoice, Invoice, AddInvoiceResponse - # * lncli: `listinvoices` + # lncli: `listinvoices` # ListInvoices returns a list of all the invoices currently stored within the # database. Any active debug invoices are ignored. It has full support for # paginated responses, allowing users to query for specific invoices through @@ -265,12 +228,12 @@ module Lnrpc # next request. By default, the first 100 invoices created will be returned. # Backwards pagination is also supported through the Reversed flag. rpc :ListInvoices, ListInvoiceRequest, ListInvoiceResponse - # * lncli: `lookupinvoice` + # lncli: `lookupinvoice` # LookupInvoice attempts to look up an invoice according to its payment hash. # The passed payment hash *must* be exactly 32 bytes, if not, an error is # returned. rpc :LookupInvoice, PaymentHash, Invoice - # * + # # SubscribeInvoices returns a uni-directional stream (server -> client) for # notifying the client of newly added/settled invoices. The caller can # optionally specify the add_index and/or the settle_index. If the add_index @@ -281,18 +244,18 @@ module Lnrpc # of these fields can be set. If no fields are set, then we'll only send out # the latest add/settle events. rpc :SubscribeInvoices, InvoiceSubscription, stream(Invoice) - # * lncli: `decodepayreq` + # lncli: `decodepayreq` # DecodePayReq takes an encoded payment request string and attempts to decode # it, returning a full description of the conditions encoded within the # payment request. rpc :DecodePayReq, PayReqString, PayReq - # * lncli: `listpayments` + # lncli: `listpayments` # ListPayments returns a list of all outgoing payments. rpc :ListPayments, ListPaymentsRequest, ListPaymentsResponse - # * + # # DeleteAllPayments deletes all outgoing payments from DB. rpc :DeleteAllPayments, DeleteAllPaymentsRequest, DeleteAllPaymentsResponse - # * lncli: `describegraph` + # lncli: `describegraph` # DescribeGraph returns a description of the latest graph state from the # point of view of the node. The graph information is partitioned into two # components: all the nodes/vertexes, and all the edges that connect the @@ -300,36 +263,41 @@ module Lnrpc # the node directional specific routing policy which includes: the time lock # delta, fee information, etc. rpc :DescribeGraph, ChannelGraphRequest, ChannelGraph - # * lncli: `getnodemetrics` + # lncli: `getnodemetrics` # GetNodeMetrics returns node metrics calculated from the graph. Currently # the only supported metric is betweenness centrality of individual nodes. rpc :GetNodeMetrics, NodeMetricsRequest, NodeMetricsResponse - # * lncli: `getchaninfo` + # lncli: `getchaninfo` # GetChanInfo returns the latest authenticated network announcement for the # given channel identified by its channel ID: an 8-byte integer which # uniquely identifies the location of transaction's funding output within the # blockchain. rpc :GetChanInfo, ChanInfoRequest, ChannelEdge - # * lncli: `getnodeinfo` + # lncli: `getnodeinfo` # GetNodeInfo returns the latest advertised, aggregated, and authenticated # channel information for the specified node identified by its public key. rpc :GetNodeInfo, NodeInfoRequest, NodeInfo - # * lncli: `queryroutes` + # lncli: `queryroutes` # QueryRoutes attempts to query the daemon's Channel Router for a possible # route to a target destination capable of carrying a specific amount of # satoshis. The returned route contains the full details required to craft and # send an HTLC, also including the necessary information that should be # present within the Sphinx packet encapsulated within the HTLC. + # + # When using REST, the `dest_custom_records` map type can be set by appending + # `&dest_custom_records[]=` + # to the URL. Unfortunately this map type doesn't appear in the REST API + # documentation because of a bug in the grpc-gateway library. rpc :QueryRoutes, QueryRoutesRequest, QueryRoutesResponse - # * lncli: `getnetworkinfo` + # lncli: `getnetworkinfo` # GetNetworkInfo returns some basic stats about the known channel graph from # the point of view of the node. rpc :GetNetworkInfo, NetworkInfoRequest, NetworkInfo - # * lncli: `stop` + # lncli: `stop` # StopDaemon will send a shutdown request to the interrupt handler, triggering # a graceful shutdown of the daemon. rpc :StopDaemon, StopRequest, StopResponse - # * + # # SubscribeChannelGraph launches a streaming RPC that allows the caller to # receive notifications upon any changes to the channel graph topology from # the point of view of the responding node. Events notified include: new @@ -337,21 +305,21 @@ module Lnrpc # channels being advertised, updates in the routing policy for a directional # channel edge, and when channels are closed on-chain. rpc :SubscribeChannelGraph, GraphTopologySubscription, stream(GraphTopologyUpdate) - # * lncli: `debuglevel` + # lncli: `debuglevel` # DebugLevel allows a caller to programmatically set the logging verbosity of # lnd. The logging can be targeted according to a coarse daemon-wide logging # level, or in a granular fashion to specify the logging for a target # sub-system. rpc :DebugLevel, DebugLevelRequest, DebugLevelResponse - # * lncli: `feereport` + # lncli: `feereport` # FeeReport allows the caller to obtain a report detailing the current fee # schedule enforced by the node globally for each channel. rpc :FeeReport, FeeReportRequest, FeeReportResponse - # * lncli: `updatechanpolicy` + # lncli: `updatechanpolicy` # UpdateChannelPolicy allows the caller to update the fee schedule and # channel policies for all channels globally, or a particular channel. rpc :UpdateChannelPolicy, PolicyUpdateRequest, PolicyUpdateResponse - # * lncli: `fwdinghistory` + # lncli: `fwdinghistory` # ForwardingHistory allows the caller to query the htlcswitch for a record of # all HTLCs forwarded within the target time range, and integer offset # within that time range. If no time-range is specified, then the first chunk @@ -363,7 +331,7 @@ module Lnrpc # the index offset of the last entry. The index offset can be provided to the # request to allow the caller to skip a series of records. rpc :ForwardingHistory, ForwardingHistoryRequest, ForwardingHistoryResponse - # * lncli: `exportchanbackup` + # lncli: `exportchanbackup` # ExportChannelBackup attempts to return an encrypted static channel backup # for the target channel identified by it channel point. The backup is # encrypted with a key generated from the aezeed seed of the user. The @@ -371,25 +339,25 @@ module Lnrpc # method once lnd is running, or via the InitWallet and UnlockWallet methods # from the WalletUnlocker service. rpc :ExportChannelBackup, ExportChannelBackupRequest, ChannelBackup - # * + # # ExportAllChannelBackups returns static channel backups for all existing # channels known to lnd. A set of regular singular static channel backups for # each channel are returned. Additionally, a multi-channel backup is returned # as well, which contains a single encrypted blob containing the backups of # each channel. rpc :ExportAllChannelBackups, ChanBackupExportRequest, ChanBackupSnapshot - # * + # # VerifyChanBackup allows a caller to verify the integrity of a channel backup # snapshot. This method will accept either a packed Single or a packed Multi. # Specifying both will result in an error. rpc :VerifyChanBackup, ChanBackupSnapshot, VerifyChanBackupResponse - # * lncli: `restorechanbackup` + # lncli: `restorechanbackup` # RestoreChannelBackups accepts a set of singular channel backups, or a # single encrypted multi-chan backup and attempts to recover any funds # remaining within the channel. If we are able to unpack the backup, then the # new channel will be shown under listchannels, as well as pending channels. rpc :RestoreChannelBackups, RestoreChanBackupRequest, RestoreBackupResponse - # * + # # SubscribeChannelBackups allows a client to sub-subscribe to the most up to # date information concerning the state of all channel backups. Each time a # new channel is added, we return the new set of channels, along with a @@ -398,7 +366,7 @@ module Lnrpc # ups, but the updated set of encrypted multi-chan backups with the closed # channel(s) removed. rpc :SubscribeChannelBackups, ChannelBackupSubscription, stream(ChanBackupSnapshot) - # * lncli: `bakemacaroon` + # lncli: `bakemacaroon` # BakeMacaroon allows the creation of a new macaroon with custom read and # write permissions. No first-party caveats are added since this can be done # offline. diff --git a/lib/grpc_services/signrpc/signer_pb.rb b/lib/grpc_services/signrpc/signer_pb.rb new file mode 100644 index 0000000..8165123 --- /dev/null +++ b/lib/grpc_services/signrpc/signer_pb.rb @@ -0,0 +1,83 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: signrpc/signer.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("signrpc/signer.proto", :syntax => :proto3) do + add_message "signrpc.KeyLocator" do + optional :key_family, :int32, 1 + optional :key_index, :int32, 2 + end + add_message "signrpc.KeyDescriptor" do + optional :raw_key_bytes, :bytes, 1 + optional :key_loc, :message, 2, "signrpc.KeyLocator" + end + add_message "signrpc.TxOut" do + optional :value, :int64, 1 + optional :pk_script, :bytes, 2 + end + add_message "signrpc.SignDescriptor" do + optional :key_desc, :message, 1, "signrpc.KeyDescriptor" + optional :single_tweak, :bytes, 2 + optional :double_tweak, :bytes, 3 + optional :witness_script, :bytes, 4 + optional :output, :message, 5, "signrpc.TxOut" + optional :sighash, :uint32, 7 + optional :input_index, :int32, 8 + end + add_message "signrpc.SignReq" do + optional :raw_tx_bytes, :bytes, 1 + repeated :sign_descs, :message, 2, "signrpc.SignDescriptor" + end + add_message "signrpc.SignResp" do + repeated :raw_sigs, :bytes, 1 + end + add_message "signrpc.InputScript" do + repeated :witness, :bytes, 1 + optional :sig_script, :bytes, 2 + end + add_message "signrpc.InputScriptResp" do + repeated :input_scripts, :message, 1, "signrpc.InputScript" + end + add_message "signrpc.SignMessageReq" do + optional :msg, :bytes, 1 + optional :key_loc, :message, 2, "signrpc.KeyLocator" + end + add_message "signrpc.SignMessageResp" do + optional :signature, :bytes, 1 + end + add_message "signrpc.VerifyMessageReq" do + optional :msg, :bytes, 1 + optional :signature, :bytes, 2 + optional :pubkey, :bytes, 3 + end + add_message "signrpc.VerifyMessageResp" do + optional :valid, :bool, 1 + end + add_message "signrpc.SharedKeyRequest" do + optional :ephemeral_pubkey, :bytes, 1 + optional :key_loc, :message, 2, "signrpc.KeyLocator" + end + add_message "signrpc.SharedKeyResponse" do + optional :shared_key, :bytes, 1 + end + end +end + +module Signrpc + KeyLocator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.KeyLocator").msgclass + KeyDescriptor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.KeyDescriptor").msgclass + TxOut = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.TxOut").msgclass + SignDescriptor = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.SignDescriptor").msgclass + SignReq = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.SignReq").msgclass + SignResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.SignResp").msgclass + InputScript = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.InputScript").msgclass + InputScriptResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.InputScriptResp").msgclass + SignMessageReq = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.SignMessageReq").msgclass + SignMessageResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.SignMessageResp").msgclass + VerifyMessageReq = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.VerifyMessageReq").msgclass + VerifyMessageResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.VerifyMessageResp").msgclass + SharedKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.SharedKeyRequest").msgclass + SharedKeyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("signrpc.SharedKeyResponse").msgclass +end diff --git a/lib/grpc_services/signrpc/signer_services_pb.rb b/lib/grpc_services/signrpc/signer_services_pb.rb new file mode 100644 index 0000000..a8bc4e7 --- /dev/null +++ b/lib/grpc_services/signrpc/signer_services_pb.rb @@ -0,0 +1,68 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: signrpc/signer.proto for package 'signrpc' + +require 'grpc' +require 'signrpc/signer_pb' + +module Signrpc + module Signer + # Signer is a service that gives access to the signing functionality of the + # daemon's wallet. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'signrpc.Signer' + + # + # SignOutputRaw is a method that can be used to generated a signature for a + # set of inputs/outputs to a transaction. Each request specifies details + # concerning how the outputs should be signed, which keys they should be + # signed with, and also any optional tweaks. The return value is a fixed + # 64-byte signature (the same format as we use on the wire in Lightning). + # + # If we are unable to sign using the specified keys, then an error will be + # returned. + rpc :SignOutputRaw, SignReq, SignResp + # + # ComputeInputScript generates a complete InputIndex for the passed + # transaction with the signature as defined within the passed SignDescriptor. + # This method should be capable of generating the proper input script for + # both regular p2wkh output and p2wkh outputs nested within a regular p2sh + # output. + # + # Note that when using this method to sign inputs belonging to the wallet, + # the only items of the SignDescriptor that need to be populated are pkScript + # in the TxOut field, the value in that same field, and finally the input + # index. + rpc :ComputeInputScript, SignReq, InputScriptResp + # + # SignMessage signs a message with the key specified in the key locator. The + # returned signature is fixed-size LN wire format encoded. + # + # The main difference to SignMessage in the main RPC is that a specific key is + # used to sign the message instead of the node identity private key. + rpc :SignMessage, SignMessageReq, SignMessageResp + # + # VerifyMessage verifies a signature over a message using the public key + # provided. The signature must be fixed-size LN wire format encoded. + # + # The main difference to VerifyMessage in the main RPC is that the public key + # used to sign the message does not have to be a node known to the network. + rpc :VerifyMessage, VerifyMessageReq, VerifyMessageResp + # + # DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key + # derivation between the ephemeral public key in the request and the node's + # key specified in the key_loc parameter (or the node's identity private key + # if no key locator is specified): + # P_shared = privKeyNode * ephemeralPubkey + # The resulting shared public key is serialized in the compressed format and + # hashed with sha256, resulting in the final key length of 256bit. + rpc :DeriveSharedKey, SharedKeyRequest, SharedKeyResponse + end + + Stub = Service.rpc_stub_class + end +end diff --git a/lib/grpc_services/verrpc/verrpc_pb.rb b/lib/grpc_services/verrpc/verrpc_pb.rb new file mode 100644 index 0000000..474273f --- /dev/null +++ b/lib/grpc_services/verrpc/verrpc_pb.rb @@ -0,0 +1,27 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: verrpc/verrpc.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("verrpc/verrpc.proto", :syntax => :proto3) do + add_message "verrpc.VersionRequest" do + end + add_message "verrpc.Version" do + optional :commit, :string, 1 + optional :commit_hash, :string, 2 + optional :version, :string, 3 + optional :app_major, :uint32, 4 + optional :app_minor, :uint32, 5 + optional :app_patch, :uint32, 6 + optional :app_pre_release, :string, 7 + repeated :build_tags, :string, 8 + optional :go_version, :string, 9 + end + end +end + +module Verrpc + VersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("verrpc.VersionRequest").msgclass + Version = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("verrpc.Version").msgclass +end diff --git a/lib/grpc_services/verrpc/verrpc_services_pb.rb b/lib/grpc_services/verrpc/verrpc_services_pb.rb new file mode 100644 index 0000000..6642a60 --- /dev/null +++ b/lib/grpc_services/verrpc/verrpc_services_pb.rb @@ -0,0 +1,27 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: verrpc/verrpc.proto for package 'verrpc' + +require 'grpc' +require 'verrpc/verrpc_pb' + +module Verrpc + module Versioner + # Versioner is a service that can be used to get information about the version + # and build information of the running daemon. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'verrpc.Versioner' + + # lncli: `version` + # GetVersion returns the current version and build information of the running + # daemon. + rpc :GetVersion, VersionRequest, Version + end + + Stub = Service.rpc_stub_class + end +end diff --git a/lib/grpc_services/walletrpc/walletkit_pb.rb b/lib/grpc_services/walletrpc/walletkit_pb.rb new file mode 100644 index 0000000..61765a7 --- /dev/null +++ b/lib/grpc_services/walletrpc/walletkit_pb.rb @@ -0,0 +1,149 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: walletrpc/walletkit.proto + +require 'google/protobuf' + +require 'rpc_pb' +require 'signrpc/signer_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("walletrpc/walletkit.proto", :syntax => :proto3) do + add_message "walletrpc.ListUnspentRequest" do + optional :min_confs, :int32, 1 + optional :max_confs, :int32, 2 + end + add_message "walletrpc.ListUnspentResponse" do + repeated :utxos, :message, 1, "lnrpc.Utxo" + end + add_message "walletrpc.LeaseOutputRequest" do + optional :id, :bytes, 1 + optional :outpoint, :message, 2, "lnrpc.OutPoint" + end + add_message "walletrpc.LeaseOutputResponse" do + optional :expiration, :uint64, 1 + end + add_message "walletrpc.ReleaseOutputRequest" do + optional :id, :bytes, 1 + optional :outpoint, :message, 2, "lnrpc.OutPoint" + end + add_message "walletrpc.ReleaseOutputResponse" do + end + add_message "walletrpc.KeyReq" do + optional :key_finger_print, :int32, 1 + optional :key_family, :int32, 2 + end + add_message "walletrpc.AddrRequest" do + end + add_message "walletrpc.AddrResponse" do + optional :addr, :string, 1 + end + add_message "walletrpc.Transaction" do + optional :tx_hex, :bytes, 1 + optional :label, :string, 2 + end + add_message "walletrpc.PublishResponse" do + optional :publish_error, :string, 1 + end + add_message "walletrpc.SendOutputsRequest" do + optional :sat_per_kw, :int64, 1 + repeated :outputs, :message, 2, "signrpc.TxOut" + optional :label, :string, 3 + end + add_message "walletrpc.SendOutputsResponse" do + optional :raw_tx, :bytes, 1 + end + add_message "walletrpc.EstimateFeeRequest" do + optional :conf_target, :int32, 1 + end + add_message "walletrpc.EstimateFeeResponse" do + optional :sat_per_kw, :int64, 1 + end + add_message "walletrpc.PendingSweep" do + optional :outpoint, :message, 1, "lnrpc.OutPoint" + optional :witness_type, :enum, 2, "walletrpc.WitnessType" + optional :amount_sat, :uint32, 3 + optional :sat_per_byte, :uint32, 4 + optional :broadcast_attempts, :uint32, 5 + optional :next_broadcast_height, :uint32, 6 + optional :requested_conf_target, :uint32, 8 + optional :requested_sat_per_byte, :uint32, 9 + optional :force, :bool, 7 + end + add_message "walletrpc.PendingSweepsRequest" do + end + add_message "walletrpc.PendingSweepsResponse" do + repeated :pending_sweeps, :message, 1, "walletrpc.PendingSweep" + end + add_message "walletrpc.BumpFeeRequest" do + optional :outpoint, :message, 1, "lnrpc.OutPoint" + optional :target_conf, :uint32, 2 + optional :sat_per_byte, :uint32, 3 + optional :force, :bool, 4 + end + add_message "walletrpc.BumpFeeResponse" do + end + add_message "walletrpc.ListSweepsRequest" do + optional :verbose, :bool, 1 + end + add_message "walletrpc.ListSweepsResponse" do + oneof :sweeps do + optional :transaction_details, :message, 1, "lnrpc.TransactionDetails" + optional :transaction_ids, :message, 2, "walletrpc.ListSweepsResponse.TransactionIDs" + end + end + add_message "walletrpc.ListSweepsResponse.TransactionIDs" do + repeated :transaction_ids, :string, 1 + end + add_message "walletrpc.LabelTransactionRequest" do + optional :txid, :bytes, 1 + optional :label, :string, 2 + optional :overwrite, :bool, 3 + end + add_message "walletrpc.LabelTransactionResponse" do + end + add_enum "walletrpc.WitnessType" do + value :UNKNOWN_WITNESS, 0 + value :COMMITMENT_TIME_LOCK, 1 + value :COMMITMENT_NO_DELAY, 2 + value :COMMITMENT_REVOKE, 3 + value :HTLC_OFFERED_REVOKE, 4 + value :HTLC_ACCEPTED_REVOKE, 5 + value :HTLC_OFFERED_TIMEOUT_SECOND_LEVEL, 6 + value :HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL, 7 + value :HTLC_OFFERED_REMOTE_TIMEOUT, 8 + value :HTLC_ACCEPTED_REMOTE_SUCCESS, 9 + value :HTLC_SECOND_LEVEL_REVOKE, 10 + value :WITNESS_KEY_HASH, 11 + value :NESTED_WITNESS_KEY_HASH, 12 + value :COMMITMENT_ANCHOR, 13 + end + end +end + +module Walletrpc + ListUnspentRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ListUnspentRequest").msgclass + ListUnspentResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ListUnspentResponse").msgclass + LeaseOutputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.LeaseOutputRequest").msgclass + LeaseOutputResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.LeaseOutputResponse").msgclass + ReleaseOutputRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ReleaseOutputRequest").msgclass + ReleaseOutputResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ReleaseOutputResponse").msgclass + KeyReq = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.KeyReq").msgclass + AddrRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.AddrRequest").msgclass + AddrResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.AddrResponse").msgclass + Transaction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.Transaction").msgclass + PublishResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.PublishResponse").msgclass + SendOutputsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.SendOutputsRequest").msgclass + SendOutputsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.SendOutputsResponse").msgclass + EstimateFeeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.EstimateFeeRequest").msgclass + EstimateFeeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.EstimateFeeResponse").msgclass + PendingSweep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.PendingSweep").msgclass + PendingSweepsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.PendingSweepsRequest").msgclass + PendingSweepsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.PendingSweepsResponse").msgclass + BumpFeeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.BumpFeeRequest").msgclass + BumpFeeResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.BumpFeeResponse").msgclass + ListSweepsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ListSweepsRequest").msgclass + ListSweepsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ListSweepsResponse").msgclass + ListSweepsResponse::TransactionIDs = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ListSweepsResponse.TransactionIDs").msgclass + LabelTransactionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.LabelTransactionRequest").msgclass + LabelTransactionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.LabelTransactionResponse").msgclass + WitnessType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.WitnessType").enummodule +end diff --git a/lib/grpc_services/walletrpc/walletkit_services_pb.rb b/lib/grpc_services/walletrpc/walletkit_services_pb.rb new file mode 100644 index 0000000..f2fa243 --- /dev/null +++ b/lib/grpc_services/walletrpc/walletkit_services_pb.rb @@ -0,0 +1,115 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: walletrpc/walletkit.proto for package 'walletrpc' + +require 'grpc' +require 'walletrpc/walletkit_pb' + +module Walletrpc + module WalletKit + # WalletKit is a service that gives access to the core functionalities of the + # daemon's wallet. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'walletrpc.WalletKit' + + # + # ListUnspent returns a list of all utxos spendable by the wallet with a + # number of confirmations between the specified minimum and maximum. + rpc :ListUnspent, ListUnspentRequest, ListUnspentResponse + # + # LeaseOutput locks an output to the given ID, preventing it from being + # available for any future coin selection attempts. The absolute time of the + # lock's expiration is returned. The expiration of the lock can be extended by + # successive invocations of this RPC. Outputs can be unlocked before their + # expiration through `ReleaseOutput`. + rpc :LeaseOutput, LeaseOutputRequest, LeaseOutputResponse + # + # ReleaseOutput unlocks an output, allowing it to be available for coin + # selection if it remains unspent. The ID should match the one used to + # originally lock the output. + rpc :ReleaseOutput, ReleaseOutputRequest, ReleaseOutputResponse + # + # DeriveNextKey attempts to derive the *next* key within the key family + # (account in BIP43) specified. This method should return the next external + # child within this branch. + rpc :DeriveNextKey, KeyReq, Signrpc::KeyDescriptor + # + # DeriveKey attempts to derive an arbitrary key specified by the passed + # KeyLocator. + rpc :DeriveKey, Signrpc::KeyLocator, Signrpc::KeyDescriptor + # + # NextAddr returns the next unused address within the wallet. + rpc :NextAddr, AddrRequest, AddrResponse + # + # PublishTransaction attempts to publish the passed transaction to the + # network. Once this returns without an error, the wallet will continually + # attempt to re-broadcast the transaction on start up, until it enters the + # chain. + rpc :PublishTransaction, Transaction, PublishResponse + # + # SendOutputs is similar to the existing sendmany call in Bitcoind, and + # allows the caller to create a transaction that sends to several outputs at + # once. This is ideal when wanting to batch create a set of transactions. + rpc :SendOutputs, SendOutputsRequest, SendOutputsResponse + # + # EstimateFee attempts to query the internal fee estimator of the wallet to + # determine the fee (in sat/kw) to attach to a transaction in order to + # achieve the confirmation target. + rpc :EstimateFee, EstimateFeeRequest, EstimateFeeResponse + # + # PendingSweeps returns lists of on-chain outputs that lnd is currently + # attempting to sweep within its central batching engine. Outputs with similar + # fee rates are batched together in order to sweep them within a single + # transaction. + # + # NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to + # remain supported. This is an advanced API that depends on the internals of + # the UtxoSweeper, so things may change. + rpc :PendingSweeps, PendingSweepsRequest, PendingSweepsResponse + # + # BumpFee bumps the fee of an arbitrary input within a transaction. This RPC + # takes a different approach than bitcoind's bumpfee command. lnd has a + # central batching engine in which inputs with similar fee rates are batched + # together to save on transaction fees. Due to this, we cannot rely on + # bumping the fee on a specific transaction, since transactions can change at + # any point with the addition of new inputs. The list of inputs that + # currently exist within lnd's central batching engine can be retrieved + # through the PendingSweeps RPC. + # + # When bumping the fee of an input that currently exists within lnd's central + # batching engine, a higher fee transaction will be created that replaces the + # lower fee transaction through the Replace-By-Fee (RBF) policy. If it + # + # This RPC also serves useful when wanting to perform a Child-Pays-For-Parent + # (CPFP), where the child transaction pays for its parent's fee. This can be + # done by specifying an outpoint within the low fee transaction that is under + # the control of the wallet. + # + # The fee preference can be expressed either as a specific fee rate or a delta + # of blocks in which the output should be swept on-chain within. If a fee + # preference is not explicitly specified, then an error is returned. + # + # Note that this RPC currently doesn't perform any validation checks on the + # fee preference being provided. For now, the responsibility of ensuring that + # the new fee preference is sufficient is delegated to the user. + rpc :BumpFee, BumpFeeRequest, BumpFeeResponse + # + # ListSweeps returns a list of the sweep transactions our node has produced. + # Note that these sweeps may not be confirmed yet, as we record sweeps on + # broadcast, not confirmation. + rpc :ListSweeps, ListSweepsRequest, ListSweepsResponse + # + # LabelTransaction adds a label to a transaction. If the transaction already + # has a label the call will fail unless the overwrite bool is set. This will + # overwrite the exiting transaction label. Labels must not be empty, and + # cannot exceed 500 characters. + rpc :LabelTransaction, LabelTransactionRequest, LabelTransactionResponse + end + + Stub = Service.rpc_stub_class + end +end diff --git a/lib/grpc_services/walletunlocker_pb.rb b/lib/grpc_services/walletunlocker_pb.rb new file mode 100644 index 0000000..62827c2 --- /dev/null +++ b/lib/grpc_services/walletunlocker_pb.rb @@ -0,0 +1,51 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: walletunlocker.proto + +require 'google/protobuf' + +require 'rpc_pb' +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("walletunlocker.proto", :syntax => :proto3) do + add_message "lnrpc.GenSeedRequest" do + optional :aezeed_passphrase, :bytes, 1 + optional :seed_entropy, :bytes, 2 + end + add_message "lnrpc.GenSeedResponse" do + repeated :cipher_seed_mnemonic, :string, 1 + optional :enciphered_seed, :bytes, 2 + end + add_message "lnrpc.InitWalletRequest" do + optional :wallet_password, :bytes, 1 + repeated :cipher_seed_mnemonic, :string, 2 + optional :aezeed_passphrase, :bytes, 3 + optional :recovery_window, :int32, 4 + optional :channel_backups, :message, 5, "lnrpc.ChanBackupSnapshot" + end + add_message "lnrpc.InitWalletResponse" do + end + add_message "lnrpc.UnlockWalletRequest" do + optional :wallet_password, :bytes, 1 + optional :recovery_window, :int32, 2 + optional :channel_backups, :message, 3, "lnrpc.ChanBackupSnapshot" + end + add_message "lnrpc.UnlockWalletResponse" do + end + add_message "lnrpc.ChangePasswordRequest" do + optional :current_password, :bytes, 1 + optional :new_password, :bytes, 2 + end + add_message "lnrpc.ChangePasswordResponse" do + end + end +end + +module Lnrpc + GenSeedRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GenSeedRequest").msgclass + GenSeedResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GenSeedResponse").msgclass + InitWalletRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.InitWalletRequest").msgclass + InitWalletResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.InitWalletResponse").msgclass + UnlockWalletRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.UnlockWalletRequest").msgclass + UnlockWalletResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.UnlockWalletResponse").msgclass + ChangePasswordRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChangePasswordRequest").msgclass + ChangePasswordResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChangePasswordResponse").msgclass +end diff --git a/lib/grpc_services/walletunlocker_services_pb.rb b/lib/grpc_services/walletunlocker_services_pb.rb new file mode 100644 index 0000000..073f827 --- /dev/null +++ b/lib/grpc_services/walletunlocker_services_pb.rb @@ -0,0 +1,72 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: walletunlocker.proto for package 'lnrpc' + +require 'grpc' +require 'walletunlocker_pb' + +module Lnrpc + module WalletUnlocker + # + # Comments in this file will be directly parsed into the API + # Documentation as descriptions of the associated method, message, or field. + # These descriptions should go right above the definition of the object, and + # can be in either block or // comment format. + # + # An RPC method can be matched to an lncli command by placing a line in the + # beginning of the description in exactly the following format: + # lncli: `methodname` + # + # Failure to specify the exact name of the command will cause documentation + # generation to fail. + # + # More information on how exactly the gRPC documentation is generated from + # this proto file can be found here: + # https://github.com/lightninglabs/lightning-api + # + # WalletUnlocker is a service that is used to set up a wallet password for + # lnd at first startup, and unlock a previously set up wallet. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'lnrpc.WalletUnlocker' + + # + # GenSeed is the first method that should be used to instantiate a new lnd + # instance. This method allows a caller to generate a new aezeed cipher seed + # given an optional passphrase. If provided, the passphrase will be necessary + # to decrypt the cipherseed to expose the internal wallet seed. + # + # Once the cipherseed is obtained and verified by the user, the InitWallet + # method should be used to commit the newly generated seed, and create the + # wallet. + rpc :GenSeed, GenSeedRequest, GenSeedResponse + # + # InitWallet is used when lnd is starting up for the first time to fully + # initialize the daemon and its internal wallet. At the very least a wallet + # password must be provided. This will be used to encrypt sensitive material + # on disk. + # + # In the case of a recovery scenario, the user can also specify their aezeed + # mnemonic and passphrase. If set, then the daemon will use this prior state + # to initialize its internal wallet. + # + # Alternatively, this can be used along with the GenSeed RPC to obtain a + # seed, then present it to the user. Once it has been verified by the user, + # the seed can be fed into this RPC in order to commit the new wallet. + rpc :InitWallet, InitWalletRequest, InitWalletResponse + # lncli: `unlock` + # UnlockWallet is used at startup of lnd to provide a password to unlock + # the wallet database. + rpc :UnlockWallet, UnlockWalletRequest, UnlockWalletResponse + # lncli: `changepassword` + # ChangePassword changes the password of the encrypted wallet. This will + # automatically unlock the wallet database if successful. + rpc :ChangePassword, ChangePasswordRequest, ChangePasswordResponse + end + + Stub = Service.rpc_stub_class + end +end diff --git a/lib/grpc_services/watchtowerrpc/watchtower_pb.rb b/lib/grpc_services/watchtowerrpc/watchtower_pb.rb new file mode 100644 index 0000000..6eea13f --- /dev/null +++ b/lib/grpc_services/watchtowerrpc/watchtower_pb.rb @@ -0,0 +1,21 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: watchtowerrpc/watchtower.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("watchtowerrpc/watchtower.proto", :syntax => :proto3) do + add_message "watchtowerrpc.GetInfoRequest" do + end + add_message "watchtowerrpc.GetInfoResponse" do + optional :pubkey, :bytes, 1 + repeated :listeners, :string, 2 + repeated :uris, :string, 3 + end + end +end + +module Watchtowerrpc + GetInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("watchtowerrpc.GetInfoRequest").msgclass + GetInfoResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("watchtowerrpc.GetInfoResponse").msgclass +end diff --git a/lib/grpc_services/watchtowerrpc/watchtower_services_pb.rb b/lib/grpc_services/watchtowerrpc/watchtower_services_pb.rb new file mode 100644 index 0000000..b18afc9 --- /dev/null +++ b/lib/grpc_services/watchtowerrpc/watchtower_services_pb.rb @@ -0,0 +1,28 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: watchtowerrpc/watchtower.proto for package 'watchtowerrpc' + +require 'grpc' +require 'watchtowerrpc/watchtower_pb' + +module Watchtowerrpc + module Watchtower + # Watchtower is a service that grants access to the watchtower server + # functionality of the daemon. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'watchtowerrpc.Watchtower' + + # lncli: tower info + # GetInfo returns general information concerning the companion watchtower + # including its public key and URIs where the server is currently + # listening for clients. + rpc :GetInfo, GetInfoRequest, GetInfoResponse + end + + Stub = Service.rpc_stub_class + end +end diff --git a/lib/grpc_services/wtclientrpc/wtclient_pb.rb b/lib/grpc_services/wtclientrpc/wtclient_pb.rb new file mode 100644 index 0000000..be981fd --- /dev/null +++ b/lib/grpc_services/wtclientrpc/wtclient_pb.rb @@ -0,0 +1,75 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: wtclientrpc/wtclient.proto + +require 'google/protobuf' + +Google::Protobuf::DescriptorPool.generated_pool.build do + add_file("wtclientrpc/wtclient.proto", :syntax => :proto3) do + add_message "wtclientrpc.AddTowerRequest" do + optional :pubkey, :bytes, 1 + optional :address, :string, 2 + end + add_message "wtclientrpc.AddTowerResponse" do + end + add_message "wtclientrpc.RemoveTowerRequest" do + optional :pubkey, :bytes, 1 + optional :address, :string, 2 + end + add_message "wtclientrpc.RemoveTowerResponse" do + end + add_message "wtclientrpc.GetTowerInfoRequest" do + optional :pubkey, :bytes, 1 + optional :include_sessions, :bool, 2 + end + add_message "wtclientrpc.TowerSession" do + optional :num_backups, :uint32, 1 + optional :num_pending_backups, :uint32, 2 + optional :max_backups, :uint32, 3 + optional :sweep_sat_per_byte, :uint32, 4 + end + add_message "wtclientrpc.Tower" do + optional :pubkey, :bytes, 1 + repeated :addresses, :string, 2 + optional :active_session_candidate, :bool, 3 + optional :num_sessions, :uint32, 4 + repeated :sessions, :message, 5, "wtclientrpc.TowerSession" + end + add_message "wtclientrpc.ListTowersRequest" do + optional :include_sessions, :bool, 1 + end + add_message "wtclientrpc.ListTowersResponse" do + repeated :towers, :message, 1, "wtclientrpc.Tower" + end + add_message "wtclientrpc.StatsRequest" do + end + add_message "wtclientrpc.StatsResponse" do + optional :num_backups, :uint32, 1 + optional :num_pending_backups, :uint32, 2 + optional :num_failed_backups, :uint32, 3 + optional :num_sessions_acquired, :uint32, 4 + optional :num_sessions_exhausted, :uint32, 5 + end + add_message "wtclientrpc.PolicyRequest" do + end + add_message "wtclientrpc.PolicyResponse" do + optional :max_updates, :uint32, 1 + optional :sweep_sat_per_byte, :uint32, 2 + end + end +end + +module Wtclientrpc + AddTowerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.AddTowerRequest").msgclass + AddTowerResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.AddTowerResponse").msgclass + RemoveTowerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.RemoveTowerRequest").msgclass + RemoveTowerResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.RemoveTowerResponse").msgclass + GetTowerInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.GetTowerInfoRequest").msgclass + TowerSession = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.TowerSession").msgclass + Tower = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.Tower").msgclass + ListTowersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.ListTowersRequest").msgclass + ListTowersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.ListTowersResponse").msgclass + StatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.StatsRequest").msgclass + StatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.StatsResponse").msgclass + PolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.PolicyRequest").msgclass + PolicyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.PolicyResponse").msgclass +end diff --git a/lib/grpc_services/wtclientrpc/wtclient_services_pb.rb b/lib/grpc_services/wtclientrpc/wtclient_services_pb.rb new file mode 100644 index 0000000..54512f1 --- /dev/null +++ b/lib/grpc_services/wtclientrpc/wtclient_services_pb.rb @@ -0,0 +1,43 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: wtclientrpc/wtclient.proto for package 'wtclientrpc' + +require 'grpc' +require 'wtclientrpc/wtclient_pb' + +module Wtclientrpc + module WatchtowerClient + # WatchtowerClient is a service that grants access to the watchtower client + # functionality of the daemon. + class Service + + include GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'wtclientrpc.WatchtowerClient' + + # + # AddTower adds a new watchtower reachable at the given address and + # considers it for new sessions. If the watchtower already exists, then + # any new addresses included will be considered when dialing it for + # session negotiations and backups. + rpc :AddTower, AddTowerRequest, AddTowerResponse + # + # RemoveTower removes a watchtower from being considered for future session + # negotiations and from being used for any subsequent backups until it's added + # again. If an address is provided, then this RPC only serves as a way of + # removing the address from the watchtower instead. + rpc :RemoveTower, RemoveTowerRequest, RemoveTowerResponse + # ListTowers returns the list of watchtowers registered with the client. + rpc :ListTowers, ListTowersRequest, ListTowersResponse + # GetTowerInfo retrieves information for a registered watchtower. + rpc :GetTowerInfo, GetTowerInfoRequest, Tower + # Stats returns the in-memory statistics of the client since startup. + rpc :Stats, StatsRequest, StatsResponse + # Policy returns the active watchtower client policy configuration. + rpc :Policy, PolicyRequest, PolicyResponse + end + + Stub = Service.rpc_stub_class + end +end diff --git a/lib/lnrpc.rb b/lib/lnrpc.rb index 5e716d0..a411215 100644 --- a/lib/lnrpc.rb +++ b/lib/lnrpc.rb @@ -1,6 +1,10 @@ require 'lnrpc/version' -require 'lnrpc/rpc_services_pb' -require 'lnrpc/router_services_pb' + +# require GRPC services +Dir[File.join(File.expand_path(File.dirname(__FILE__)), 'grpc_services/**/*_services_pb.rb')].each do |file| + require file +end + require 'securerandom' module Lnrpc diff --git a/lib/lnrpc/client.rb b/lib/lnrpc/client.rb index 963b1da..366ef21 100644 --- a/lib/lnrpc/client.rb +++ b/lib/lnrpc/client.rb @@ -27,17 +27,47 @@ module Lnrpc end def lightning - @lightning ||= GrpcWrapper.new(Lnrpc::Lightning::Stub.new(address, - GRPC::Core::ChannelCredentials.new(credentials), - interceptors: [Lnrpc::MacaroonInterceptor.new(macaroon)] - )) + @lightning ||= grpc_wrapper_for(Lnrpc::Lightning) + end + + def autopilot + @autopilot ||= grpc_wrapper_for(Autopilotrpc::Autopilot) + end + + def chain_notifier + @chain_notifier ||= grpc_wrapper_for(Chainrpc::ChainNotifier) + end + + def invoices + @invoices ||= grpc_wrapper_for(Invoicesrpc::Invoices) end def router - @router ||= GrpcWrapper.new(Routerrpc::Router::Stub.new(address, - GRPC::Core::ChannelCredentials.new(credentials), - interceptors: [Lnrpc::MacaroonInterceptor.new(macaroon)] - )) + @router ||= grpc_wrapper_for(Routerrpc::Router) + end + + def signer + @signer ||= grpc_wrapper_for(Signrpc::Signer) + end + + def versioner + @versioner ||= grpc_wrapper_for(Verrpc::Versioner) + end + + def wallet_kit + @wallet_kit ||= grpc_wrapper_for(Walletrpc::WalletKit) + end + + def wallet_unlocker + @wallet_unlocker ||= grpc_wrapper_for(Lnrpc::WalletUnlocker) + end + + def watchtower + @watchtower ||= grpc_wrapper_for(Watchtowerrpc::Watchtower) + end + + def watchtower_client + @watchtower_client ||= grpc_wrapper_for(Wtclientrpc::WatchtowerClient) end def keysend(args) @@ -54,8 +84,19 @@ module Lnrpc end def inspect - "#{self.to_s} @address=\"#{self.address}\"" + "#{self} @address=\"#{address}\"" end + private + + def grpc_wrapper_for(grpc_module) + stub = grpc_module.const_get(:Stub) + service = grpc_module.const_get(:Service) + GrpcWrapper.new(service: service, + grpc: stub.new(address, + GRPC::Core::ChannelCredentials.new(credentials), + interceptors: [Lnrpc::MacaroonInterceptor.new(macaroon)] + )) + end end end diff --git a/lib/lnrpc/grpc_wrapper.rb b/lib/lnrpc/grpc_wrapper.rb index 97352ce..4e02032 100644 --- a/lib/lnrpc/grpc_wrapper.rb +++ b/lib/lnrpc/grpc_wrapper.rb @@ -1,66 +1,43 @@ module Lnrpc class GrpcWrapper - NON_CONVENTION_REQUEST_CLASSES = { - add_invoice: Lnrpc::Invoice, - decode_pay_req: Lnrpc::PayReqString, - describe_graph: Lnrpc::ChannelGraphRequest, - export_all_channel_backups: Lnrpc::ChanBackupExportRequest, - funding_state_step: Lnrpc::FundingTransitionMsg, - get_chan_info: Lnrpc::ChanInfoRequest, - get_network_info: Lnrpc::NetworkInfoRequest, - get_node_info: Lnrpc::NodeInfoRequest, - get_node_metrics: Lnrpc::NodeMetricsRequest, - lookup_invoice: Lnrpc::PaymentHash, - open_channel_sync: Lnrpc::OpenChannelRequest, - send_payment_sync: Lnrpc::SendRequest, - send_to_route_sync: Lnrpc::SendToRouteRequest, - stop_daemon: Lnrpc::StopRequest, - subscribe_channel_backups: Lnrpc::ChannelBackupSubscription, - subscribe_channel_event: Lnrpc::ChannelEventSubscription, - subscribe_channel_graph: Lnrpc::GraphTopologySubscription, - subscribe_invoices: Lnrpc::InvoiceSubscription, - subscribe_peer_event: Lnrpc::PeerEventSubscription, - subscribe_transactions: Lnrpc::GetTransactionsRequest, - update_channel_policy: Lnrpc::PolicyUpdateResponse, - varify_channel_backup: Lnrpc::ChanBackupSnapshot, + attr_reader :grpc, :service - estimate_route_fee: Routerrpc::RouteFeeRequest, - send_payment: Routerrpc::SendPaymentRequest, - send_payment_v2: Routerrpc::SendPaymentRequest, - track_payment_v2: Routerrpc::TrackPaymentRequest - } - - attr_reader :grpc - - def initialize(grpc) + def initialize(service:, grpc:) @grpc = grpc + @service = service end def method_missing(m, *args, &block) - if self.grpc.respond_to?(m) - params = args[0] + if grpc.respond_to?(m) + params = args[0] args[0] = params.nil? ? request_class_for(m).new : request_class_for(m).new(params) - self.grpc.send(m, *args, &block) + grpc.send(m, *args, &block) else super end end def inspect - "#{self.to_s} @grpc=\"#{self.grpc.to_s}\"" + "#{self} @grpc=\"#{grpc}\"" end private def request_class_for(method_name) - if NON_CONVENTION_REQUEST_CLASSES.key?(method_name.to_sym) - NON_CONVENTION_REQUEST_CLASSES[method_name.to_sym] - else - klass = method_name.to_s.sub(/^[a-z\d]*/) { |match| match.capitalize } - klass.gsub!(/(?:_|(\/))([a-z\d]*)/i) { "#{$1}#{$2.capitalize}" } - Module.const_get(grpc.class.name.to_s[/.+?(?=::)/]).const_get("#{klass}Request") + rpc_desc = service.rpc_descs[camelize(method_name).to_sym] + raise "Request class not found for: #{method_name}" unless rpc_desc + + rpc_desc.input + end + + def camelize(name) + str = name.to_s + separators = ['_', '\s'] + separators.each do |s| + str = str.gsub(/(?:#{s}+)([a-z])/) { $1.upcase } end + str.gsub(/(\A|\s)([a-z])/) { $1 + $2.upcase } end end end diff --git a/lib/lnrpc/router.proto b/lib/lnrpc/router.proto deleted file mode 100644 index 673ffb9..0000000 --- a/lib/lnrpc/router.proto +++ /dev/null @@ -1,560 +0,0 @@ -syntax = "proto3"; - -import "rpc.proto"; - -package routerrpc; - -option go_package = "github.com/lightningnetwork/lnd/lnrpc/routerrpc"; - -message SendPaymentRequest { - /// The identity pubkey of the payment recipient - bytes dest = 1; - - /** - Number of satoshis to send. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt = 2; - - /** - Number of millisatoshis to send. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt_msat = 12; - - /// The hash to use within the payment's HTLC - bytes payment_hash = 3; - - /** - The CLTV delta from the current height that should be used to set the - timelock for the final hop. - */ - int32 final_cltv_delta = 4; - - /** - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. The amount in the payment request may be zero. In - that case it is required to set the amt field as well. If no payment request - is specified, the following fields are required: dest, amt and payment_hash. - */ - string payment_request = 5; - - /** - An upper limit on the amount of time we should spend when attempting to - fulfill the payment. This is expressed in seconds. If we cannot make a - successful payment within this time frame, an error will be returned. - This field must be non-zero. - */ - int32 timeout_seconds = 6; - - /** - The maximum number of satoshis that will be paid as a fee of the payment. - If this field is left to the default value of 0, only zero-fee routes will - be considered. This usually means single hop routes connecting directly to - the destination. To send the payment without a fee limit, use max int here. - - The fields fee_limit_sat and fee_limit_msat are mutually exclusive. - */ - int64 fee_limit_sat = 7; - - /** - The maximum number of millisatoshis that will be paid as a fee of the - payment. If this field is left to the default value of 0, only zero-fee - routes will be considered. This usually means single hop routes connecting - directly to the destination. To send the payment without a fee limit, use - max int here. - - The fields fee_limit_sat and fee_limit_msat are mutually exclusive. - */ - int64 fee_limit_msat = 13; - - /** - The channel id of the channel that must be taken to the first hop. If zero, - any channel may be used. - */ - uint64 outgoing_chan_id = 8 [jstype = JS_STRING]; - - /** - The pubkey of the last hop of the route. If empty, any hop may be used. - */ - bytes last_hop_pubkey = 14; - - /** - An optional maximum total time lock for the route. This should not exceed - lnd's `--max-cltv-expiry` setting. If zero, then the value of - `--max-cltv-expiry` is enforced. - */ - int32 cltv_limit = 9; - - /** - Optional route hints to reach the destination through private channels. - */ - repeated lnrpc.RouteHint route_hints = 10; - - /** - An optional field that can be used to pass an arbitrary set of TLV records - to a peer which understands the new records. This can be used to pass - application specific data during the payment attempt. Record types are - required to be in the custom range >= 65536. When using REST, the values - must be encoded as base64. - */ - map dest_custom_records = 11; - - /// If set, circular payments to self are permitted. - bool allow_self_payment = 15; - - /** - Features assumed to be supported by the final node. All transitive feature - dependencies must also be set properly. For a given feature bit pair, either - optional or remote may be set, but not both. If this field is nil or empty, - the router will try to load destination features from the graph as a - fallback. - */ - repeated lnrpc.FeatureBit dest_features = 16; - - /** - The maximum number of partial payments that may be use to complete the full - amount. - */ - uint32 max_parts = 17; - - /** - If set, only the final payment update is streamed back. Intermediate updates - that show which htlcs are still in flight are suppressed. - */ - bool no_inflight_updates = 18; -} - -message TrackPaymentRequest { - /// The hash of the payment to look up. - bytes payment_hash = 1; - - /** - If set, only the final payment update is streamed back. Intermediate updates - that show which htlcs are still in flight are suppressed. - */ - bool no_inflight_updates = 2; -} - -message RouteFeeRequest { - /** - The destination once wishes to obtain a routing fee quote to. - */ - bytes dest = 1; - - /** - The amount one wishes to send to the target destination. - */ - int64 amt_sat = 2; -} - -message RouteFeeResponse { - /** - A lower bound of the estimated fee to the target destination within the - network, expressed in milli-satoshis. - */ - int64 routing_fee_msat = 1; - - /** - An estimate of the worst case time delay that can occur. Note that callers - will still need to factor in the final CLTV delta of the last hop into this - value. - */ - int64 time_lock_delay = 2; -} - -message SendToRouteRequest { - /// The payment hash to use for the HTLC. - bytes payment_hash = 1; - - /// Route that should be used to attempt to complete the payment. - lnrpc.Route route = 2; -} - -message SendToRouteResponse { - /// The preimage obtained by making the payment. - bytes preimage = 1; - - /// The failure message in case the payment failed. - lnrpc.Failure failure = 2; -} - -message ResetMissionControlRequest { -} - -message ResetMissionControlResponse { -} - -message QueryMissionControlRequest { -} - -/// QueryMissionControlResponse contains mission control state. -message QueryMissionControlResponse { - reserved 1; - - /// Node pair-level mission control state. - repeated PairHistory pairs = 2; -} - -/// PairHistory contains the mission control state for a particular node pair. -message PairHistory { - /// The source node pubkey of the pair. - bytes node_from = 1; - - /// The destination node pubkey of the pair. - bytes node_to = 2; - - reserved 3, 4, 5, 6; - - PairData history = 7; -} - -message PairData { - /// Time of last failure. - int64 fail_time = 1; - - /** - Lowest amount that failed to forward rounded to whole sats. This may be - set to zero if the failure is independent of amount. - */ - int64 fail_amt_sat = 2; - - /** - Lowest amount that failed to forward in millisats. This may be - set to zero if the failure is independent of amount. - */ - int64 fail_amt_msat = 4; - - reserved 3; - - /// Time of last success. - int64 success_time = 5; - - /// Highest amount that we could successfully forward rounded to whole sats. - int64 success_amt_sat = 6; - - /// Highest amount that we could successfully forward in millisats. - int64 success_amt_msat = 7; -} - -message QueryProbabilityRequest { - /// The source node pubkey of the pair. - bytes from_node = 1; - - /// The destination node pubkey of the pair. - bytes to_node = 2; - - /// The amount for which to calculate a probability. - int64 amt_msat = 3; -} - -message QueryProbabilityResponse { - /// The success probability for the requested pair. - double probability = 1; - - /// The historical data for the requested pair. - PairData history = 2; -} - -message BuildRouteRequest { - /** - The amount to send expressed in msat. If set to zero, the minimum routable - amount is used. - */ - int64 amt_msat = 1; - - /** - CLTV delta from the current height that should be used for the timelock - of the final hop - */ - int32 final_cltv_delta = 2; - - /** - The channel id of the channel that must be taken to the first hop. If zero, - any channel may be used. - */ - uint64 outgoing_chan_id = 3 [jstype = JS_STRING]; - - /** - A list of hops that defines the route. This does not include the source hop - pubkey. - */ - repeated bytes hop_pubkeys = 4; -} - -message BuildRouteResponse { - /** - Fully specified route that can be used to execute the payment. - */ - lnrpc.Route route = 1; -} - -message SubscribeHtlcEventsRequest { -} - -/** -HtlcEvent contains the htlc event that was processed. These are served on a -best-effort basis; events are not persisted, delivery is not guaranteed -(in the event of a crash in the switch, forward events may be lost) and -some events may be replayed upon restart. Events consumed from this package -should be de-duplicated by the htlc's unique combination of incoming and -outgoing channel id and htlc id. [EXPERIMENTAL] -*/ -message HtlcEvent { - /** - The short channel id that the incoming htlc arrived at our node on. This - value is zero for sends. - */ - uint64 incoming_channel_id = 1; - - /** - The short channel id that the outgoing htlc left our node on. This value - is zero for receives. - */ - uint64 outgoing_channel_id = 2; - - /** - Incoming id is the index of the incoming htlc in the incoming channel. - This value is zero for sends. - */ - uint64 incoming_htlc_id = 3; - - /** - Outgoing id is the index of the outgoing htlc in the outgoing channel. - This value is zero for receives. - */ - uint64 outgoing_htlc_id = 4; - - /** - The time in unix nanoseconds that the event occurred. - */ - uint64 timestamp_ns = 5; - - enum EventType { - UNKNOWN = 0; - SEND = 1; - RECEIVE = 2; - FORWARD = 3; - } - - /** - The event type indicates whether the htlc was part of a send, receive or - forward. - */ - EventType event_type = 6; - - oneof event { - ForwardEvent forward_event = 7; - ForwardFailEvent forward_fail_event = 8; - SettleEvent settle_event = 9; - LinkFailEvent link_fail_event = 10; - } -} - -message HtlcInfo { - // The timelock on the incoming htlc. - uint32 incoming_timelock = 1; - - // The timelock on the outgoing htlc. - uint32 outgoing_timelock = 2; - - // The amount of the incoming htlc. - uint64 incoming_amt_msat = 3; - - // The amount of the outgoing htlc. - uint64 outgoing_amt_msat = 4; -} - -message ForwardEvent { - // Info contains details about the htlc that was forwarded. - HtlcInfo info = 1; -} - -message ForwardFailEvent { -} - -message SettleEvent { -} - -message LinkFailEvent { - // Info contains details about the htlc that we failed. - HtlcInfo info = 1; - - // FailureCode is the BOLT error code for the failure. - lnrpc.Failure.FailureCode wire_failure = 2; - - /** - FailureDetail provides additional information about the reason for the - failure. This detail enriches the information provided by the wire message - and may be 'no detail' if the wire message requires no additional metadata. - */ - FailureDetail failure_detail = 3; - - // A string representation of the link failure. - string failure_string = 4; -} - -enum FailureDetail { - UNKNOWN = 0; - NO_DETAIL = 1; - ONION_DECODE = 2; - LINK_NOT_ELIGIBLE = 3; - ON_CHAIN_TIMEOUT = 4; - HTLC_EXCEEDS_MAX = 5; - INSUFFICIENT_BALANCE = 6; - INCOMPLETE_FORWARD = 7; - HTLC_ADD_FAILED = 8; - FORWARDS_DISABLED = 9; - INVOICE_CANCELED = 10; - INVOICE_UNDERPAID = 11; - INVOICE_EXPIRY_TOO_SOON = 12; - INVOICE_NOT_OPEN = 13; - MPP_INVOICE_TIMEOUT = 14; - ADDRESS_MISMATCH = 15; - SET_TOTAL_MISMATCH = 16; - SET_TOTAL_TOO_LOW = 17; - SET_OVERPAID = 18; - UNKNOWN_INVOICE = 19; - INVALID_KEYSEND = 20; - MPP_IN_PROGRESS = 21; - CIRCULAR_ROUTE = 22; -} - -enum PaymentState { - /** - Payment is still in flight. - */ - IN_FLIGHT = 0; - - /** - Payment completed successfully. - */ - SUCCEEDED = 1; - - /** - There are more routes to try, but the payment timeout was exceeded. - */ - FAILED_TIMEOUT = 2; - - /** - All possible routes were tried and failed permanently. Or were no - routes to the destination at all. - */ - FAILED_NO_ROUTE = 3; - - /** - A non-recoverable error has occured. - */ - FAILED_ERROR = 4; - - /** - Payment details incorrect (unknown hash, invalid amt or - invalid final cltv delta) - */ - FAILED_INCORRECT_PAYMENT_DETAILS = 5; - - /** - Insufficient local balance. - */ - FAILED_INSUFFICIENT_BALANCE = 6; -} - -message PaymentStatus { - /// Current state the payment is in. - PaymentState state = 1; - - /** - The pre-image of the payment when state is SUCCEEDED. - */ - bytes preimage = 2; - - reserved 3; - - /** - The HTLCs made in attempt to settle the payment [EXPERIMENTAL]. - */ - repeated lnrpc.HTLCAttempt htlcs = 4; -} - -service Router { - /** - SendPaymentV2 attempts to route a payment described by the passed - PaymentRequest to the final destination. The call returns a stream of - payment updates. - */ - rpc SendPaymentV2 (SendPaymentRequest) returns (stream lnrpc.Payment); - - /** - TrackPaymentV2 returns an update stream for the payment identified by the - payment hash. - */ - rpc TrackPaymentV2 (TrackPaymentRequest) returns (stream lnrpc.Payment); - - /** - EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it - may cost to send an HTLC to the target end destination. - */ - rpc EstimateRouteFee (RouteFeeRequest) returns (RouteFeeResponse); - - /** - SendToRoute attempts to make a payment via the specified route. This method - differs from SendPayment in that it allows users to specify a full route - manually. This can be used for things like rebalancing, and atomic swaps. - */ - rpc SendToRoute (SendToRouteRequest) returns (SendToRouteResponse); - - /** - ResetMissionControl clears all mission control state and starts with a clean - slate. - */ - rpc ResetMissionControl (ResetMissionControlRequest) - returns (ResetMissionControlResponse); - - /** - QueryMissionControl exposes the internal mission control state to callers. - It is a development feature. - */ - rpc QueryMissionControl (QueryMissionControlRequest) - returns (QueryMissionControlResponse); - - /** - QueryProbability returns the current success probability estimate for a - given node pair and amount. - */ - rpc QueryProbability (QueryProbabilityRequest) - returns (QueryProbabilityResponse); - - /** - BuildRoute builds a fully specified route based on a list of hop public - keys. It retrieves the relevant channel policies from the graph in order to - calculate the correct fees and time locks. - */ - rpc BuildRoute (BuildRouteRequest) returns (BuildRouteResponse); - - /** - SubscribeHtlcEvents creates a uni-directional stream from the server to - the client which delivers a stream of htlc events. - */ - rpc SubscribeHtlcEvents (SubscribeHtlcEventsRequest) - returns (stream HtlcEvent); - - /** - Deprecated, use SendPaymentV2. SendPayment attempts to route a payment - described by the passed PaymentRequest to the final destination. The call - returns a stream of payment status updates. - */ - rpc SendPayment(SendPaymentRequest) returns (stream PaymentStatus) { - option deprecated = true; - } - - /** - Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for - the payment identified by the payment hash. - */ - rpc TrackPayment(TrackPaymentRequest) returns (stream PaymentStatus) { - option deprecated = true; - } -} diff --git a/lib/lnrpc/router_pb.rb b/lib/lnrpc/router_pb.rb deleted file mode 100644 index f456bd6..0000000 --- a/lib/lnrpc/router_pb.rb +++ /dev/null @@ -1,198 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: router.proto - -require 'google/protobuf' - -require_relative 'rpc_pb' -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "routerrpc.SendPaymentRequest" do - optional :dest, :bytes, 1 - optional :amt, :int64, 2 - optional :amt_msat, :int64, 12 - optional :payment_hash, :bytes, 3 - optional :final_cltv_delta, :int32, 4 - optional :payment_request, :string, 5 - optional :timeout_seconds, :int32, 6 - optional :fee_limit_sat, :int64, 7 - optional :fee_limit_msat, :int64, 13 - optional :outgoing_chan_id, :uint64, 8 - optional :last_hop_pubkey, :bytes, 14 - optional :cltv_limit, :int32, 9 - repeated :route_hints, :message, 10, "lnrpc.RouteHint" - map :dest_custom_records, :uint64, :bytes, 11 - optional :allow_self_payment, :bool, 15 - repeated :dest_features, :enum, 16, "lnrpc.FeatureBit" - optional :max_parts, :uint32, 17 - optional :no_inflight_updates, :bool, 18 - end - add_message "routerrpc.TrackPaymentRequest" do - optional :payment_hash, :bytes, 1 - optional :no_inflight_updates, :bool, 2 - end - add_message "routerrpc.RouteFeeRequest" do - optional :dest, :bytes, 1 - optional :amt_sat, :int64, 2 - end - add_message "routerrpc.RouteFeeResponse" do - optional :routing_fee_msat, :int64, 1 - optional :time_lock_delay, :int64, 2 - end - add_message "routerrpc.SendToRouteRequest" do - optional :payment_hash, :bytes, 1 - optional :route, :message, 2, "lnrpc.Route" - end - add_message "routerrpc.SendToRouteResponse" do - optional :preimage, :bytes, 1 - optional :failure, :message, 2, "lnrpc.Failure" - end - add_message "routerrpc.ResetMissionControlRequest" do - end - add_message "routerrpc.ResetMissionControlResponse" do - end - add_message "routerrpc.QueryMissionControlRequest" do - end - add_message "routerrpc.QueryMissionControlResponse" do - repeated :pairs, :message, 2, "routerrpc.PairHistory" - end - add_message "routerrpc.PairHistory" do - optional :node_from, :bytes, 1 - optional :node_to, :bytes, 2 - optional :history, :message, 7, "routerrpc.PairData" - end - add_message "routerrpc.PairData" do - optional :fail_time, :int64, 1 - optional :fail_amt_sat, :int64, 2 - optional :fail_amt_msat, :int64, 4 - optional :success_time, :int64, 5 - optional :success_amt_sat, :int64, 6 - optional :success_amt_msat, :int64, 7 - end - add_message "routerrpc.QueryProbabilityRequest" do - optional :from_node, :bytes, 1 - optional :to_node, :bytes, 2 - optional :amt_msat, :int64, 3 - end - add_message "routerrpc.QueryProbabilityResponse" do - optional :probability, :double, 1 - optional :history, :message, 2, "routerrpc.PairData" - end - add_message "routerrpc.BuildRouteRequest" do - optional :amt_msat, :int64, 1 - optional :final_cltv_delta, :int32, 2 - optional :outgoing_chan_id, :uint64, 3 - repeated :hop_pubkeys, :bytes, 4 - end - add_message "routerrpc.BuildRouteResponse" do - optional :route, :message, 1, "lnrpc.Route" - end - add_message "routerrpc.SubscribeHtlcEventsRequest" do - end - add_message "routerrpc.HtlcEvent" do - optional :incoming_channel_id, :uint64, 1 - optional :outgoing_channel_id, :uint64, 2 - optional :incoming_htlc_id, :uint64, 3 - optional :outgoing_htlc_id, :uint64, 4 - optional :timestamp_ns, :uint64, 5 - optional :event_type, :enum, 6, "routerrpc.HtlcEvent.EventType" - oneof :event do - optional :forward_event, :message, 7, "routerrpc.ForwardEvent" - optional :forward_fail_event, :message, 8, "routerrpc.ForwardFailEvent" - optional :settle_event, :message, 9, "routerrpc.SettleEvent" - optional :link_fail_event, :message, 10, "routerrpc.LinkFailEvent" - end - end - add_enum "routerrpc.HtlcEvent.EventType" do - value :UNKNOWN, 0 - value :SEND, 1 - value :RECEIVE, 2 - value :FORWARD, 3 - end - add_message "routerrpc.HtlcInfo" do - optional :incoming_timelock, :uint32, 1 - optional :outgoing_timelock, :uint32, 2 - optional :incoming_amt_msat, :uint64, 3 - optional :outgoing_amt_msat, :uint64, 4 - end - add_message "routerrpc.ForwardEvent" do - optional :info, :message, 1, "routerrpc.HtlcInfo" - end - add_message "routerrpc.ForwardFailEvent" do - end - add_message "routerrpc.SettleEvent" do - end - add_message "routerrpc.LinkFailEvent" do - optional :info, :message, 1, "routerrpc.HtlcInfo" - optional :wire_failure, :enum, 2, "lnrpc.Failure.FailureCode" - optional :failure_detail, :enum, 3, "routerrpc.FailureDetail" - optional :failure_string, :string, 4 - end - add_message "routerrpc.PaymentStatus" do - optional :state, :enum, 1, "routerrpc.PaymentState" - optional :preimage, :bytes, 2 - repeated :htlcs, :message, 4, "lnrpc.HTLCAttempt" - end - add_enum "routerrpc.FailureDetail" do - value :UNKNOWN, 0 - value :NO_DETAIL, 1 - value :ONION_DECODE, 2 - value :LINK_NOT_ELIGIBLE, 3 - value :ON_CHAIN_TIMEOUT, 4 - value :HTLC_EXCEEDS_MAX, 5 - value :INSUFFICIENT_BALANCE, 6 - value :INCOMPLETE_FORWARD, 7 - value :HTLC_ADD_FAILED, 8 - value :FORWARDS_DISABLED, 9 - value :INVOICE_CANCELED, 10 - value :INVOICE_UNDERPAID, 11 - value :INVOICE_EXPIRY_TOO_SOON, 12 - value :INVOICE_NOT_OPEN, 13 - value :MPP_INVOICE_TIMEOUT, 14 - value :ADDRESS_MISMATCH, 15 - value :SET_TOTAL_MISMATCH, 16 - value :SET_TOTAL_TOO_LOW, 17 - value :SET_OVERPAID, 18 - value :UNKNOWN_INVOICE, 19 - value :INVALID_KEYSEND, 20 - value :MPP_IN_PROGRESS, 21 - value :CIRCULAR_ROUTE, 22 - end - add_enum "routerrpc.PaymentState" do - value :IN_FLIGHT, 0 - value :SUCCEEDED, 1 - value :FAILED_TIMEOUT, 2 - value :FAILED_NO_ROUTE, 3 - value :FAILED_ERROR, 4 - value :FAILED_INCORRECT_PAYMENT_DETAILS, 5 - value :FAILED_INSUFFICIENT_BALANCE, 6 - end -end - -module Routerrpc - SendPaymentRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SendPaymentRequest").msgclass - TrackPaymentRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.TrackPaymentRequest").msgclass - RouteFeeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.RouteFeeRequest").msgclass - RouteFeeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.RouteFeeResponse").msgclass - SendToRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SendToRouteRequest").msgclass - SendToRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SendToRouteResponse").msgclass - ResetMissionControlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ResetMissionControlRequest").msgclass - ResetMissionControlResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ResetMissionControlResponse").msgclass - QueryMissionControlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryMissionControlRequest").msgclass - QueryMissionControlResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryMissionControlResponse").msgclass - PairHistory = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PairHistory").msgclass - PairData = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PairData").msgclass - QueryProbabilityRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryProbabilityRequest").msgclass - QueryProbabilityResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.QueryProbabilityResponse").msgclass - BuildRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.BuildRouteRequest").msgclass - BuildRouteResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.BuildRouteResponse").msgclass - SubscribeHtlcEventsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SubscribeHtlcEventsRequest").msgclass - HtlcEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.HtlcEvent").msgclass - HtlcEvent::EventType = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.HtlcEvent.EventType").enummodule - HtlcInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.HtlcInfo").msgclass - ForwardEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ForwardEvent").msgclass - ForwardFailEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ForwardFailEvent").msgclass - SettleEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SettleEvent").msgclass - LinkFailEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.LinkFailEvent").msgclass - PaymentStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PaymentStatus").msgclass - FailureDetail = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.FailureDetail").enummodule - PaymentState = Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PaymentState").enummodule -end diff --git a/lib/lnrpc/rpc.proto b/lib/lnrpc/rpc.proto deleted file mode 100644 index 7f58e59..0000000 --- a/lib/lnrpc/rpc.proto +++ /dev/null @@ -1,3687 +0,0 @@ -syntax = "proto3"; - -import "google/api/annotations.proto"; - -package lnrpc; - -option go_package = "github.com/lightningnetwork/lnd/lnrpc"; - -/** - * Comments in this file will be directly parsed into the API - * Documentation as descriptions of the associated method, message, or field. - * These descriptions should go right above the definition of the object, and - * can be in either block or /// comment format. - * - * One edge case exists where a // comment followed by a /// comment in the - * next line will cause the description not to show up in the documentation. In - * that instance, simply separate the two comments with a blank line. - * - * An RPC method can be matched to an lncli command by placing a line in the - * beginning of the description in exactly the following format: - * lncli: `methodname` - * - * Failure to specify the exact name of the command will cause documentation - * generation to fail. - * - * More information on how exactly the gRPC documentation is generated from - * this proto file can be found here: - * https://github.com/lightninglabs/lightning-api - */ - -// The WalletUnlocker service is used to set up a wallet password for -// lnd at first startup, and unlock a previously set up wallet. -service WalletUnlocker { - /** - GenSeed is the first method that should be used to instantiate a new lnd - instance. This method allows a caller to generate a new aezeed cipher seed - given an optional passphrase. If provided, the passphrase will be necessary - to decrypt the cipherseed to expose the internal wallet seed. - - Once the cipherseed is obtained and verified by the user, the InitWallet - method should be used to commit the newly generated seed, and create the - wallet. - */ - rpc GenSeed (GenSeedRequest) returns (GenSeedResponse) { - option (google.api.http) = { - get: "/v1/genseed" - }; - } - - /** - InitWallet is used when lnd is starting up for the first time to fully - initialize the daemon and its internal wallet. At the very least a wallet - password must be provided. This will be used to encrypt sensitive material - on disk. - - In the case of a recovery scenario, the user can also specify their aezeed - mnemonic and passphrase. If set, then the daemon will use this prior state - to initialize its internal wallet. - - Alternatively, this can be used along with the GenSeed RPC to obtain a - seed, then present it to the user. Once it has been verified by the user, - the seed can be fed into this RPC in order to commit the new wallet. - */ - rpc InitWallet (InitWalletRequest) returns (InitWalletResponse) { - option (google.api.http) = { - post: "/v1/initwallet" - body: "*" - }; - } - - /** lncli: `unlock` - UnlockWallet is used at startup of lnd to provide a password to unlock - the wallet database. - */ - rpc UnlockWallet (UnlockWalletRequest) returns (UnlockWalletResponse) { - option (google.api.http) = { - post: "/v1/unlockwallet" - body: "*" - }; - } - - /** lncli: `changepassword` - ChangePassword changes the password of the encrypted wallet. This will - automatically unlock the wallet database if successful. - */ - rpc ChangePassword (ChangePasswordRequest) - returns (ChangePasswordResponse) { - option (google.api.http) = { - post: "/v1/changepassword" - body: "*" - }; - } -} - -message GenSeedRequest { - /** - aezeed_passphrase is an optional user provided passphrase that will be used - to encrypt the generated aezeed cipher seed. When using REST, this field - must be encoded as base64. - */ - bytes aezeed_passphrase = 1; - - /** - seed_entropy is an optional 16-bytes generated via CSPRNG. If not - specified, then a fresh set of randomness will be used to create the seed. - When using REST, this field must be encoded as base64. - */ - bytes seed_entropy = 2; -} -message GenSeedResponse { - /** - cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed - cipher seed obtained by the user. This field is optional, as if not - provided, then the daemon will generate a new cipher seed for the user. - Otherwise, then the daemon will attempt to recover the wallet state linked - to this cipher seed. - */ - repeated string cipher_seed_mnemonic = 1; - - /** - enciphered_seed are the raw aezeed cipher seed bytes. This is the raw - cipher text before run through our mnemonic encoding scheme. - */ - bytes enciphered_seed = 2; -} - -message InitWalletRequest { - /** - wallet_password is the passphrase that should be used to encrypt the - wallet. This MUST be at least 8 chars in length. After creation, this - password is required to unlock the daemon. When using REST, this field - must be encoded as base64. - */ - bytes wallet_password = 1; - - /** - cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed - cipher seed obtained by the user. This may have been generated by the - GenSeed method, or be an existing seed. - */ - repeated string cipher_seed_mnemonic = 2; - - /** - aezeed_passphrase is an optional user provided passphrase that will be used - to encrypt the generated aezeed cipher seed. When using REST, this field - must be encoded as base64. - */ - bytes aezeed_passphrase = 3; - - /** - recovery_window is an optional argument specifying the address lookahead - when restoring a wallet seed. The recovery window applies to each - individual branch of the BIP44 derivation paths. Supplying a recovery - window of zero indicates that no addresses should be recovered, such after - the first initialization of the wallet. - */ - int32 recovery_window = 4; - - /** - channel_backups is an optional argument that allows clients to recover the - settled funds within a set of channels. This should be populated if the - user was unable to close out all channels and sweep funds before partial or - total data loss occurred. If specified, then after on-chain recovery of - funds, lnd begin to carry out the data loss recovery protocol in order to - recover the funds in each channel from a remote force closed transaction. - */ - ChanBackupSnapshot channel_backups = 5; -} -message InitWalletResponse { -} - -message UnlockWalletRequest { - /** - wallet_password should be the current valid passphrase for the daemon. This - will be required to decrypt on-disk material that the daemon requires to - function properly. When using REST, this field must be encoded as base64. - */ - bytes wallet_password = 1; - - /** - recovery_window is an optional argument specifying the address lookahead - when restoring a wallet seed. The recovery window applies to each - individual branch of the BIP44 derivation paths. Supplying a recovery - window of zero indicates that no addresses should be recovered, such after - the first initialization of the wallet. - */ - int32 recovery_window = 2; - - /** - channel_backups is an optional argument that allows clients to recover the - settled funds within a set of channels. This should be populated if the - user was unable to close out all channels and sweep funds before partial or - total data loss occurred. If specified, then after on-chain recovery of - funds, lnd begin to carry out the data loss recovery protocol in order to - recover the funds in each channel from a remote force closed transaction. - */ - ChanBackupSnapshot channel_backups = 3; -} -message UnlockWalletResponse { -} - -message ChangePasswordRequest { - /** - current_password should be the current valid passphrase used to unlock the - daemon. When using REST, this field must be encoded as base64. - */ - bytes current_password = 1; - - /** - new_password should be the new passphrase that will be needed to unlock the - daemon. When using REST, this field must be encoded as base64. - */ - bytes new_password = 2; -} -message ChangePasswordResponse { -} - -service Lightning { - /** lncli: `walletbalance` - WalletBalance returns total unspent outputs(confirmed and unconfirmed), all - confirmed unspent outputs and all unconfirmed unspent outputs under control - of the wallet. - */ - rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse) { - option (google.api.http) = { - get: "/v1/balance/blockchain" - }; - } - - /** lncli: `channelbalance` - ChannelBalance returns the total funds available across all open channels - in satoshis. - */ - rpc ChannelBalance (ChannelBalanceRequest) - returns (ChannelBalanceResponse) { - option (google.api.http) = { - get: "/v1/balance/channels" - }; - } - - /** lncli: `listchaintxns` - GetTransactions returns a list describing all the known transactions - relevant to the wallet. - */ - rpc GetTransactions (GetTransactionsRequest) returns (TransactionDetails) { - option (google.api.http) = { - get: "/v1/transactions" - }; - } - - /** lncli: `estimatefee` - EstimateFee asks the chain backend to estimate the fee rate and total fees - for a transaction that pays to multiple specified outputs. - */ - rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse) { - option (google.api.http) = { - get: "/v1/transactions/fee" - }; - } - - /** lncli: `sendcoins` - SendCoins executes a request to send coins to a particular address. Unlike - SendMany, this RPC call only allows creating a single output at a time. If - neither target_conf, or sat_per_byte are set, then the internal wallet will - consult its fee model to determine a fee for the default confirmation - target. - */ - rpc SendCoins (SendCoinsRequest) returns (SendCoinsResponse) { - option (google.api.http) = { - post: "/v1/transactions" - body: "*" - }; - } - - /** lncli: `listunspent` - ListUnspent returns a list of all utxos spendable by the wallet with a - number of confirmations between the specified minimum and maximum. - */ - rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse) { - option (google.api.http) = { - get: "/v1/utxos" - }; - } - - /** - SubscribeTransactions creates a uni-directional stream from the server to - the client in which any newly discovered transactions relevant to the - wallet are sent over. - */ - rpc SubscribeTransactions (GetTransactionsRequest) - returns (stream Transaction); - - /** lncli: `sendmany` - SendMany handles a request for a transaction that creates multiple specified - outputs in parallel. If neither target_conf, or sat_per_byte are set, then - the internal wallet will consult its fee model to determine a fee for the - default confirmation target. - */ - rpc SendMany (SendManyRequest) returns (SendManyResponse); - - /** lncli: `newaddress` - NewAddress creates a new address under control of the local wallet. - */ - rpc NewAddress (NewAddressRequest) returns (NewAddressResponse) { - option (google.api.http) = { - get: "/v1/newaddress" - }; - } - - /** lncli: `signmessage` - SignMessage signs a message with this node's private key. The returned - signature string is `zbase32` encoded and pubkey recoverable, meaning that - only the message digest and signature are needed for verification. - */ - rpc SignMessage (SignMessageRequest) returns (SignMessageResponse) { - option (google.api.http) = { - post: "/v1/signmessage" - body: "*" - }; - } - - /** lncli: `verifymessage` - VerifyMessage verifies a signature over a msg. The signature must be - zbase32 encoded and signed by an active node in the resident node's - channel database. In addition to returning the validity of the signature, - VerifyMessage also returns the recovered pubkey from the signature. - */ - rpc VerifyMessage (VerifyMessageRequest) returns (VerifyMessageResponse) { - option (google.api.http) = { - post: "/v1/verifymessage" - body: "*" - }; - } - - /** lncli: `connect` - ConnectPeer attempts to establish a connection to a remote peer. This is at - the networking level, and is used for communication between nodes. This is - distinct from establishing a channel with a peer. - */ - rpc ConnectPeer (ConnectPeerRequest) returns (ConnectPeerResponse) { - option (google.api.http) = { - post: "/v1/peers" - body: "*" - }; - } - - /** lncli: `disconnect` - DisconnectPeer attempts to disconnect one peer from another identified by a - given pubKey. In the case that we currently have a pending or active channel - with the target peer, then this action will be not be allowed. - */ - rpc DisconnectPeer (DisconnectPeerRequest) - returns (DisconnectPeerResponse) { - option (google.api.http) = { - delete: "/v1/peers/{pub_key}" - }; - } - - /** lncli: `listpeers` - ListPeers returns a verbose listing of all currently active peers. - */ - rpc ListPeers (ListPeersRequest) returns (ListPeersResponse) { - option (google.api.http) = { - get: "/v1/peers" - }; - } - - /** - SubscribePeerEvents creates a uni-directional stream from the server to - the client in which any events relevant to the state of peers are sent - over. Events include peers going online and offline. - */ - rpc SubscribePeerEvents (PeerEventSubscription) returns (stream PeerEvent); - - /** lncli: `getinfo` - GetInfo returns general information concerning the lightning node including - it's identity pubkey, alias, the chains it is connected to, and information - concerning the number of open+pending channels. - */ - rpc GetInfo (GetInfoRequest) returns (GetInfoResponse) { - option (google.api.http) = { - get: "/v1/getinfo" - }; - } - - // TODO(roasbeef): merge with below with bool? - /** lncli: `pendingchannels` - PendingChannels returns a list of all the channels that are currently - considered "pending". A channel is pending if it has finished the funding - workflow and is waiting for confirmations for the funding txn, or is in the - process of closure, either initiated cooperatively or non-cooperatively. - */ - rpc PendingChannels (PendingChannelsRequest) - returns (PendingChannelsResponse) { - option (google.api.http) = { - get: "/v1/channels/pending" - }; - } - - /** lncli: `listchannels` - ListChannels returns a description of all the open channels that this node - is a participant in. - */ - rpc ListChannels (ListChannelsRequest) returns (ListChannelsResponse) { - option (google.api.http) = { - get: "/v1/channels" - }; - } - - /** - SubscribeChannelEvents creates a uni-directional stream from the server to - the client in which any updates relevant to the state of the channels are - sent over. Events include new active channels, inactive channels, and closed - channels. - */ - rpc SubscribeChannelEvents (ChannelEventSubscription) - returns (stream ChannelEventUpdate); - - /** lncli: `closedchannels` - ClosedChannels returns a description of all the closed channels that - this node was a participant in. - */ - rpc ClosedChannels (ClosedChannelsRequest) - returns (ClosedChannelsResponse) { - option (google.api.http) = { - get: "/v1/channels/closed" - }; - } - - /** - OpenChannelSync is a synchronous version of the OpenChannel RPC call. This - call is meant to be consumed by clients to the REST proxy. As with all - other sync calls, all byte slices are intended to be populated as hex - encoded strings. - */ - rpc OpenChannelSync (OpenChannelRequest) returns (ChannelPoint) { - option (google.api.http) = { - post: "/v1/channels" - body: "*" - }; - } - - /** lncli: `openchannel` - OpenChannel attempts to open a singly funded channel specified in the - request to a remote peer. Users are able to specify a target number of - blocks that the funding transaction should be confirmed in, or a manual fee - rate to us for the funding transaction. If neither are specified, then a - lax block confirmation target is used. Each OpenStatusUpdate will return - the pending channel ID of the in-progress channel. Depending on the - arguments specified in the OpenChannelRequest, this pending channel ID can - then be used to manually progress the channel funding flow. - */ - rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate); - - /** - FundingStateStep is an advanced funding related call that allows the caller - to either execute some preparatory steps for a funding workflow, or - manually progress a funding workflow. The primary way a funding flow is - identified is via its pending channel ID. As an example, this method can be - used to specify that we're expecting a funding flow for a particular - pending channel ID, for which we need to use specific parameters. - Alternatively, this can be used to interactively drive PSBT signing for - funding for partially complete funding transactions. - */ - rpc FundingStateStep (FundingTransitionMsg) returns (FundingStateStepResp); - - /** - ChannelAcceptor dispatches a bi-directional streaming RPC in which - OpenChannel requests are sent to the client and the client responds with - a boolean that tells LND whether or not to accept the channel. This allows - node operators to specify their own criteria for accepting inbound channels - through a single persistent connection. - */ - rpc ChannelAcceptor (stream ChannelAcceptResponse) - returns (stream ChannelAcceptRequest); - - /** lncli: `closechannel` - CloseChannel attempts to close an active channel identified by its channel - outpoint (ChannelPoint). The actions of this method can additionally be - augmented to attempt a force close after a timeout period in the case of an - inactive peer. If a non-force close (cooperative closure) is requested, - then the user can specify either a target number of blocks until the - closure transaction is confirmed, or a manual fee rate. If neither are - specified, then a default lax, block confirmation target is used. - */ - rpc CloseChannel (CloseChannelRequest) returns (stream CloseStatusUpdate) { - option (google.api.http) = { - delete: "/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}" - }; - } - - /** lncli: `abandonchannel` - AbandonChannel removes all channel state from the database except for a - close summary. This method can be used to get rid of permanently unusable - channels due to bugs fixed in newer versions of lnd. Only available - when in debug builds of lnd. - */ - rpc AbandonChannel (AbandonChannelRequest) - returns (AbandonChannelResponse) { - option (google.api.http) = { - delete: "/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}" - }; - } - - /** lncli: `sendpayment` - Deprecated, use routerrpc.SendPayment. SendPayment dispatches a - bi-directional streaming RPC for sending payments through the Lightning - Network. A single RPC invocation creates a persistent bi-directional - stream allowing clients to rapidly send payments through the Lightning - Network with a single persistent connection. - */ - rpc SendPayment (stream SendRequest) returns (stream SendResponse) { - option deprecated = true; - } - - /** - SendPaymentSync is the synchronous non-streaming version of SendPayment. - This RPC is intended to be consumed by clients of the REST proxy. - Additionally, this RPC expects the destination's public key and the payment - hash (if any) to be encoded as hex strings. - */ - rpc SendPaymentSync (SendRequest) returns (SendResponse) { - option (google.api.http) = { - post: "/v1/channels/transactions" - body: "*" - }; - } - - /** lncli: `sendtoroute` - SendToRoute is a bi-directional streaming RPC for sending payment through - the Lightning Network. This method differs from SendPayment in that it - allows users to specify a full route manually. This can be used for things - like rebalancing, and atomic swaps. - */ - rpc SendToRoute (stream SendToRouteRequest) returns (stream SendResponse); - - /** - SendToRouteSync is a synchronous version of SendToRoute. It Will block - until the payment either fails or succeeds. - */ - rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse) { - option (google.api.http) = { - post: "/v1/channels/transactions/route" - body: "*" - }; - } - - /** lncli: `addinvoice` - AddInvoice attempts to add a new invoice to the invoice database. Any - duplicated invoices are rejected, therefore all invoices *must* have a - unique payment preimage. - */ - rpc AddInvoice (Invoice) returns (AddInvoiceResponse) { - option (google.api.http) = { - post: "/v1/invoices" - body: "*" - }; - } - - /** lncli: `listinvoices` - ListInvoices returns a list of all the invoices currently stored within the - database. Any active debug invoices are ignored. It has full support for - paginated responses, allowing users to query for specific invoices through - their add_index. This can be done by using either the first_index_offset or - last_index_offset fields included in the response as the index_offset of the - next request. By default, the first 100 invoices created will be returned. - Backwards pagination is also supported through the Reversed flag. - */ - rpc ListInvoices (ListInvoiceRequest) returns (ListInvoiceResponse) { - option (google.api.http) = { - get: "/v1/invoices" - }; - } - - /** lncli: `lookupinvoice` - LookupInvoice attempts to look up an invoice according to its payment hash. - The passed payment hash *must* be exactly 32 bytes, if not, an error is - returned. - */ - rpc LookupInvoice (PaymentHash) returns (Invoice) { - option (google.api.http) = { - get: "/v1/invoice/{r_hash_str}" - }; - } - - /** - SubscribeInvoices returns a uni-directional stream (server -> client) for - notifying the client of newly added/settled invoices. The caller can - optionally specify the add_index and/or the settle_index. If the add_index - is specified, then we'll first start by sending add invoice events for all - invoices with an add_index greater than the specified value. If the - settle_index is specified, the next, we'll send out all settle events for - invoices with a settle_index greater than the specified value. One or both - of these fields can be set. If no fields are set, then we'll only send out - the latest add/settle events. - */ - rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice) { - option (google.api.http) = { - get: "/v1/invoices/subscribe" - }; - } - - /** lncli: `decodepayreq` - DecodePayReq takes an encoded payment request string and attempts to decode - it, returning a full description of the conditions encoded within the - payment request. - */ - rpc DecodePayReq (PayReqString) returns (PayReq) { - option (google.api.http) = { - get: "/v1/payreq/{pay_req}" - }; - } - - /** lncli: `listpayments` - ListPayments returns a list of all outgoing payments. - */ - rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse) { - option (google.api.http) = { - get: "/v1/payments" - }; - }; - - /** - DeleteAllPayments deletes all outgoing payments from DB. - */ - rpc DeleteAllPayments (DeleteAllPaymentsRequest) - returns (DeleteAllPaymentsResponse) { - option (google.api.http) = { - delete: "/v1/payments" - }; - }; - - /** lncli: `describegraph` - DescribeGraph returns a description of the latest graph state from the - point of view of the node. The graph information is partitioned into two - components: all the nodes/vertexes, and all the edges that connect the - vertexes themselves. As this is a directed graph, the edges also contain - the node directional specific routing policy which includes: the time lock - delta, fee information, etc. - */ - rpc DescribeGraph (ChannelGraphRequest) returns (ChannelGraph) { - option (google.api.http) = { - get: "/v1/graph" - }; - } - - /** lncli: `getnodemetrics` - GetNodeMetrics returns node metrics calculated from the graph. Currently - the only supported metric is betweenness centrality of individual nodes. - */ - rpc GetNodeMetrics (NodeMetricsRequest) returns (NodeMetricsResponse) { - option (google.api.http) = { - get: "/v1/graph/nodemetrics" - }; - } - - /** lncli: `getchaninfo` - GetChanInfo returns the latest authenticated network announcement for the - given channel identified by its channel ID: an 8-byte integer which - uniquely identifies the location of transaction's funding output within the - blockchain. - */ - rpc GetChanInfo (ChanInfoRequest) returns (ChannelEdge) { - option (google.api.http) = { - get: "/v1/graph/edge/{chan_id}" - }; - } - - /** lncli: `getnodeinfo` - GetNodeInfo returns the latest advertised, aggregated, and authenticated - channel information for the specified node identified by its public key. - */ - rpc GetNodeInfo (NodeInfoRequest) returns (NodeInfo) { - option (google.api.http) = { - get: "/v1/graph/node/{pub_key}" - }; - } - - /** lncli: `queryroutes` - QueryRoutes attempts to query the daemon's Channel Router for a possible - route to a target destination capable of carrying a specific amount of - satoshis. The returned route contains the full details required to craft and - send an HTLC, also including the necessary information that should be - present within the Sphinx packet encapsulated within the HTLC. - */ - rpc QueryRoutes (QueryRoutesRequest) returns (QueryRoutesResponse) { - option (google.api.http) = { - get: "/v1/graph/routes/{pub_key}/{amt}" - }; - } - - /** lncli: `getnetworkinfo` - GetNetworkInfo returns some basic stats about the known channel graph from - the point of view of the node. - */ - rpc GetNetworkInfo (NetworkInfoRequest) returns (NetworkInfo) { - option (google.api.http) = { - get: "/v1/graph/info" - }; - } - - /** lncli: `stop` - StopDaemon will send a shutdown request to the interrupt handler, triggering - a graceful shutdown of the daemon. - */ - rpc StopDaemon (StopRequest) returns (StopResponse); - - /** - SubscribeChannelGraph launches a streaming RPC that allows the caller to - receive notifications upon any changes to the channel graph topology from - the point of view of the responding node. Events notified include: new - nodes coming online, nodes updating their authenticated attributes, new - channels being advertised, updates in the routing policy for a directional - channel edge, and when channels are closed on-chain. - */ - rpc SubscribeChannelGraph (GraphTopologySubscription) - returns (stream GraphTopologyUpdate); - - /** lncli: `debuglevel` - DebugLevel allows a caller to programmatically set the logging verbosity of - lnd. The logging can be targeted according to a coarse daemon-wide logging - level, or in a granular fashion to specify the logging for a target - sub-system. - */ - rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse); - - /** lncli: `feereport` - FeeReport allows the caller to obtain a report detailing the current fee - schedule enforced by the node globally for each channel. - */ - rpc FeeReport (FeeReportRequest) returns (FeeReportResponse) { - option (google.api.http) = { - get: "/v1/fees" - }; - } - - /** lncli: `updatechanpolicy` - UpdateChannelPolicy allows the caller to update the fee schedule and - channel policies for all channels globally, or a particular channel. - */ - rpc UpdateChannelPolicy (PolicyUpdateRequest) - returns (PolicyUpdateResponse) { - option (google.api.http) = { - post: "/v1/chanpolicy" - body: "*" - }; - } - - /** lncli: `fwdinghistory` - ForwardingHistory allows the caller to query the htlcswitch for a record of - all HTLCs forwarded within the target time range, and integer offset - within that time range. If no time-range is specified, then the first chunk - of the past 24 hrs of forwarding history are returned. - - A list of forwarding events are returned. The size of each forwarding event - is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. - As a result each message can only contain 50k entries. Each response has - the index offset of the last entry. The index offset can be provided to the - request to allow the caller to skip a series of records. - */ - rpc ForwardingHistory (ForwardingHistoryRequest) - returns (ForwardingHistoryResponse) { - option (google.api.http) = { - post: "/v1/switch" - body: "*" - }; - }; - - /** lncli: `exportchanbackup` - ExportChannelBackup attempts to return an encrypted static channel backup - for the target channel identified by it channel point. The backup is - encrypted with a key generated from the aezeed seed of the user. The - returned backup can either be restored using the RestoreChannelBackup - method once lnd is running, or via the InitWallet and UnlockWallet methods - from the WalletUnlocker service. - */ - rpc ExportChannelBackup (ExportChannelBackupRequest) - returns (ChannelBackup) { - option (google.api.http) = { - get: "/v1/channels/backup/{chan_point.funding_txid_str}/{chan_point.output_index}" - }; - }; - - /** - ExportAllChannelBackups returns static channel backups for all existing - channels known to lnd. A set of regular singular static channel backups for - each channel are returned. Additionally, a multi-channel backup is returned - as well, which contains a single encrypted blob containing the backups of - each channel. - */ - rpc ExportAllChannelBackups (ChanBackupExportRequest) - returns (ChanBackupSnapshot) { - option (google.api.http) = { - get: "/v1/channels/backup" - }; - }; - - /** - VerifyChanBackup allows a caller to verify the integrity of a channel backup - snapshot. This method will accept either a packed Single or a packed Multi. - Specifying both will result in an error. - */ - rpc VerifyChanBackup (ChanBackupSnapshot) - returns (VerifyChanBackupResponse) { - option (google.api.http) = { - post: "/v1/channels/backup/verify" - body: "*" - }; - }; - - /** lncli: `restorechanbackup` - RestoreChannelBackups accepts a set of singular channel backups, or a - single encrypted multi-chan backup and attempts to recover any funds - remaining within the channel. If we are able to unpack the backup, then the - new channel will be shown under listchannels, as well as pending channels. - */ - rpc RestoreChannelBackups (RestoreChanBackupRequest) - returns (RestoreBackupResponse) { - option (google.api.http) = { - post: "/v1/channels/backup/restore" - body: "*" - }; - }; - - /** - SubscribeChannelBackups allows a client to sub-subscribe to the most up to - date information concerning the state of all channel backups. Each time a - new channel is added, we return the new set of channels, along with a - multi-chan backup containing the backup info for all channels. Each time a - channel is closed, we send a new update, which contains new new chan back - ups, but the updated set of encrypted multi-chan backups with the closed - channel(s) removed. - */ - rpc SubscribeChannelBackups (ChannelBackupSubscription) - returns (stream ChanBackupSnapshot) { - }; - - /** lncli: `bakemacaroon` - BakeMacaroon allows the creation of a new macaroon with custom read and - write permissions. No first-party caveats are added since this can be done - offline. - */ - rpc BakeMacaroon (BakeMacaroonRequest) returns (BakeMacaroonResponse) { - option (google.api.http) = { - post: "/v1/macaroon" - body: "*" - }; - }; -} - -message Utxo { - /// The type of address - AddressType address_type = 1; - - /// The address - string address = 2; - - /// The value of the unspent coin in satoshis - int64 amount_sat = 3; - - /// The pkscript in hex - string pk_script = 4; - - /// The outpoint in format txid:n - OutPoint outpoint = 5; - - /// The number of confirmations for the Utxo - int64 confirmations = 6; -} - -message Transaction { - /// The transaction hash - string tx_hash = 1; - - /// The transaction amount, denominated in satoshis - int64 amount = 2; - - /// The number of confirmations - int32 num_confirmations = 3; - - /// The hash of the block this transaction was included in - string block_hash = 4; - - /// The height of the block this transaction was included in - int32 block_height = 5; - - /// Timestamp of this transaction - int64 time_stamp = 6; - - /// Fees paid for this transaction - int64 total_fees = 7; - - /// Addresses that received funds for this transaction - repeated string dest_addresses = 8; - - /// The raw transaction hex. - string raw_tx_hex = 9; -} -message GetTransactionsRequest { -} -message TransactionDetails { - /// The list of transactions relevant to the wallet. - repeated Transaction transactions = 1; -} - -message FeeLimit { - oneof limit { - /** - The fee limit expressed as a fixed amount of satoshis. - - The fields fixed and fixed_msat are mutually exclusive. - */ - int64 fixed = 1; - - /** - The fee limit expressed as a fixed amount of millisatoshis. - - The fields fixed and fixed_msat are mutually exclusive. - */ - int64 fixed_msat = 3; - - /// The fee limit expressed as a percentage of the payment amount. - int64 percent = 2; - } -} - -message SendRequest { - /** - The identity pubkey of the payment recipient. When using REST, this field - must be encoded as base64. - */ - bytes dest = 1; - - /** - The hex-encoded identity pubkey of the payment recipient. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string dest_string = 2 [deprecated = true]; - - /** - The amount to send expressed in satoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt = 3; - - /** - The amount to send expressed in millisatoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt_msat = 12; - - /** - The hash to use within the payment's HTLC. When using REST, this field - must be encoded as base64. - */ - bytes payment_hash = 4; - - /** - The hex-encoded hash to use within the payment's HTLC. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string payment_hash_string = 5 [deprecated = true]; - - /** - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 6; - - /** - The CLTV delta from the current height that should be used to set the - timelock for the final hop. - */ - int32 final_cltv_delta = 7; - - /** - The maximum number of satoshis that will be paid as a fee of the payment. - This value can be represented either as a percentage of the amount being - sent, or as a fixed amount of the maximum fee the user is willing the pay to - send the payment. - */ - FeeLimit fee_limit = 8; - - /** - The channel id of the channel that must be taken to the first hop. If zero, - any channel may be used. - */ - uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; - - /** - The pubkey of the last hop of the route. If empty, any hop may be used. - */ - bytes last_hop_pubkey = 13; - - /** - An optional maximum total time lock for the route. This should not exceed - lnd's `--max-cltv-expiry` setting. If zero, then the value of - `--max-cltv-expiry` is enforced. - */ - uint32 cltv_limit = 10; - - /** - An optional field that can be used to pass an arbitrary set of TLV records - to a peer which understands the new records. This can be used to pass - application specific data during the payment attempt. Record types are - required to be in the custom range >= 65536. When using REST, the values - must be encoded as base64. - */ - map dest_custom_records = 11; - - /// If set, circular payments to self are permitted. - bool allow_self_payment = 14; - - /** - Features assumed to be supported by the final node. All transitive feature - dependencies must also be set properly. For a given feature bit pair, either - optional or remote may be set, but not both. If this field is nil or empty, - the router will try to load destination features from the graph as a - fallback. - */ - repeated FeatureBit dest_features = 15; -} - -message SendResponse { - string payment_error = 1; - bytes payment_preimage = 2; - Route payment_route = 3; - bytes payment_hash = 4; -} - -message SendToRouteRequest { - /** - The payment hash to use for the HTLC. When using REST, this field must be - encoded as base64. - */ - bytes payment_hash = 1; - - /** - An optional hex-encoded payment hash to be used for the HTLC. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string payment_hash_string = 2 [deprecated = true]; - - reserved 3; - - /// Route that should be used to attempt to complete the payment. - Route route = 4; -} - -message ChannelAcceptRequest { - /// The pubkey of the node that wishes to open an inbound channel. - bytes node_pubkey = 1; - - /// The hash of the genesis block that the proposed channel resides in. - bytes chain_hash = 2; - - /// The pending channel id. - bytes pending_chan_id = 3; - - /// The funding amount in satoshis that initiator wishes to use in the - /// channel. - uint64 funding_amt = 4; - - /// The push amount of the proposed channel in millisatoshis. - uint64 push_amt = 5; - - /// The dust limit of the initiator's commitment tx. - uint64 dust_limit = 6; - - /// The maximum amount of coins in millisatoshis that can be pending in this - /// channel. - uint64 max_value_in_flight = 7; - - /// The minimum amount of satoshis the initiator requires us to have at all - /// times. - uint64 channel_reserve = 8; - - /// The smallest HTLC in millisatoshis that the initiator will accept. - uint64 min_htlc = 9; - - /// The initial fee rate that the initiator suggests for both commitment - /// transactions. - uint64 fee_per_kw = 10; - - /** - The number of blocks to use for the relative time lock in the pay-to-self - output of both commitment transactions. - */ - uint32 csv_delay = 11; - - /// The total number of incoming HTLC's that the initiator will accept. - uint32 max_accepted_htlcs = 12; - - /// A bit-field which the initiator uses to specify proposed channel - /// behavior. - uint32 channel_flags = 13; -} - -message ChannelAcceptResponse { - /// Whether or not the client accepts the channel. - bool accept = 1; - - /// The pending channel id to which this response applies. - bytes pending_chan_id = 2; -} - -message ChannelPoint { - oneof funding_txid { - /** - Txid of the funding transaction. When using REST, this field must be - encoded as base64. - */ - bytes funding_txid_bytes = 1; - - /** - Hex-encoded string representing the byte-reversed hash of the funding - transaction. - */ - string funding_txid_str = 2; - } - - /// The index of the output of the funding transaction - uint32 output_index = 3; -} - -message OutPoint { - /// Raw bytes representing the transaction id. - bytes txid_bytes = 1; - - /// Reversed, hex-encoded string representing the transaction id. - string txid_str = 2; - - /// The index of the output on the transaction. - uint32 output_index = 3; -} - -message LightningAddress { - /// The identity pubkey of the Lightning node - string pubkey = 1; - - /// The network location of the lightning node, e.g. `69.69.69.69:1337` or - /// `localhost:10011` - string host = 2; -} - -message EstimateFeeRequest { - /// The map from addresses to amounts for the transaction. - map AddrToAmount = 1; - - /// The target number of blocks that this transaction should be confirmed - /// by. - int32 target_conf = 2; -} - -message EstimateFeeResponse { - /// The total fee in satoshis. - int64 fee_sat = 1; - - /// The fee rate in satoshi/byte. - int64 feerate_sat_per_byte = 2; -} - -message SendManyRequest { - /// The map from addresses to amounts - map AddrToAmount = 1; - - /// The target number of blocks that this transaction should be confirmed - /// by. - int32 target_conf = 3; - - /// A manual fee rate set in sat/byte that should be used when crafting the - /// transaction. - int64 sat_per_byte = 5; -} -message SendManyResponse { - /// The id of the transaction - string txid = 1; -} - -message SendCoinsRequest { - /// The address to send coins to - string addr = 1; - - /// The amount in satoshis to send - int64 amount = 2; - - /// The target number of blocks that this transaction should be confirmed - /// by. - int32 target_conf = 3; - - /// A manual fee rate set in sat/byte that should be used when crafting the - /// transaction. - int64 sat_per_byte = 5; - - /** - If set, then the amount field will be ignored, and lnd will attempt to - send all the coins under control of the internal wallet to the specified - address. - */ - bool send_all = 6; -} -message SendCoinsResponse { - /// The transaction ID of the transaction - string txid = 1; -} - -message ListUnspentRequest { - /// The minimum number of confirmations to be included. - int32 min_confs = 1; - - /// The maximum number of confirmations to be included. - int32 max_confs = 2; -} -message ListUnspentResponse { - /// A list of utxos - repeated Utxo utxos = 1; -} - -/** -`AddressType` has to be one of: - -- `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) -- `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) -*/ -enum AddressType { - WITNESS_PUBKEY_HASH = 0; - NESTED_PUBKEY_HASH = 1; - UNUSED_WITNESS_PUBKEY_HASH = 2; - UNUSED_NESTED_PUBKEY_HASH = 3; -} - -message NewAddressRequest { - /// The address type - AddressType type = 1; -} -message NewAddressResponse { - /// The newly generated wallet address - string address = 1; -} - -message SignMessageRequest { - /** - The message to be signed. When using REST, this field must be encoded as - base64. - */ - bytes msg = 1; -} -message SignMessageResponse { - /// The signature for the given message - string signature = 1; -} - -message VerifyMessageRequest { - /** - The message over which the signature is to be verified. When using REST, - this field must be encoded as base64. - */ - bytes msg = 1; - - /// The signature to be verified over the given message - string signature = 2; -} -message VerifyMessageResponse { - /// Whether the signature was valid over the given message - bool valid = 1; - - /// The pubkey recovered from the signature - string pubkey = 2; -} - -message ConnectPeerRequest { - /// Lightning address of the peer, in the format `@host` - LightningAddress addr = 1; - - /** If set, the daemon will attempt to persistently connect to the target - * peer. Otherwise, the call will be synchronous. */ - bool perm = 2; -} -message ConnectPeerResponse { -} - -message DisconnectPeerRequest { - /// The pubkey of the node to disconnect from - string pub_key = 1; -} -message DisconnectPeerResponse { -} - -message HTLC { - bool incoming = 1; - int64 amount = 2; - bytes hash_lock = 3; - uint32 expiration_height = 4; -} - -enum CommitmentType { - /** - A channel using the legacy commitment format having tweaked to_remote - keys. - */ - LEGACY = 0; - - /** - A channel that uses the modern commitment format where the key in the - output of the remote party does not change each state. This makes back - up and recovery easier as when the channel is closed, the funds go - directly to that key. - */ - STATIC_REMOTE_KEY = 1; - - /** - A channel that uses a commitment format that has anchor outputs on the - commitments, allowing fee bumping after a force close transaction has - been broadcast. - */ - ANCHORS = 2; - - /** - Returned when the commitment type isn't known or unavailable. - */ - UNKNOWN_COMMITMENT_TYPE = 999; -} - -message Channel { - /// Whether this channel is active or not - bool active = 1; - - /// The identity pubkey of the remote node - string remote_pubkey = 2; - - /** - The outpoint (txid:index) of the funding transaction. With this value, Bob - will be able to generate a signature for Alice's version of the commitment - transaction. - */ - string channel_point = 3; - - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 4 [jstype = JS_STRING]; - - /// The total amount of funds held in this channel - int64 capacity = 5; - - /// This node's current balance in this channel - int64 local_balance = 6; - - /// The counterparty's current balance in this channel - int64 remote_balance = 7; - - /** - The amount calculated to be paid in fees for the current set of commitment - transactions. The fee amount is persisted with the channel in order to - allow the fee amount to be removed and recalculated with each channel state - update, including updates that happen after a system restart. - */ - int64 commit_fee = 8; - - /// The weight of the commitment transaction - int64 commit_weight = 9; - - /** - The required number of satoshis per kilo-weight that the requester will pay - at all times, for both the funding transaction and commitment transaction. - This value can later be updated once the channel is open. - */ - int64 fee_per_kw = 10; - - /// The unsettled balance in this channel - int64 unsettled_balance = 11; - - /** - The total number of satoshis we've sent within this channel. - */ - int64 total_satoshis_sent = 12; - - /** - The total number of satoshis we've received within this channel. - */ - int64 total_satoshis_received = 13; - - /** - The total number of updates conducted within this channel. - */ - uint64 num_updates = 14; - - /** - The list of active, uncleared HTLCs currently pending within the channel. - */ - repeated HTLC pending_htlcs = 15; - - /** - The CSV delay expressed in relative blocks. If the channel is force closed, - we will need to wait for this many blocks before we can regain our funds. - */ - uint32 csv_delay = 16; - - /// Whether this channel is advertised to the network or not. - bool private = 17; - - /// True if we were the ones that created the channel. - bool initiator = 18; - - /// A set of flags showing the current state of the channel. - string chan_status_flags = 19; - - /// The minimum satoshis this node is required to reserve in its balance. - int64 local_chan_reserve_sat = 20; - - /** - The minimum satoshis the other node is required to reserve in its balance. - */ - int64 remote_chan_reserve_sat = 21; - - /// Deprecated. Use commitment_type. - bool static_remote_key = 22 [deprecated = true]; - - /// The commitment type used by this channel. - CommitmentType commitment_type = 26; - - /** - The number of seconds that the channel has been monitored by the channel - scoring system. Scores are currently not persisted, so this value may be - less than the lifetime of the channel [EXPERIMENTAL]. - */ - int64 lifetime = 23; - - /** - The number of seconds that the remote peer has been observed as being online - by the channel scoring system over the lifetime of the channel - [EXPERIMENTAL]. - */ - int64 uptime = 24; - - /** - Close address is the address that we will enforce payout to on cooperative - close if the channel was opened utilizing option upfront shutdown. This - value can be set on channel open by setting close_address in an open channel - request. If this value is not set, you can still choose a payout address by - cooperatively closing with the delivery_address field set. - */ - string close_address = 25; - - /* - The amount that the initiator of the channel optionally pushed to the remote - party on channel open. This amount will be zero if the channel initiator did - not push any funds to the remote peer. If the initiator field is true, we - pushed this amount to our peer, if it is false, the remote peer pushed this - amount to us. - */ - uint64 push_amount_sat = 27; - - /** - This uint32 indicates if this channel is to be considered 'frozen'. A - frozen channel doest not allow a cooperative channel close by the - initiator. The thaw_height is the height that this restriction stops - applying to the channel. This field is optional, not setting it or using a - value of zero will mean the channel has no additional restrictions. - */ - uint32 thaw_height = 28; -} - -message ListChannelsRequest { - bool active_only = 1; - bool inactive_only = 2; - bool public_only = 3; - bool private_only = 4; - - /** - Filters the response for channels with a target peer's pubkey. If peer is - empty, all channels will be returned. - */ - bytes peer = 5; -} -message ListChannelsResponse { - /// The list of active channels - repeated Channel channels = 11; -} - -enum Initiator { - INITIATOR_UNKNOWN = 0; - INITIATOR_LOCAL = 1; - INITIATOR_REMOTE = 2; - INITIATOR_BOTH = 3; -} - -message ChannelCloseSummary { - /// The outpoint (txid:index) of the funding transaction. - string channel_point = 1; - - /// The unique channel ID for the channel. - uint64 chan_id = 2 [jstype = JS_STRING]; - - /// The hash of the genesis block that this channel resides within. - string chain_hash = 3; - - /// The txid of the transaction which ultimately closed this channel. - string closing_tx_hash = 4; - - /// Public key of the remote peer that we formerly had a channel with. - string remote_pubkey = 5; - - /// Total capacity of the channel. - int64 capacity = 6; - - /// Height at which the funding transaction was spent. - uint32 close_height = 7; - - /// Settled balance at the time of channel closure - int64 settled_balance = 8; - - /// The sum of all the time-locked outputs at the time of channel closure - int64 time_locked_balance = 9; - - enum ClosureType { - COOPERATIVE_CLOSE = 0; - LOCAL_FORCE_CLOSE = 1; - REMOTE_FORCE_CLOSE = 2; - BREACH_CLOSE = 3; - FUNDING_CANCELED = 4; - ABANDONED = 5; - } - - /// Details on how the channel was closed. - ClosureType close_type = 10; - - /** - Open initiator is the party that initiated opening the channel. Note that - this value may be unknown if the channel was closed before we migrated to - store open channel information after close. - */ - Initiator open_initiator = 11; - - /** - Close initiator indicates which party initiated the close. This value will - be unknown for channels that were cooperatively closed before we started - tracking cooperative close initiators. Note that this indicates which party - initiated a close, and it is possible for both to initiate cooperative or - force closes, although only one party's close will be confirmed on chain. - */ - Initiator close_initiator = 12; -} - -message ClosedChannelsRequest { - bool cooperative = 1; - bool local_force = 2; - bool remote_force = 3; - bool breach = 4; - bool funding_canceled = 5; - bool abandoned = 6; -} - -message ClosedChannelsResponse { - repeated ChannelCloseSummary channels = 1; -} - -message Peer { - /// The identity pubkey of the peer - string pub_key = 1; - - /// Network address of the peer; eg `127.0.0.1:10011` - string address = 3; - - /// Bytes of data transmitted to this peer - uint64 bytes_sent = 4; - - /// Bytes of data transmitted from this peer - uint64 bytes_recv = 5; - - /// Satoshis sent to this peer - int64 sat_sent = 6; - - /// Satoshis received from this peer - int64 sat_recv = 7; - - /// A channel is inbound if the counterparty initiated the channel - bool inbound = 8; - - /// Ping time to this peer - int64 ping_time = 9; - - enum SyncType { - /** - Denotes that we cannot determine the peer's current sync type. - */ - UNKNOWN_SYNC = 0; - - /** - Denotes that we are actively receiving new graph updates from the peer. - */ - ACTIVE_SYNC = 1; - - /** - Denotes that we are not receiving new graph updates from the peer. - */ - PASSIVE_SYNC = 2; - } - - // The type of sync we are currently performing with this peer. - SyncType sync_type = 10; - - /// Features advertised by the remote peer in their init message. - map features = 11; - - /* - The latest errors received from our peer with timestamps, limited to the 10 - most recent errors. These errors are tracked across peer connections, but - are not persisted across lnd restarts. Note that these errors are only - stored for peers that we have channels open with, to prevent peers from - spamming us with errors at no cost. - */ - repeated TimestampedError errors = 12; -} - -message TimestampedError { - // The unix timestamp in seconds when the error occurred. - uint64 timestamp = 1; - - // The string representation of the error sent by our peer. - string error = 2; -} - -message ListPeersRequest { - /* - If true, only the last error that our peer sent us will be returned with - the peer's information, rather than the full set of historic errors we have - stored. - */ - bool latest_error = 1; -} -message ListPeersResponse { - /// The list of currently connected peers - repeated Peer peers = 1; -} - -message PeerEventSubscription { -} - -message PeerEvent { - /// The identity pubkey of the peer. - string pub_key = 1; - - enum EventType { - PEER_ONLINE = 0; - PEER_OFFLINE = 1; - } - - EventType type = 2; -} - -message GetInfoRequest { -} -message GetInfoResponse { - /// The version of the LND software that the node is running. - string version = 14; - - /// The SHA1 commit hash that the daemon is compiled with. - string commit_hash = 20; - - /// The identity pubkey of the current node. - string identity_pubkey = 1; - - /// If applicable, the alias of the current node, e.g. "bob" - string alias = 2; - - /// The color of the current node in hex code format - string color = 17; - - /// Number of pending channels - uint32 num_pending_channels = 3; - - /// Number of active channels - uint32 num_active_channels = 4; - - /// Number of inactive channels - uint32 num_inactive_channels = 15; - - /// Number of peers - uint32 num_peers = 5; - - /// The node's current view of the height of the best block - uint32 block_height = 6; - - /// The node's current view of the hash of the best block - string block_hash = 8; - - /// Timestamp of the block best known to the wallet - int64 best_header_timestamp = 13; - - /// Whether the wallet's view is synced to the main chain - bool synced_to_chain = 9; - - // Whether we consider ourselves synced with the public channel graph. - bool synced_to_graph = 18; - - /** - Whether the current node is connected to testnet. This field is - deprecated and the network field should be used instead - **/ - bool testnet = 10 [deprecated = true]; - - reserved 11; - - /// A list of active chains the node is connected to - repeated Chain chains = 16; - - /// The URIs of the current node. - repeated string uris = 12; - - /* - Features that our node has advertised in our init message, node - announcements and invoices. - */ - map features = 19; -} - -message Chain { - /// The blockchain the node is on (eg bitcoin, litecoin) - string chain = 1; - - /// The network the node is on (eg regtest, testnet, mainnet) - string network = 2; -} - -message ConfirmationUpdate { - bytes block_sha = 1; - int32 block_height = 2; - - uint32 num_confs_left = 3; -} - -message ChannelOpenUpdate { - ChannelPoint channel_point = 1; -} - -message ChannelCloseUpdate { - bytes closing_txid = 1; - - bool success = 2; -} - -message CloseChannelRequest { - /** - The outpoint (txid:index) of the funding transaction. With this value, Bob - will be able to generate a signature for Alice's version of the commitment - transaction. - */ - ChannelPoint channel_point = 1; - - /// If true, then the channel will be closed forcibly. This means the - /// current commitment transaction will be signed and broadcast. - bool force = 2; - - /// The target number of blocks that the closure transaction should be - /// confirmed by. - int32 target_conf = 3; - - /// A manual fee rate set in sat/byte that should be used when crafting the - /// closure transaction. - int64 sat_per_byte = 4; - - /* - An optional address to send funds to in the case of a cooperative close. - If the channel was opened with an upfront shutdown script and this field - is set, the request to close will fail because the channel must pay out - to the upfront shutdown addresss. - */ - string delivery_address = 5; -} - -message CloseStatusUpdate { - oneof update { - PendingUpdate close_pending = 1; - ChannelCloseUpdate chan_close = 3; - } -} - -message PendingUpdate { - bytes txid = 1; - uint32 output_index = 2; -} - -message ReadyForPsbtFunding { - /** - The P2WSH address of the channel funding multisig address that the below - specified amount in satoshis needs to be sent to. - */ - string funding_address = 1; - - /** - The exact amount in satoshis that needs to be sent to the above address to - fund the pending channel. - */ - int64 funding_amount = 2; - - /** - A raw PSBT that contains the pending channel output. If a base PSBT was - provided in the PsbtShim, this is the base PSBT with one additional output. - If no base PSBT was specified, this is an otherwise empty PSBT with exactly - one output. - */ - bytes psbt = 3; -} - -message OpenChannelRequest { - /** - The pubkey of the node to open a channel with. When using REST, this field - must be encoded as base64. - */ - bytes node_pubkey = 2; - - /** - The hex encoded pubkey of the node to open a channel with. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string node_pubkey_string = 3 [deprecated = true]; - - /// The number of satoshis the wallet should commit to the channel - int64 local_funding_amount = 4; - - /// The number of satoshis to push to the remote side as part of the initial - /// commitment state - int64 push_sat = 5; - - /// The target number of blocks that the funding transaction should be - /// confirmed by. - int32 target_conf = 6; - - /// A manual fee rate set in sat/byte that should be used when crafting the - /// funding transaction. - int64 sat_per_byte = 7; - - /// Whether this channel should be private, not announced to the greater - /// network. - bool private = 8; - - /// The minimum value in millisatoshi we will require for incoming HTLCs on - /// the channel. - int64 min_htlc_msat = 9; - - /// The delay we require on the remote's commitment transaction. If this is - /// not set, it will be scaled automatically with the channel size. - uint32 remote_csv_delay = 10; - - /// The minimum number of confirmations each one of your outputs used for - /// the funding transaction must satisfy. - int32 min_confs = 11; - - /// Whether unconfirmed outputs should be used as inputs for the funding - /// transaction. - bool spend_unconfirmed = 12; - - /* - Close address is an optional address which specifies the address to which - funds should be paid out to upon cooperative close. This field may only be - set if the peer supports the option upfront feature bit (call listpeers - to check). The remote peer will only accept cooperative closes to this - address if it is set. - - Note: If this value is set on channel creation, you will *not* be able to - cooperatively close out to a different address. - */ - string close_address = 13; - - /** - Funding shims are an optional argument that allow the caller to intercept - certain funding functionality. For example, a shim can be provided to use a - particular key for the commitment key (ideally cold) rather than use one - that is generated by the wallet as normal, or signal that signing will be - carried out in an interactive manner (PSBT based). - */ - FundingShim funding_shim = 14; -} -message OpenStatusUpdate { - oneof update { - /** - Signals that the channel is now fully negotiated and the funding - transaction published. - */ - PendingUpdate chan_pending = 1; - - /** - Signals that the channel's funding transaction has now reached the - required number of confirmations on chain and can be used. - */ - ChannelOpenUpdate chan_open = 3; - - /** - Signals that the funding process has been suspended and the construction - of a PSBT that funds the channel PK script is now required. - */ - ReadyForPsbtFunding psbt_fund = 5; - } - - /** - The pending channel ID of the created channel. This value may be used to - further the funding flow manually via the FundingStateStep method. - */ - bytes pending_chan_id = 4; -} - -message KeyLocator { - /// The family of key being identified. - int32 key_family = 1; - - /// The precise index of the key being identified. - int32 key_index = 2; -} - -message KeyDescriptor { - /** - The raw bytes of the key being identified. - */ - bytes raw_key_bytes = 1; - - /** - The key locator that identifies which key to use for signing. - */ - KeyLocator key_loc = 2; -} - -message ChanPointShim { - /** - The size of the pre-crafted output to be used as the channel point for this - channel funding. - */ - int64 amt = 1; - - /// The target channel point to refrence in created commitment transactions. - ChannelPoint chan_point = 2; - - /// Our local key to use when creating the multi-sig output. - KeyDescriptor local_key = 3; - - /// The key of the remote party to use when creating the multi-sig output. - bytes remote_key = 4; - - /** - If non-zero, then this will be used as the pending channel ID on the wire - protocol to initate the funding request. This is an optional field, and - should only be set if the responder is already expecting a specific pending - channel ID. - */ - bytes pending_chan_id = 5; - - /** - This uint32 indicates if this channel is to be considered 'frozen'. A - frozen channel does not allow a cooperative channel close by the - initiator. The thaw_height is the height that this restriction stops - applying to the channel. - */ - uint32 thaw_height = 6; -} - -message PsbtShim { - /** - A unique identifier of 32 random bytes that will be used as the pending - channel ID to identify the PSBT state machine when interacting with it and - on the wire protocol to initiate the funding request. - */ - bytes pending_chan_id = 1; - - /** - An optional base PSBT the new channel output will be added to. If this is - non-empty, it must be a binary serialized PSBT. - */ - bytes base_psbt = 2; -} - -message FundingShim { - oneof shim { - /** - A channel shim where the channel point was fully constructed outside - of lnd's wallet and the transaction might already be published. - */ - ChanPointShim chan_point_shim = 1; - - /** - A channel shim that uses a PSBT to fund and sign the channel funding - transaction. - */ - PsbtShim psbt_shim = 2; - } -} - -message FundingShimCancel { - /// The pending channel ID of the channel to cancel the funding shim for. - bytes pending_chan_id = 1; -} - -message FundingPsbtVerify { - /** - The funded but not yet signed PSBT that sends the exact channel capacity - amount to the PK script returned in the open channel message in a previous - step. - */ - bytes funded_psbt = 1; - - /// The pending channel ID of the channel to get the PSBT for. - bytes pending_chan_id = 2; -} - -message FundingPsbtFinalize { - /** - The funded PSBT that contains all witness data to send the exact channel - capacity amount to the PK script returned in the open channel message in a - previous step. - */ - bytes signed_psbt = 1; - - /// The pending channel ID of the channel to get the PSBT for. - bytes pending_chan_id = 2; -} - -message FundingTransitionMsg { - oneof trigger { - /** - The funding shim to register. This should be used before any - channel funding has began by the remote party, as it is intended as a - preparatory step for the full channel funding. - */ - FundingShim shim_register = 1; - - /// Used to cancel an existing registered funding shim. - FundingShimCancel shim_cancel = 2; - - /** - Used to continue a funding flow that was initiated to be executed - through a PSBT. This step verifies that the PSBT contains the correct - outputs to fund the channel. - */ - FundingPsbtVerify psbt_verify = 3; - - /** - Used to continue a funding flow that was initiated to be executed - through a PSBT. This step finalizes the funded and signed PSBT, finishes - negotiation with the peer and finally publishes the resulting funding - transaction. - */ - FundingPsbtFinalize psbt_finalize = 4; - } -} - -message FundingStateStepResp { -} - -message PendingHTLC { - /// The direction within the channel that the htlc was sent - bool incoming = 1; - - /// The total value of the htlc - int64 amount = 2; - - /// The final output to be swept back to the user's wallet - string outpoint = 3; - - /// The next block height at which we can spend the current stage - uint32 maturity_height = 4; - - /** - The number of blocks remaining until the current stage can be swept. - Negative values indicate how many blocks have passed since becoming - mature. - */ - int32 blocks_til_maturity = 5; - - /// Indicates whether the htlc is in its first or second stage of recovery - uint32 stage = 6; -} - -message PendingChannelsRequest { -} -message PendingChannelsResponse { - message PendingChannel { - string remote_node_pub = 1; - string channel_point = 2; - - int64 capacity = 3; - - int64 local_balance = 4; - int64 remote_balance = 5; - - /// The minimum satoshis this node is required to reserve in its - /// balance. - int64 local_chan_reserve_sat = 6; - - /** - The minimum satoshis the other node is required to reserve in its - balance. - */ - int64 remote_chan_reserve_sat = 7; - - // The party that initiated opening the channel. - Initiator initiator = 8; - - /// The commitment type used by this channel. - CommitmentType commitment_type = 9; - } - - message PendingOpenChannel { - /// The pending channel - PendingChannel channel = 1; - - /// The height at which this channel will be confirmed - uint32 confirmation_height = 2; - - /** - The amount calculated to be paid in fees for the current set of - commitment transactions. The fee amount is persisted with the channel - in order to allow the fee amount to be removed and recalculated with - each channel state update, including updates that happen after a system - restart. - */ - int64 commit_fee = 4; - - /// The weight of the commitment transaction - int64 commit_weight = 5; - - /** - The required number of satoshis per kilo-weight that the requester will - pay at all times, for both the funding transaction and commitment - transaction. This value can later be updated once the channel is open. - */ - int64 fee_per_kw = 6; - } - - message WaitingCloseChannel { - /// The pending channel waiting for closing tx to confirm - PendingChannel channel = 1; - - /// The balance in satoshis encumbered in this channel - int64 limbo_balance = 2; - - /** - A list of valid commitment transactions. Any of these can confirm at - this point. - */ - Commitments commitments = 3; - } - - message Commitments { - /// Hash of the local version of the commitment tx. - string local_txid = 1; - - /// Hash of the remote version of the commitment tx. - string remote_txid = 2; - - /// Hash of the remote pending version of the commitment tx. - string remote_pending_txid = 3; - - /* - The amount in satoshis calculated to be paid in fees for the local - commitment. - */ - uint64 local_commit_fee_sat = 4; - - /* - The amount in satoshis calculated to be paid in fees for the remote - commitment. - */ - uint64 remote_commit_fee_sat = 5; - - /* - The amount in satoshis calculated to be paid in fees for the remote - pending commitment. - */ - uint64 remote_pending_commit_fee_sat = 6; - } - - message ClosedChannel { - /// The pending channel to be closed - PendingChannel channel = 1; - - /// The transaction id of the closing transaction - string closing_txid = 2; - } - - message ForceClosedChannel { - /// The pending channel to be force closed - PendingChannel channel = 1; - - /// The transaction id of the closing transaction - string closing_txid = 2; - - /// The balance in satoshis encumbered in this pending channel - int64 limbo_balance = 3; - - /// The height at which funds can be swept into the wallet - uint32 maturity_height = 4; - - /* - Remaining # of blocks until the commitment output can be swept. - Negative values indicate how many blocks have passed since becoming - mature. - */ - int32 blocks_til_maturity = 5; - - /// The total value of funds successfully recovered from this channel - int64 recovered_balance = 6; - - repeated PendingHTLC pending_htlcs = 8; - - enum AnchorState { - LIMBO = 0; - RECOVERED = 1; - LOST = 2; - } - - AnchorState anchor = 9; - } - - /// The balance in satoshis encumbered in pending channels - int64 total_limbo_balance = 1; - - /// Channels pending opening - repeated PendingOpenChannel pending_open_channels = 2; - - /* - Deprecated: Channels pending closing previously contained cooperatively - closed channels with a single confirmation. These channels are now - considered closed from the time we see them on chain. - */ - repeated ClosedChannel pending_closing_channels = 3 [deprecated = true]; - - /// Channels pending force closing - repeated ForceClosedChannel pending_force_closing_channels = 4; - - /// Channels waiting for closing tx to confirm - repeated WaitingCloseChannel waiting_close_channels = 5; -} - -message ChannelEventSubscription { -} - -message ChannelEventUpdate { - oneof channel { - Channel open_channel = 1; - ChannelCloseSummary closed_channel = 2; - ChannelPoint active_channel = 3; - ChannelPoint inactive_channel = 4; - PendingUpdate pending_open_channel = 6; - } - - enum UpdateType { - OPEN_CHANNEL = 0; - CLOSED_CHANNEL = 1; - ACTIVE_CHANNEL = 2; - INACTIVE_CHANNEL = 3; - PENDING_OPEN_CHANNEL = 4; - } - - UpdateType type = 5; -} - -message WalletBalanceRequest { -} -message WalletBalanceResponse { - /// The balance of the wallet - int64 total_balance = 1; - - /// The confirmed balance of a wallet(with >= 1 confirmations) - int64 confirmed_balance = 2; - - /// The unconfirmed balance of a wallet(with 0 confirmations) - int64 unconfirmed_balance = 3; -} - -message ChannelBalanceRequest { -} -message ChannelBalanceResponse { - /// Sum of channels balances denominated in satoshis - int64 balance = 1; - - /// Sum of channels pending balances denominated in satoshis - int64 pending_open_balance = 2; -} - -message QueryRoutesRequest { - /// The 33-byte hex-encoded public key for the payment destination - string pub_key = 1; - - /** - The amount to send expressed in satoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt = 2; - - /** - The amount to send expressed in millisatoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt_msat = 12; - - reserved 3; - - /** - An optional CLTV delta from the current height that should be used for the - timelock of the final hop. Note that unlike SendPayment, QueryRoutes does - not add any additional block padding on top of final_ctlv_delta. This - padding of a few blocks needs to be added manually or otherwise failures may - happen when a block comes in while the payment is in flight. - */ - int32 final_cltv_delta = 4; - - /** - The maximum number of satoshis that will be paid as a fee of the payment. - This value can be represented either as a percentage of the amount being - sent, or as a fixed amount of the maximum fee the user is willing the pay to - send the payment. - */ - FeeLimit fee_limit = 5; - - /** - A list of nodes to ignore during path finding. When using REST, these fields - must be encoded as base64. - */ - repeated bytes ignored_nodes = 6; - - /** - Deprecated. A list of edges to ignore during path finding. - */ - repeated EdgeLocator ignored_edges = 7 [deprecated = true]; - - /** - The source node where the request route should originated from. If empty, - self is assumed. - */ - string source_pub_key = 8; - - /** - If set to true, edge probabilities from mission control will be used to get - the optimal route. - */ - bool use_mission_control = 9; - - /** - A list of directed node pairs that will be ignored during path finding. - */ - repeated NodePair ignored_pairs = 10; - - /** - An optional maximum total time lock for the route. If the source is empty or - ourselves, this should not exceed lnd's `--max-cltv-expiry` setting. If - zero, then the value of `--max-cltv-expiry` is used as the limit. - */ - uint32 cltv_limit = 11; - - /** - An optional field that can be used to pass an arbitrary set of TLV records - to a peer which understands the new records. This can be used to pass - application specific data during the payment attempt. If the destination - does not support the specified recrods, and error will be returned. - Record types are required to be in the custom range >= 65536. When using - REST, the values must be encoded as base64. - */ - map dest_custom_records = 13; - - /** - The channel id of the channel that must be taken to the first hop. If zero, - any channel may be used. - */ - uint64 outgoing_chan_id = 14 [jstype = JS_STRING]; - - /** - The pubkey of the last hop of the route. If empty, any hop may be used. - */ - bytes last_hop_pubkey = 15; - - /** - Optional route hints to reach the destination through private channels. - */ - repeated lnrpc.RouteHint route_hints = 16; - - /** - Features assumed to be supported by the final node. All transitive feature - dependencies must also be set properly. For a given feature bit pair, either - optional or remote may be set, but not both. If this field is nil or empty, - the router will try to load destination features from the graph as a - fallback. - */ - repeated lnrpc.FeatureBit dest_features = 17; -} - -message NodePair { - /** - The sending node of the pair. When using REST, this field must be encoded as - base64. - */ - bytes from = 1; - - /** - The receiving node of the pair. When using REST, this field must be encoded - as base64. - */ - bytes to = 2; -} - -message EdgeLocator { - /// The short channel id of this edge. - uint64 channel_id = 1 [jstype = JS_STRING]; - - /** - The direction of this edge. If direction_reverse is false, the direction - of this edge is from the channel endpoint with the lexicographically smaller - pub key to the endpoint with the larger pub key. If direction_reverse is - is true, the edge goes the other way. - */ - bool direction_reverse = 2; -} - -message QueryRoutesResponse { - /** - The route that results from the path finding operation. This is still a - repeated field to retain backwards compatibility. - */ - repeated Route routes = 1; - - /** - The success probability of the returned route based on the current mission - control state. [EXPERIMENTAL] - */ - double success_prob = 2; -} - -message Hop { - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; - int64 chan_capacity = 2; - int64 amt_to_forward = 3 [deprecated = true]; - int64 fee = 4 [deprecated = true]; - uint32 expiry = 5; - int64 amt_to_forward_msat = 6; - int64 fee_msat = 7; - - /** - An optional public key of the hop. If the public key is given, the payment - can be executed without relying on a copy of the channel graph. - */ - string pub_key = 8; - - /** - If set to true, then this hop will be encoded using the new variable length - TLV format. Note that if any custom tlv_records below are specified, then - this field MUST be set to true for them to be encoded properly. - */ - bool tlv_payload = 9; - - /** - An optional TLV record that signals the use of an MPP payment. If present, - the receiver will enforce that that the same mpp_record is included in the - final hop payload of all non-zero payments in the HTLC set. If empty, a - regular single-shot payment is or was attempted. - */ - MPPRecord mpp_record = 10; - - /** - An optional set of key-value TLV records. This is useful within the context - of the SendToRoute call as it allows callers to specify arbitrary K-V pairs - to drop off at each hop within the onion. - */ - map custom_records = 11; -} - -message MPPRecord { - /** - A unique, random identifier used to authenticate the sender as the intended - payer of a multi-path payment. The payment_addr must be the same for all - subpayments, and match the payment_addr provided in the receiver's invoice. - The same payment_addr must be used on all subpayments. - */ - bytes payment_addr = 11; - - /** - The total amount in milli-satoshis being sent as part of a larger multi-path - payment. The caller is responsible for ensuring subpayments to the same node - and payment_hash sum exactly to total_amt_msat. The same - total_amt_msat must be used on all subpayments. - */ - int64 total_amt_msat = 10; -} - -/** -A path through the channel graph which runs over one or more channels in -succession. This struct carries all the information required to craft the -Sphinx onion packet, and send the payment along the first hop in the path. A -route is only selected as valid if all the channels have sufficient capacity to -carry the initial payment amount after fees are accounted for. -*/ -message Route { - /** - The cumulative (final) time lock across the entire route. This is the CLTV - value that should be extended to the first hop in the route. All other hops - will decrement the time-lock as advertised, leaving enough time for all - hops to wait for or present the payment preimage to complete the payment. - */ - uint32 total_time_lock = 1; - - /** - The sum of the fees paid at each hop within the final route. In the case - of a one-hop payment, this value will be zero as we don't need to pay a fee - to ourselves. - */ - int64 total_fees = 2 [deprecated = true]; - - /** - The total amount of funds required to complete a payment over this route. - This value includes the cumulative fees at each hop. As a result, the HTLC - extended to the first-hop in the route will need to have at least this many - satoshis, otherwise the route will fail at an intermediate node due to an - insufficient amount of fees. - */ - int64 total_amt = 3 [deprecated = true]; - - /** - Contains details concerning the specific forwarding details at each hop. - */ - repeated Hop hops = 4; - - /** - The total fees in millisatoshis. - */ - int64 total_fees_msat = 5; - - /** - The total amount in millisatoshis. - */ - int64 total_amt_msat = 6; -} - -message NodeInfoRequest { - /// The 33-byte hex-encoded compressed public of the target node - string pub_key = 1; - - /// If true, will include all known channels associated with the node. - bool include_channels = 2; -} - -message NodeInfo { - /** - An individual vertex/node within the channel graph. A node is - connected to other nodes by one or more channel edges emanating from it. As - the graph is directed, a node will also have an incoming edge attached to - it for each outgoing edge. - */ - LightningNode node = 1; - - /// The total number of channels for the node. - uint32 num_channels = 2; - - /// The sum of all channels capacity for the node, denominated in satoshis. - int64 total_capacity = 3; - - /// A list of all public channels for the node. - repeated ChannelEdge channels = 4; -} - -/** -An individual vertex/node within the channel graph. A node is -connected to other nodes by one or more channel edges emanating from it. As the -graph is directed, a node will also have an incoming edge attached to it for -each outgoing edge. -*/ -message LightningNode { - uint32 last_update = 1; - string pub_key = 2; - string alias = 3; - repeated NodeAddress addresses = 4; - string color = 5; - map features = 6; -} - -message NodeAddress { - string network = 1; - string addr = 2; -} - -message RoutingPolicy { - uint32 time_lock_delta = 1; - int64 min_htlc = 2; - int64 fee_base_msat = 3; - int64 fee_rate_milli_msat = 4; - bool disabled = 5; - uint64 max_htlc_msat = 6; - uint32 last_update = 7; -} - -/** -A fully authenticated channel along with all its unique attributes. -Once an authenticated channel announcement has been processed on the network, -then an instance of ChannelEdgeInfo encapsulating the channels attributes is -stored. The other portions relevant to routing policy of a channel are stored -within a ChannelEdgePolicy for each direction of the channel. -*/ -message ChannelEdge { - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 channel_id = 1 [jstype = JS_STRING]; - string chan_point = 2; - - uint32 last_update = 3 [deprecated = true]; - - string node1_pub = 4; - string node2_pub = 5; - - int64 capacity = 6; - - RoutingPolicy node1_policy = 7; - RoutingPolicy node2_policy = 8; -} - -message ChannelGraphRequest { - /** - Whether unannounced channels are included in the response or not. If set, - unannounced channels are included. Unannounced channels are both private - channels, and public channels that are not yet announced to the network. - */ - bool include_unannounced = 1; -} - -/// Returns a new instance of the directed channel graph. -message ChannelGraph { - /// The list of `LightningNode`s in this channel graph - repeated LightningNode nodes = 1; - - /// The list of `ChannelEdge`s in this channel graph - repeated ChannelEdge edges = 2; -} - -enum NodeMetricType { - UNKNOWN = 0; - BETWEENNESS_CENTRALITY = 1; -} - -message NodeMetricsRequest { - /// The requested node metrics. - repeated NodeMetricType types = 1; -} - -message NodeMetricsResponse { - /** - Betweenness centrality is the sum of the ratio of shortest paths that pass - through the node for each pair of nodes in the graph (not counting paths - starting or ending at this node). - Map of node pubkey to betweenness centrality of the node. Normalized - values are in the [0,1] closed interval. - */ - map betweenness_centrality = 1; -} - -message FloatMetric { - /// Arbitrary float value. - double value = 1; - - /// The value normalized to [0,1] or [-1,1]. - double normalized_value = 2; -} - -message ChanInfoRequest { - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; -} - -message NetworkInfoRequest { -} -message NetworkInfo { - uint32 graph_diameter = 1; - double avg_out_degree = 2; - uint32 max_out_degree = 3; - - uint32 num_nodes = 4; - uint32 num_channels = 5; - - int64 total_network_capacity = 6; - - double avg_channel_size = 7; - int64 min_channel_size = 8; - int64 max_channel_size = 9; - int64 median_channel_size_sat = 10; - - // The number of edges marked as zombies. - uint64 num_zombie_chans = 11; - - // TODO(roasbeef): fee rate info, expiry - // * also additional RPC for tracking fee info once in -} - -message StopRequest { -} -message StopResponse { -} - -message GraphTopologySubscription { -} -message GraphTopologyUpdate { - repeated NodeUpdate node_updates = 1; - repeated ChannelEdgeUpdate channel_updates = 2; - repeated ClosedChannelUpdate closed_chans = 3; -} -message NodeUpdate { - repeated string addresses = 1; - string identity_key = 2; - bytes global_features = 3; - string alias = 4; - string color = 5; -} -message ChannelEdgeUpdate { - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; - - ChannelPoint chan_point = 2; - - int64 capacity = 3; - - RoutingPolicy routing_policy = 4; - - string advertising_node = 5; - string connecting_node = 6; -} -message ClosedChannelUpdate { - /** - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; - int64 capacity = 2; - uint32 closed_height = 3; - ChannelPoint chan_point = 4; -} - -message HopHint { - /// The public key of the node at the start of the channel. - string node_id = 1; - - /// The unique identifier of the channel. - uint64 chan_id = 2 [jstype = JS_STRING]; - - /// The base fee of the channel denominated in millisatoshis. - uint32 fee_base_msat = 3; - - /** - The fee rate of the channel for sending one satoshi across it denominated in - millionths of a satoshi. - */ - uint32 fee_proportional_millionths = 4; - - /// The time-lock delta of the channel. - uint32 cltv_expiry_delta = 5; -} - -message RouteHint { - /** - A list of hop hints that when chained together can assist in reaching a - specific destination. - */ - repeated HopHint hop_hints = 1; -} - -message Invoice { - /** - An optional memo to attach along with the invoice. Used for record keeping - purposes for the invoice's creator, and will also be set in the description - field of the encoded payment request if the description_hash field is not - being used. - */ - string memo = 1; - - reserved 2; - - /** - The hex-encoded preimage (32 byte) which will allow settling an incoming - HTLC payable to this preimage. When using REST, this field must be encoded - as base64. - */ - bytes r_preimage = 3; - - /** - The hash of the preimage. When using REST, this field must be encoded as - base64. - */ - bytes r_hash = 4; - - /** - The value of this invoice in satoshis - - The fields value and value_msat are mutually exclusive. - */ - int64 value = 5; - - /** - The value of this invoice in millisatoshis - - The fields value and value_msat are mutually exclusive. - */ - int64 value_msat = 23; - - /// Whether this invoice has been fulfilled - bool settled = 6 [deprecated = true]; - - /// When this invoice was created - int64 creation_date = 7; - - /// When this invoice was settled - int64 settle_date = 8; - - /** - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 9; - - /** - Hash (SHA-256) of a description of the payment. Used if the description of - payment (memo) is too long to naturally fit within the description field - of an encoded payment request. When using REST, this field must be encoded - as base64. - */ - bytes description_hash = 10; - - /// Payment request expiry time in seconds. Default is 3600 (1 hour). - int64 expiry = 11; - - /// Fallback on-chain address. - string fallback_addr = 12; - - /// Delta to use for the time-lock of the CLTV extended to the final hop. - uint64 cltv_expiry = 13; - - /** - Route hints that can each be individually used to assist in reaching the - invoice's destination. - */ - repeated RouteHint route_hints = 14; - - /// Whether this invoice should include routing hints for private channels. - bool private = 15; - - /** - The "add" index of this invoice. Each newly created invoice will increment - this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all added - invoices with an add_index greater than this one. - */ - uint64 add_index = 16; - - /** - The "settle" index of this invoice. Each newly settled invoice will - increment this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all - settled invoices with an settle_index greater than this one. - */ - uint64 settle_index = 17; - - /// Deprecated, use amt_paid_sat or amt_paid_msat. - int64 amt_paid = 18 [deprecated = true]; - - /** - The amount that was accepted for this invoice, in satoshis. This will ONLY - be set if this invoice has been settled. We provide this field as if the - invoice was created with a zero value, then we need to record what amount - was ultimately accepted. Additionally, it's possible that the sender paid - MORE that was specified in the original invoice. So we'll record that here - as well. - */ - int64 amt_paid_sat = 19; - - /** - The amount that was accepted for this invoice, in millisatoshis. This will - ONLY be set if this invoice has been settled. We provide this field as if - the invoice was created with a zero value, then we need to record what - amount was ultimately accepted. Additionally, it's possible that the sender - paid MORE that was specified in the original invoice. So we'll record that - here as well. - */ - int64 amt_paid_msat = 20; - - enum InvoiceState { - OPEN = 0; - SETTLED = 1; - CANCELED = 2; - ACCEPTED = 3; - } - - /** - The state the invoice is in. - */ - InvoiceState state = 21; - - /// List of HTLCs paying to this invoice [EXPERIMENTAL]. - repeated InvoiceHTLC htlcs = 22; - - /// List of features advertised on the invoice. - map features = 24; - - /** - Indicates if this invoice was a spontaneous payment that arrived via keysend - [EXPERIMENTAL]. - */ - bool is_keysend = 25; -} - -enum InvoiceHTLCState { - ACCEPTED = 0; - SETTLED = 1; - CANCELED = 2; -} - -/// Details of an HTLC that paid to an invoice -message InvoiceHTLC { - /// Short channel id over which the htlc was received. - uint64 chan_id = 1 [jstype = JS_STRING]; - - /// Index identifying the htlc on the channel. - uint64 htlc_index = 2; - - /// The amount of the htlc in msat. - uint64 amt_msat = 3; - - /// Block height at which this htlc was accepted. - int32 accept_height = 4; - - /// Time at which this htlc was accepted. - int64 accept_time = 5; - - /// Time at which this htlc was settled or canceled. - int64 resolve_time = 6; - - /// Block height at which this htlc expires. - int32 expiry_height = 7; - - /// Current state the htlc is in. - InvoiceHTLCState state = 8; - - /// Custom tlv records. - map custom_records = 9; - - /// The total amount of the mpp payment in msat. - uint64 mpp_total_amt_msat = 10; -} - -message AddInvoiceResponse { - bytes r_hash = 1; - - /** - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 2; - - /** - The "add" index of this invoice. Each newly created invoice will increment - this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all added - invoices with an add_index greater than this one. - */ - uint64 add_index = 16; -} -message PaymentHash { - /** - The hex-encoded payment hash of the invoice to be looked up. The passed - payment hash must be exactly 32 bytes, otherwise an error is returned. - Deprecated now that the REST gateway supports base64 encoding of bytes - fields. - */ - string r_hash_str = 1 [deprecated = true]; - - /** - The payment hash of the invoice to be looked up. When using REST, this field - must be encoded as base64. - */ - bytes r_hash = 2; -} - -message ListInvoiceRequest { - /** - If set, only invoices that are not settled and not canceled will be returned - in the response. - */ - bool pending_only = 1; - - /** - The index of an invoice that will be used as either the start or end of a - query to determine which invoices should be returned in the response. - */ - uint64 index_offset = 4; - - /// The max number of invoices to return in the response to this query. - uint64 num_max_invoices = 5; - - /** - If set, the invoices returned will result from seeking backwards from the - specified index offset. This can be used to paginate backwards. - */ - bool reversed = 6; -} -message ListInvoiceResponse { - /** - A list of invoices from the time slice of the time series specified in the - request. - */ - repeated Invoice invoices = 1; - - /** - The index of the last item in the set of returned invoices. This can be used - to seek further, pagination style. - */ - uint64 last_index_offset = 2; - - /** - The index of the last item in the set of returned invoices. This can be used - to seek backwards, pagination style. - */ - uint64 first_index_offset = 3; -} - -message InvoiceSubscription { - /** - If specified (non-zero), then we'll first start by sending out - notifications for all added indexes with an add_index greater than this - value. This allows callers to catch up on any events they missed while they - weren't connected to the streaming RPC. - */ - uint64 add_index = 1; - - /** - If specified (non-zero), then we'll first start by sending out - notifications for all settled indexes with an settle_index greater than - this value. This allows callers to catch up on any events they missed while - they weren't connected to the streaming RPC. - */ - uint64 settle_index = 2; -} - -enum PaymentFailureReason { - /** - Payment isn't failed (yet). - */ - FAILURE_REASON_NONE = 0; - - /** - There are more routes to try, but the payment timeout was exceeded. - */ - FAILURE_REASON_TIMEOUT = 1; - - /** - All possible routes were tried and failed permanently. Or were no - routes to the destination at all. - */ - FAILURE_REASON_NO_ROUTE = 2; - - /** - A non-recoverable error has occured. - */ - FAILURE_REASON_ERROR = 3; - - /** - Payment details incorrect (unknown hash, invalid amt or - invalid final cltv delta) - */ - FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4; - - /** - Insufficient local balance. - */ - FAILURE_REASON_INSUFFICIENT_BALANCE = 5; -} - -message Payment { - /// The payment hash - string payment_hash = 1; - - /// Deprecated, use value_sat or value_msat. - int64 value = 2 [deprecated = true]; - - /// Deprecated, use creation_time_ns - int64 creation_date = 3 [deprecated = true]; - - reserved 4; - - /// Deprecated, use fee_sat or fee_msat. - int64 fee = 5 [deprecated = true]; - - /// The payment preimage - string payment_preimage = 6; - - /// The value of the payment in satoshis - int64 value_sat = 7; - - /// The value of the payment in milli-satoshis - int64 value_msat = 8; - - /// The optional payment request being fulfilled. - string payment_request = 9; - - enum PaymentStatus { - UNKNOWN = 0; - IN_FLIGHT = 1; - SUCCEEDED = 2; - FAILED = 3; - } - - // The status of the payment. - PaymentStatus status = 10; - - /// The fee paid for this payment in satoshis - int64 fee_sat = 11; - - /// The fee paid for this payment in milli-satoshis - int64 fee_msat = 12; - - /// The time in UNIX nanoseconds at which the payment was created. - int64 creation_time_ns = 13; - - /// The HTLCs made in attempt to settle the payment. - repeated HTLCAttempt htlcs = 14; - - /** - The creation index of this payment. Each payment can be uniquely identified - by this index, which may not strictly increment by 1 for payments made in - older versions of lnd. - */ - uint64 payment_index = 15; - - PaymentFailureReason failure_reason = 16; -} - -message HTLCAttempt { - enum HTLCStatus { - IN_FLIGHT = 0; - SUCCEEDED = 1; - FAILED = 2; - } - - /// The status of the HTLC. - HTLCStatus status = 1; - - /// The route taken by this HTLC. - Route route = 2; - - /// The time in UNIX nanoseconds at which this HTLC was sent. - int64 attempt_time_ns = 3; - - /** - The time in UNIX nanoseconds at which this HTLC was settled or failed. - This value will not be set if the HTLC is still IN_FLIGHT. - */ - int64 resolve_time_ns = 4; - - // Detailed htlc failure info. - Failure failure = 5; -} - -message ListPaymentsRequest { - /** - If true, then return payments that have not yet fully completed. This means - that pending payments, as well as failed payments will show up if this - field is set to true. This flag doesn't change the meaning of the indices, - which are tied to individual payments. - */ - bool include_incomplete = 1; - - /** - The index of a payment that will be used as either the start or end of a - query to determine which payments should be returned in the response. The - index_offset is exclusive. In the case of a zero index_offset, the query - will start with the oldest payment when paginating forwards, or will end - with the most recent payment when paginating backwards. - */ - uint64 index_offset = 2; - - /// The maximal number of payments returned in the response to this query. - uint64 max_payments = 3; - - /** - If set, the payments returned will result from seeking backwards from the - specified index offset. This can be used to paginate backwards. The order - of the returned payments is always oldest first (ascending index order). - */ - bool reversed = 4; -} - -message ListPaymentsResponse { - /// The list of payments - repeated Payment payments = 1; - - /** - The index of the first item in the set of returned payments. This can be - used as the index_offset to continue seeking backwards in the next request. - */ - uint64 first_index_offset = 2; - - /** - The index of the last item in the set of returned payments. This can be used - as the index_offset to continue seeking forwards in the next request. - */ - uint64 last_index_offset = 3; -} - -message DeleteAllPaymentsRequest { -} - -message DeleteAllPaymentsResponse { -} - -message AbandonChannelRequest { - ChannelPoint channel_point = 1; -} - -message AbandonChannelResponse { -} - -message DebugLevelRequest { - bool show = 1; - string level_spec = 2; -} -message DebugLevelResponse { - string sub_systems = 1; -} - -message PayReqString { - /// The payment request string to be decoded - string pay_req = 1; -} -message PayReq { - string destination = 1; - string payment_hash = 2; - int64 num_satoshis = 3; - int64 timestamp = 4; - int64 expiry = 5; - string description = 6; - string description_hash = 7; - string fallback_addr = 8; - int64 cltv_expiry = 9; - repeated RouteHint route_hints = 10; - bytes payment_addr = 11; - int64 num_msat = 12; - map features = 13; -} - -enum FeatureBit { - DATALOSS_PROTECT_REQ = 0; - DATALOSS_PROTECT_OPT = 1; - INITIAL_ROUING_SYNC = 3; - UPFRONT_SHUTDOWN_SCRIPT_REQ = 4; - UPFRONT_SHUTDOWN_SCRIPT_OPT = 5; - GOSSIP_QUERIES_REQ = 6; - GOSSIP_QUERIES_OPT = 7; - TLV_ONION_REQ = 8; - TLV_ONION_OPT = 9; - EXT_GOSSIP_QUERIES_REQ = 10; - EXT_GOSSIP_QUERIES_OPT = 11; - STATIC_REMOTE_KEY_REQ = 12; - STATIC_REMOTE_KEY_OPT = 13; - PAYMENT_ADDR_REQ = 14; - PAYMENT_ADDR_OPT = 15; - MPP_REQ = 16; - MPP_OPT = 17; -} - -message Feature { - string name = 2; - bool is_required = 3; - bool is_known = 4; -} - -message FeeReportRequest { -} -message ChannelFeeReport { - /// The short channel id that this fee report belongs to. - uint64 chan_id = 5 [jstype = JS_STRING]; - - /// The channel that this fee report belongs to. - string channel_point = 1; - - /// The base fee charged regardless of the number of milli-satoshis sent. - int64 base_fee_msat = 2; - - /// The amount charged per milli-satoshis transferred expressed in - /// millionths of a satoshi. - int64 fee_per_mil = 3; - - /// The effective fee rate in milli-satoshis. Computed by dividing the - /// fee_per_mil value by 1 million. - double fee_rate = 4; -} -message FeeReportResponse { - /// An array of channel fee reports which describes the current fee schedule - /// for each channel. - repeated ChannelFeeReport channel_fees = 1; - - /// The total amount of fee revenue (in satoshis) the switch has collected - /// over the past 24 hrs. - uint64 day_fee_sum = 2; - - /// The total amount of fee revenue (in satoshis) the switch has collected - /// over the past 1 week. - uint64 week_fee_sum = 3; - - /// The total amount of fee revenue (in satoshis) the switch has collected - /// over the past 1 month. - uint64 month_fee_sum = 4; -} - -message PolicyUpdateRequest { - oneof scope { - /// If set, then this update applies to all currently active channels. - bool global = 1; - - /// If set, this update will target a specific channel. - ChannelPoint chan_point = 2; - } - - /// The base fee charged regardless of the number of milli-satoshis sent. - int64 base_fee_msat = 3; - - /// The effective fee rate in milli-satoshis. The precision of this value - /// goes up to 6 decimal places, so 1e-6. - double fee_rate = 4; - - /// The required timelock delta for HTLCs forwarded over the channel. - uint32 time_lock_delta = 5; - - /// If set, the maximum HTLC size in milli-satoshis. If unset, the maximum - /// HTLC will be unchanged. - uint64 max_htlc_msat = 6; - - /// The minimum HTLC size in milli-satoshis. Only applied if - /// min_htlc_msat_specified is true. - uint64 min_htlc_msat = 7; - - /// If true, min_htlc_msat is applied. - bool min_htlc_msat_specified = 8; -} -message PolicyUpdateResponse { -} - -message ForwardingHistoryRequest { - /// Start time is the starting point of the forwarding history request. All - /// records beyond this point will be included, respecting the end time, and - /// the index offset. - uint64 start_time = 1; - - /// End time is the end point of the forwarding history request. The - /// response will carry at most 50k records between the start time and the - /// end time. The index offset can be used to implement pagination. - uint64 end_time = 2; - - /// Index offset is the offset in the time series to start at. As each - /// response can only contain 50k records, callers can use this to skip - /// around within a packed time series. - uint32 index_offset = 3; - - /// The max number of events to return in the response to this query. - uint32 num_max_events = 4; -} -message ForwardingEvent { - /// Timestamp is the time (unix epoch offset) that this circuit was - /// completed. - uint64 timestamp = 1; - - /// The incoming channel ID that carried the HTLC that created the circuit. - uint64 chan_id_in = 2 [jstype = JS_STRING]; - - /// The outgoing channel ID that carried the preimage that completed the - /// circuit. - uint64 chan_id_out = 4 [jstype = JS_STRING]; - - /// The total amount (in satoshis) of the incoming HTLC that created half - /// the circuit. - uint64 amt_in = 5; - - /// The total amount (in satoshis) of the outgoing HTLC that created the - /// second half of the circuit. - uint64 amt_out = 6; - - /// The total fee (in satoshis) that this payment circuit carried. - uint64 fee = 7; - - /// The total fee (in milli-satoshis) that this payment circuit carried. - uint64 fee_msat = 8; - - /// The total amount (in milli-satoshis) of the incoming HTLC that created - /// half the circuit. - uint64 amt_in_msat = 9; - - /// The total amount (in milli-satoshis) of the outgoing HTLC that created - /// the second half of the circuit. - uint64 amt_out_msat = 10; - - // TODO(roasbeef): add settlement latency? - // * use FPE on the chan id? - // * also list failures? -} -message ForwardingHistoryResponse { - /// A list of forwarding events from the time slice of the time series - /// specified in the request. - repeated ForwardingEvent forwarding_events = 1; - - /// The index of the last time in the set of returned forwarding events. Can - /// be used to seek further, pagination style. - uint32 last_offset_index = 2; -} - -message ExportChannelBackupRequest { - /// The target channel point to obtain a back up for. - ChannelPoint chan_point = 1; -} - -message ChannelBackup { - /** - Identifies the channel that this backup belongs to. - */ - ChannelPoint chan_point = 1; - - /** - Is an encrypted single-chan backup. this can be passed to - RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in - order to trigger the recovery protocol. When using REST, this field must be - encoded as base64. - */ - bytes chan_backup = 2; -} - -message MultiChanBackup { - /** - Is the set of all channels that are included in this multi-channel backup. - */ - repeated ChannelPoint chan_points = 1; - - /** - A single encrypted blob containing all the static channel backups of the - channel listed above. This can be stored as a single file or blob, and - safely be replaced with any prior/future versions. When using REST, this - field must be encoded as base64. - */ - bytes multi_chan_backup = 2; -} - -message ChanBackupExportRequest { -} -message ChanBackupSnapshot { - /** - The set of new channels that have been added since the last channel backup - snapshot was requested. - */ - ChannelBackups single_chan_backups = 1; - - /** - A multi-channel backup that covers all open channels currently known to - lnd. - */ - MultiChanBackup multi_chan_backup = 2; -} - -message ChannelBackups { - /** - A set of single-chan static channel backups. - */ - repeated ChannelBackup chan_backups = 1; -} - -message RestoreChanBackupRequest { - oneof backup { - /** - The channels to restore as a list of channel/backup pairs. - */ - ChannelBackups chan_backups = 1; - - /** - The channels to restore in the packed multi backup format. When using - REST, this field must be encoded as base64. - */ - bytes multi_chan_backup = 2; - } -} -message RestoreBackupResponse { -} - -message ChannelBackupSubscription { -} - -message VerifyChanBackupResponse { -} - -message MacaroonPermission { - /// The entity a permission grants access to. - string entity = 1; - - /// The action that is granted. - string action = 2; -} -message BakeMacaroonRequest { - /// The list of permissions the new macaroon should grant. - repeated MacaroonPermission permissions = 1; -} -message BakeMacaroonResponse { - /// The hex encoded macaroon, serialized in binary format. - string macaroon = 1; -} - -message Failure { - enum FailureCode { - /** - The numbers assigned in this enumeration match the failure codes as - defined in BOLT #4. Because protobuf 3 requires enums to start with 0, - a RESERVED value is added. - */ - RESERVED = 0; - - INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1; - INCORRECT_PAYMENT_AMOUNT = 2; - FINAL_INCORRECT_CLTV_EXPIRY = 3; - FINAL_INCORRECT_HTLC_AMOUNT = 4; - FINAL_EXPIRY_TOO_SOON = 5; - INVALID_REALM = 6; - EXPIRY_TOO_SOON = 7; - INVALID_ONION_VERSION = 8; - INVALID_ONION_HMAC = 9; - INVALID_ONION_KEY = 10; - AMOUNT_BELOW_MINIMUM = 11; - FEE_INSUFFICIENT = 12; - INCORRECT_CLTV_EXPIRY = 13; - CHANNEL_DISABLED = 14; - TEMPORARY_CHANNEL_FAILURE = 15; - REQUIRED_NODE_FEATURE_MISSING = 16; - REQUIRED_CHANNEL_FEATURE_MISSING = 17; - UNKNOWN_NEXT_PEER = 18; - TEMPORARY_NODE_FAILURE = 19; - PERMANENT_NODE_FAILURE = 20; - PERMANENT_CHANNEL_FAILURE = 21; - EXPIRY_TOO_FAR = 22; - MPP_TIMEOUT = 23; - - /** - An internal error occurred. - */ - INTERNAL_FAILURE = 997; - - /** - The error source is known, but the failure itself couldn't be decoded. - */ - UNKNOWN_FAILURE = 998; - - /** - An unreadable failure result is returned if the received failure message - cannot be decrypted. In that case the error source is unknown. - */ - UNREADABLE_FAILURE = 999; - } - - /// Failure code as defined in the Lightning spec - FailureCode code = 1; - - reserved 2; - - /// An optional channel update message. - ChannelUpdate channel_update = 3; - - /// A failure type-dependent htlc value. - uint64 htlc_msat = 4; - - /// The sha256 sum of the onion payload. - bytes onion_sha_256 = 5; - - /// A failure type-dependent cltv expiry value. - uint32 cltv_expiry = 6; - - /// A failure type-dependent flags value. - uint32 flags = 7; - - /** - The position in the path of the intermediate or final node that generated - the failure message. Position zero is the sender node. - **/ - uint32 failure_source_index = 8; - - /// A failure type-dependent block height. - uint32 height = 9; -} - -message ChannelUpdate { - /** - The signature that validates the announced data and proves the ownership - of node id. - */ - bytes signature = 1; - - /** - The target chain that this channel was opened within. This value - should be the genesis hash of the target chain. Along with the short - channel ID, this uniquely identifies the channel globally in a - blockchain. - */ - bytes chain_hash = 2; - - /** - The unique description of the funding transaction. - */ - uint64 chan_id = 3 [jstype = JS_STRING]; - - /** - A timestamp that allows ordering in the case of multiple announcements. - We should ignore the message if timestamp is not greater than the - last-received. - */ - uint32 timestamp = 4; - - /** - The bitfield that describes whether optional fields are present in this - update. Currently, the least-significant bit must be set to 1 if the - optional field MaxHtlc is present. - */ - uint32 message_flags = 10; - - /** - The bitfield that describes additional meta-data concerning how the - update is to be interpreted. Currently, the least-significant bit must be - set to 0 if the creating node corresponds to the first node in the - previously sent channel announcement and 1 otherwise. If the second bit - is set, then the channel is set to be disabled. - */ - uint32 channel_flags = 5; - - /** - The minimum number of blocks this node requires to be added to the expiry - of HTLCs. This is a security parameter determined by the node operator. - This value represents the required gap between the time locks of the - incoming and outgoing HTLC's set to this node. - */ - uint32 time_lock_delta = 6; - - /** - The minimum HTLC value which will be accepted. - */ - uint64 htlc_minimum_msat = 7; - - /** - The base fee that must be used for incoming HTLC's to this particular - channel. This value will be tacked onto the required for a payment - independent of the size of the payment. - */ - uint32 base_fee = 8; - - /** - The fee rate that will be charged per millionth of a satoshi. - */ - uint32 fee_rate = 9; - - /** - The maximum HTLC value which will be accepted. - */ - uint64 htlc_maximum_msat = 11; - - /** - The set of data that was appended to this message, some of which we may - not actually know how to iterate or parse. By holding onto this data, we - ensure that we're able to properly validate the set of signatures that - cover these new fields, and ensure we're able to make upgrades to the - network in a forwards compatible manner. - */ - bytes extra_opaque_data = 12; -} diff --git a/lib/lnrpc/rpc_pb.rb b/lib/lnrpc/rpc_pb.rb deleted file mode 100644 index 1c08747..0000000 --- a/lib/lnrpc/rpc_pb.rb +++ /dev/null @@ -1,1248 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: rpc.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -Google::Protobuf::DescriptorPool.generated_pool.build do - add_message "lnrpc.GenSeedRequest" do - optional :aezeed_passphrase, :bytes, 1 - optional :seed_entropy, :bytes, 2 - end - add_message "lnrpc.GenSeedResponse" do - repeated :cipher_seed_mnemonic, :string, 1 - optional :enciphered_seed, :bytes, 2 - end - add_message "lnrpc.InitWalletRequest" do - optional :wallet_password, :bytes, 1 - repeated :cipher_seed_mnemonic, :string, 2 - optional :aezeed_passphrase, :bytes, 3 - optional :recovery_window, :int32, 4 - optional :channel_backups, :message, 5, "lnrpc.ChanBackupSnapshot" - end - add_message "lnrpc.InitWalletResponse" do - end - add_message "lnrpc.UnlockWalletRequest" do - optional :wallet_password, :bytes, 1 - optional :recovery_window, :int32, 2 - optional :channel_backups, :message, 3, "lnrpc.ChanBackupSnapshot" - end - add_message "lnrpc.UnlockWalletResponse" do - end - add_message "lnrpc.ChangePasswordRequest" do - optional :current_password, :bytes, 1 - optional :new_password, :bytes, 2 - end - add_message "lnrpc.ChangePasswordResponse" do - end - add_message "lnrpc.Utxo" do - optional :address_type, :enum, 1, "lnrpc.AddressType" - optional :address, :string, 2 - optional :amount_sat, :int64, 3 - optional :pk_script, :string, 4 - optional :outpoint, :message, 5, "lnrpc.OutPoint" - optional :confirmations, :int64, 6 - end - add_message "lnrpc.Transaction" do - optional :tx_hash, :string, 1 - optional :amount, :int64, 2 - optional :num_confirmations, :int32, 3 - optional :block_hash, :string, 4 - optional :block_height, :int32, 5 - optional :time_stamp, :int64, 6 - optional :total_fees, :int64, 7 - repeated :dest_addresses, :string, 8 - optional :raw_tx_hex, :string, 9 - end - add_message "lnrpc.GetTransactionsRequest" do - end - add_message "lnrpc.TransactionDetails" do - repeated :transactions, :message, 1, "lnrpc.Transaction" - end - add_message "lnrpc.FeeLimit" do - oneof :limit do - optional :fixed, :int64, 1 - optional :fixed_msat, :int64, 3 - optional :percent, :int64, 2 - end - end - add_message "lnrpc.SendRequest" do - optional :dest, :bytes, 1 - optional :dest_string, :string, 2 - optional :amt, :int64, 3 - optional :amt_msat, :int64, 12 - optional :payment_hash, :bytes, 4 - optional :payment_hash_string, :string, 5 - optional :payment_request, :string, 6 - optional :final_cltv_delta, :int32, 7 - optional :fee_limit, :message, 8, "lnrpc.FeeLimit" - optional :outgoing_chan_id, :uint64, 9 - optional :last_hop_pubkey, :bytes, 13 - optional :cltv_limit, :uint32, 10 - map :dest_custom_records, :uint64, :bytes, 11 - optional :allow_self_payment, :bool, 14 - repeated :dest_features, :enum, 15, "lnrpc.FeatureBit" - end - add_message "lnrpc.SendResponse" do - optional :payment_error, :string, 1 - optional :payment_preimage, :bytes, 2 - optional :payment_route, :message, 3, "lnrpc.Route" - optional :payment_hash, :bytes, 4 - end - add_message "lnrpc.SendToRouteRequest" do - optional :payment_hash, :bytes, 1 - optional :payment_hash_string, :string, 2 - optional :route, :message, 4, "lnrpc.Route" - end - add_message "lnrpc.ChannelAcceptRequest" do - optional :node_pubkey, :bytes, 1 - optional :chain_hash, :bytes, 2 - optional :pending_chan_id, :bytes, 3 - optional :funding_amt, :uint64, 4 - optional :push_amt, :uint64, 5 - optional :dust_limit, :uint64, 6 - optional :max_value_in_flight, :uint64, 7 - optional :channel_reserve, :uint64, 8 - optional :min_htlc, :uint64, 9 - optional :fee_per_kw, :uint64, 10 - optional :csv_delay, :uint32, 11 - optional :max_accepted_htlcs, :uint32, 12 - optional :channel_flags, :uint32, 13 - end - add_message "lnrpc.ChannelAcceptResponse" do - optional :accept, :bool, 1 - optional :pending_chan_id, :bytes, 2 - end - add_message "lnrpc.ChannelPoint" do - optional :output_index, :uint32, 3 - oneof :funding_txid do - optional :funding_txid_bytes, :bytes, 1 - optional :funding_txid_str, :string, 2 - end - end - add_message "lnrpc.OutPoint" do - optional :txid_bytes, :bytes, 1 - optional :txid_str, :string, 2 - optional :output_index, :uint32, 3 - end - add_message "lnrpc.LightningAddress" do - optional :pubkey, :string, 1 - optional :host, :string, 2 - end - add_message "lnrpc.EstimateFeeRequest" do - map :AddrToAmount, :string, :int64, 1 - optional :target_conf, :int32, 2 - end - add_message "lnrpc.EstimateFeeResponse" do - optional :fee_sat, :int64, 1 - optional :feerate_sat_per_byte, :int64, 2 - end - add_message "lnrpc.SendManyRequest" do - map :AddrToAmount, :string, :int64, 1 - optional :target_conf, :int32, 3 - optional :sat_per_byte, :int64, 5 - end - add_message "lnrpc.SendManyResponse" do - optional :txid, :string, 1 - end - add_message "lnrpc.SendCoinsRequest" do - optional :addr, :string, 1 - optional :amount, :int64, 2 - optional :target_conf, :int32, 3 - optional :sat_per_byte, :int64, 5 - optional :send_all, :bool, 6 - end - add_message "lnrpc.SendCoinsResponse" do - optional :txid, :string, 1 - end - add_message "lnrpc.ListUnspentRequest" do - optional :min_confs, :int32, 1 - optional :max_confs, :int32, 2 - end - add_message "lnrpc.ListUnspentResponse" do - repeated :utxos, :message, 1, "lnrpc.Utxo" - end - add_message "lnrpc.NewAddressRequest" do - optional :type, :enum, 1, "lnrpc.AddressType" - end - add_message "lnrpc.NewAddressResponse" do - optional :address, :string, 1 - end - add_message "lnrpc.SignMessageRequest" do - optional :msg, :bytes, 1 - end - add_message "lnrpc.SignMessageResponse" do - optional :signature, :string, 1 - end - add_message "lnrpc.VerifyMessageRequest" do - optional :msg, :bytes, 1 - optional :signature, :string, 2 - end - add_message "lnrpc.VerifyMessageResponse" do - optional :valid, :bool, 1 - optional :pubkey, :string, 2 - end - add_message "lnrpc.ConnectPeerRequest" do - optional :addr, :message, 1, "lnrpc.LightningAddress" - optional :perm, :bool, 2 - end - add_message "lnrpc.ConnectPeerResponse" do - end - add_message "lnrpc.DisconnectPeerRequest" do - optional :pub_key, :string, 1 - end - add_message "lnrpc.DisconnectPeerResponse" do - end - add_message "lnrpc.HTLC" do - optional :incoming, :bool, 1 - optional :amount, :int64, 2 - optional :hash_lock, :bytes, 3 - optional :expiration_height, :uint32, 4 - end - add_message "lnrpc.Channel" do - optional :active, :bool, 1 - optional :remote_pubkey, :string, 2 - optional :channel_point, :string, 3 - optional :chan_id, :uint64, 4 - optional :capacity, :int64, 5 - optional :local_balance, :int64, 6 - optional :remote_balance, :int64, 7 - optional :commit_fee, :int64, 8 - optional :commit_weight, :int64, 9 - optional :fee_per_kw, :int64, 10 - optional :unsettled_balance, :int64, 11 - optional :total_satoshis_sent, :int64, 12 - optional :total_satoshis_received, :int64, 13 - optional :num_updates, :uint64, 14 - repeated :pending_htlcs, :message, 15, "lnrpc.HTLC" - optional :csv_delay, :uint32, 16 - optional :private, :bool, 17 - optional :initiator, :bool, 18 - optional :chan_status_flags, :string, 19 - optional :local_chan_reserve_sat, :int64, 20 - optional :remote_chan_reserve_sat, :int64, 21 - optional :static_remote_key, :bool, 22 - optional :commitment_type, :enum, 26, "lnrpc.CommitmentType" - optional :lifetime, :int64, 23 - optional :uptime, :int64, 24 - optional :close_address, :string, 25 - optional :push_amount_sat, :uint64, 27 - optional :thaw_height, :uint32, 28 - end - add_message "lnrpc.ListChannelsRequest" do - optional :active_only, :bool, 1 - optional :inactive_only, :bool, 2 - optional :public_only, :bool, 3 - optional :private_only, :bool, 4 - optional :peer, :bytes, 5 - end - add_message "lnrpc.ListChannelsResponse" do - repeated :channels, :message, 11, "lnrpc.Channel" - end - add_message "lnrpc.ChannelCloseSummary" do - optional :channel_point, :string, 1 - optional :chan_id, :uint64, 2 - optional :chain_hash, :string, 3 - optional :closing_tx_hash, :string, 4 - optional :remote_pubkey, :string, 5 - optional :capacity, :int64, 6 - optional :close_height, :uint32, 7 - optional :settled_balance, :int64, 8 - optional :time_locked_balance, :int64, 9 - optional :close_type, :enum, 10, "lnrpc.ChannelCloseSummary.ClosureType" - optional :open_initiator, :enum, 11, "lnrpc.Initiator" - optional :close_initiator, :enum, 12, "lnrpc.Initiator" - end - add_enum "lnrpc.ChannelCloseSummary.ClosureType" do - value :COOPERATIVE_CLOSE, 0 - value :LOCAL_FORCE_CLOSE, 1 - value :REMOTE_FORCE_CLOSE, 2 - value :BREACH_CLOSE, 3 - value :FUNDING_CANCELED, 4 - value :ABANDONED, 5 - end - add_message "lnrpc.ClosedChannelsRequest" do - optional :cooperative, :bool, 1 - optional :local_force, :bool, 2 - optional :remote_force, :bool, 3 - optional :breach, :bool, 4 - optional :funding_canceled, :bool, 5 - optional :abandoned, :bool, 6 - end - add_message "lnrpc.ClosedChannelsResponse" do - repeated :channels, :message, 1, "lnrpc.ChannelCloseSummary" - end - add_message "lnrpc.Peer" do - optional :pub_key, :string, 1 - optional :address, :string, 3 - optional :bytes_sent, :uint64, 4 - optional :bytes_recv, :uint64, 5 - optional :sat_sent, :int64, 6 - optional :sat_recv, :int64, 7 - optional :inbound, :bool, 8 - optional :ping_time, :int64, 9 - optional :sync_type, :enum, 10, "lnrpc.Peer.SyncType" - map :features, :uint32, :message, 11, "lnrpc.Feature" - repeated :errors, :message, 12, "lnrpc.TimestampedError" - end - add_enum "lnrpc.Peer.SyncType" do - value :UNKNOWN_SYNC, 0 - value :ACTIVE_SYNC, 1 - value :PASSIVE_SYNC, 2 - end - add_message "lnrpc.TimestampedError" do - optional :timestamp, :uint64, 1 - optional :error, :string, 2 - end - add_message "lnrpc.ListPeersRequest" do - optional :latest_error, :bool, 1 - end - add_message "lnrpc.ListPeersResponse" do - repeated :peers, :message, 1, "lnrpc.Peer" - end - add_message "lnrpc.PeerEventSubscription" do - end - add_message "lnrpc.PeerEvent" do - optional :pub_key, :string, 1 - optional :type, :enum, 2, "lnrpc.PeerEvent.EventType" - end - add_enum "lnrpc.PeerEvent.EventType" do - value :PEER_ONLINE, 0 - value :PEER_OFFLINE, 1 - end - add_message "lnrpc.GetInfoRequest" do - end - add_message "lnrpc.GetInfoResponse" do - optional :version, :string, 14 - optional :commit_hash, :string, 20 - optional :identity_pubkey, :string, 1 - optional :alias, :string, 2 - optional :color, :string, 17 - optional :num_pending_channels, :uint32, 3 - optional :num_active_channels, :uint32, 4 - optional :num_inactive_channels, :uint32, 15 - optional :num_peers, :uint32, 5 - optional :block_height, :uint32, 6 - optional :block_hash, :string, 8 - optional :best_header_timestamp, :int64, 13 - optional :synced_to_chain, :bool, 9 - optional :synced_to_graph, :bool, 18 - optional :testnet, :bool, 10 - repeated :chains, :message, 16, "lnrpc.Chain" - repeated :uris, :string, 12 - map :features, :uint32, :message, 19, "lnrpc.Feature" - end - add_message "lnrpc.Chain" do - optional :chain, :string, 1 - optional :network, :string, 2 - end - add_message "lnrpc.ConfirmationUpdate" do - optional :block_sha, :bytes, 1 - optional :block_height, :int32, 2 - optional :num_confs_left, :uint32, 3 - end - add_message "lnrpc.ChannelOpenUpdate" do - optional :channel_point, :message, 1, "lnrpc.ChannelPoint" - end - add_message "lnrpc.ChannelCloseUpdate" do - optional :closing_txid, :bytes, 1 - optional :success, :bool, 2 - end - add_message "lnrpc.CloseChannelRequest" do - optional :channel_point, :message, 1, "lnrpc.ChannelPoint" - optional :force, :bool, 2 - optional :target_conf, :int32, 3 - optional :sat_per_byte, :int64, 4 - optional :delivery_address, :string, 5 - end - add_message "lnrpc.CloseStatusUpdate" do - oneof :update do - optional :close_pending, :message, 1, "lnrpc.PendingUpdate" - optional :chan_close, :message, 3, "lnrpc.ChannelCloseUpdate" - end - end - add_message "lnrpc.PendingUpdate" do - optional :txid, :bytes, 1 - optional :output_index, :uint32, 2 - end - add_message "lnrpc.ReadyForPsbtFunding" do - optional :funding_address, :string, 1 - optional :funding_amount, :int64, 2 - optional :psbt, :bytes, 3 - end - add_message "lnrpc.OpenChannelRequest" do - optional :node_pubkey, :bytes, 2 - optional :node_pubkey_string, :string, 3 - optional :local_funding_amount, :int64, 4 - optional :push_sat, :int64, 5 - optional :target_conf, :int32, 6 - optional :sat_per_byte, :int64, 7 - optional :private, :bool, 8 - optional :min_htlc_msat, :int64, 9 - optional :remote_csv_delay, :uint32, 10 - optional :min_confs, :int32, 11 - optional :spend_unconfirmed, :bool, 12 - optional :close_address, :string, 13 - optional :funding_shim, :message, 14, "lnrpc.FundingShim" - end - add_message "lnrpc.OpenStatusUpdate" do - optional :pending_chan_id, :bytes, 4 - oneof :update do - optional :chan_pending, :message, 1, "lnrpc.PendingUpdate" - optional :chan_open, :message, 3, "lnrpc.ChannelOpenUpdate" - optional :psbt_fund, :message, 5, "lnrpc.ReadyForPsbtFunding" - end - end - add_message "lnrpc.KeyLocator" do - optional :key_family, :int32, 1 - optional :key_index, :int32, 2 - end - add_message "lnrpc.KeyDescriptor" do - optional :raw_key_bytes, :bytes, 1 - optional :key_loc, :message, 2, "lnrpc.KeyLocator" - end - add_message "lnrpc.ChanPointShim" do - optional :amt, :int64, 1 - optional :chan_point, :message, 2, "lnrpc.ChannelPoint" - optional :local_key, :message, 3, "lnrpc.KeyDescriptor" - optional :remote_key, :bytes, 4 - optional :pending_chan_id, :bytes, 5 - optional :thaw_height, :uint32, 6 - end - add_message "lnrpc.PsbtShim" do - optional :pending_chan_id, :bytes, 1 - optional :base_psbt, :bytes, 2 - end - add_message "lnrpc.FundingShim" do - oneof :shim do - optional :chan_point_shim, :message, 1, "lnrpc.ChanPointShim" - optional :psbt_shim, :message, 2, "lnrpc.PsbtShim" - end - end - add_message "lnrpc.FundingShimCancel" do - optional :pending_chan_id, :bytes, 1 - end - add_message "lnrpc.FundingPsbtVerify" do - optional :funded_psbt, :bytes, 1 - optional :pending_chan_id, :bytes, 2 - end - add_message "lnrpc.FundingPsbtFinalize" do - optional :signed_psbt, :bytes, 1 - optional :pending_chan_id, :bytes, 2 - end - add_message "lnrpc.FundingTransitionMsg" do - oneof :trigger do - optional :shim_register, :message, 1, "lnrpc.FundingShim" - optional :shim_cancel, :message, 2, "lnrpc.FundingShimCancel" - optional :psbt_verify, :message, 3, "lnrpc.FundingPsbtVerify" - optional :psbt_finalize, :message, 4, "lnrpc.FundingPsbtFinalize" - end - end - add_message "lnrpc.FundingStateStepResp" do - end - add_message "lnrpc.PendingHTLC" do - optional :incoming, :bool, 1 - optional :amount, :int64, 2 - optional :outpoint, :string, 3 - optional :maturity_height, :uint32, 4 - optional :blocks_til_maturity, :int32, 5 - optional :stage, :uint32, 6 - end - add_message "lnrpc.PendingChannelsRequest" do - end - add_message "lnrpc.PendingChannelsResponse" do - optional :total_limbo_balance, :int64, 1 - repeated :pending_open_channels, :message, 2, "lnrpc.PendingChannelsResponse.PendingOpenChannel" - repeated :pending_closing_channels, :message, 3, "lnrpc.PendingChannelsResponse.ClosedChannel" - repeated :pending_force_closing_channels, :message, 4, "lnrpc.PendingChannelsResponse.ForceClosedChannel" - repeated :waiting_close_channels, :message, 5, "lnrpc.PendingChannelsResponse.WaitingCloseChannel" - end - add_message "lnrpc.PendingChannelsResponse.PendingChannel" do - optional :remote_node_pub, :string, 1 - optional :channel_point, :string, 2 - optional :capacity, :int64, 3 - optional :local_balance, :int64, 4 - optional :remote_balance, :int64, 5 - optional :local_chan_reserve_sat, :int64, 6 - optional :remote_chan_reserve_sat, :int64, 7 - optional :initiator, :enum, 8, "lnrpc.Initiator" - optional :commitment_type, :enum, 9, "lnrpc.CommitmentType" - end - add_message "lnrpc.PendingChannelsResponse.PendingOpenChannel" do - optional :channel, :message, 1, "lnrpc.PendingChannelsResponse.PendingChannel" - optional :confirmation_height, :uint32, 2 - optional :commit_fee, :int64, 4 - optional :commit_weight, :int64, 5 - optional :fee_per_kw, :int64, 6 - end - add_message "lnrpc.PendingChannelsResponse.WaitingCloseChannel" do - optional :channel, :message, 1, "lnrpc.PendingChannelsResponse.PendingChannel" - optional :limbo_balance, :int64, 2 - optional :commitments, :message, 3, "lnrpc.PendingChannelsResponse.Commitments" - end - add_message "lnrpc.PendingChannelsResponse.Commitments" do - optional :local_txid, :string, 1 - optional :remote_txid, :string, 2 - optional :remote_pending_txid, :string, 3 - optional :local_commit_fee_sat, :uint64, 4 - optional :remote_commit_fee_sat, :uint64, 5 - optional :remote_pending_commit_fee_sat, :uint64, 6 - end - add_message "lnrpc.PendingChannelsResponse.ClosedChannel" do - optional :channel, :message, 1, "lnrpc.PendingChannelsResponse.PendingChannel" - optional :closing_txid, :string, 2 - end - add_message "lnrpc.PendingChannelsResponse.ForceClosedChannel" do - optional :channel, :message, 1, "lnrpc.PendingChannelsResponse.PendingChannel" - optional :closing_txid, :string, 2 - optional :limbo_balance, :int64, 3 - optional :maturity_height, :uint32, 4 - optional :blocks_til_maturity, :int32, 5 - optional :recovered_balance, :int64, 6 - repeated :pending_htlcs, :message, 8, "lnrpc.PendingHTLC" - optional :anchor, :enum, 9, "lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState" - end - add_enum "lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState" do - value :LIMBO, 0 - value :RECOVERED, 1 - value :LOST, 2 - end - add_message "lnrpc.ChannelEventSubscription" do - end - add_message "lnrpc.ChannelEventUpdate" do - optional :type, :enum, 5, "lnrpc.ChannelEventUpdate.UpdateType" - oneof :channel do - optional :open_channel, :message, 1, "lnrpc.Channel" - optional :closed_channel, :message, 2, "lnrpc.ChannelCloseSummary" - optional :active_channel, :message, 3, "lnrpc.ChannelPoint" - optional :inactive_channel, :message, 4, "lnrpc.ChannelPoint" - optional :pending_open_channel, :message, 6, "lnrpc.PendingUpdate" - end - end - add_enum "lnrpc.ChannelEventUpdate.UpdateType" do - value :OPEN_CHANNEL, 0 - value :CLOSED_CHANNEL, 1 - value :ACTIVE_CHANNEL, 2 - value :INACTIVE_CHANNEL, 3 - value :PENDING_OPEN_CHANNEL, 4 - end - add_message "lnrpc.WalletBalanceRequest" do - end - add_message "lnrpc.WalletBalanceResponse" do - optional :total_balance, :int64, 1 - optional :confirmed_balance, :int64, 2 - optional :unconfirmed_balance, :int64, 3 - end - add_message "lnrpc.ChannelBalanceRequest" do - end - add_message "lnrpc.ChannelBalanceResponse" do - optional :balance, :int64, 1 - optional :pending_open_balance, :int64, 2 - end - add_message "lnrpc.QueryRoutesRequest" do - optional :pub_key, :string, 1 - optional :amt, :int64, 2 - optional :amt_msat, :int64, 12 - optional :final_cltv_delta, :int32, 4 - optional :fee_limit, :message, 5, "lnrpc.FeeLimit" - repeated :ignored_nodes, :bytes, 6 - repeated :ignored_edges, :message, 7, "lnrpc.EdgeLocator" - optional :source_pub_key, :string, 8 - optional :use_mission_control, :bool, 9 - repeated :ignored_pairs, :message, 10, "lnrpc.NodePair" - optional :cltv_limit, :uint32, 11 - map :dest_custom_records, :uint64, :bytes, 13 - optional :outgoing_chan_id, :uint64, 14 - optional :last_hop_pubkey, :bytes, 15 - repeated :route_hints, :message, 16, "lnrpc.RouteHint" - repeated :dest_features, :enum, 17, "lnrpc.FeatureBit" - end - add_message "lnrpc.NodePair" do - optional :from, :bytes, 1 - optional :to, :bytes, 2 - end - add_message "lnrpc.EdgeLocator" do - optional :channel_id, :uint64, 1 - optional :direction_reverse, :bool, 2 - end - add_message "lnrpc.QueryRoutesResponse" do - repeated :routes, :message, 1, "lnrpc.Route" - optional :success_prob, :double, 2 - end - add_message "lnrpc.Hop" do - optional :chan_id, :uint64, 1 - optional :chan_capacity, :int64, 2 - optional :amt_to_forward, :int64, 3 - optional :fee, :int64, 4 - optional :expiry, :uint32, 5 - optional :amt_to_forward_msat, :int64, 6 - optional :fee_msat, :int64, 7 - optional :pub_key, :string, 8 - optional :tlv_payload, :bool, 9 - optional :mpp_record, :message, 10, "lnrpc.MPPRecord" - map :custom_records, :uint64, :bytes, 11 - end - add_message "lnrpc.MPPRecord" do - optional :payment_addr, :bytes, 11 - optional :total_amt_msat, :int64, 10 - end - add_message "lnrpc.Route" do - optional :total_time_lock, :uint32, 1 - optional :total_fees, :int64, 2 - optional :total_amt, :int64, 3 - repeated :hops, :message, 4, "lnrpc.Hop" - optional :total_fees_msat, :int64, 5 - optional :total_amt_msat, :int64, 6 - end - add_message "lnrpc.NodeInfoRequest" do - optional :pub_key, :string, 1 - optional :include_channels, :bool, 2 - end - add_message "lnrpc.NodeInfo" do - optional :node, :message, 1, "lnrpc.LightningNode" - optional :num_channels, :uint32, 2 - optional :total_capacity, :int64, 3 - repeated :channels, :message, 4, "lnrpc.ChannelEdge" - end - add_message "lnrpc.LightningNode" do - optional :last_update, :uint32, 1 - optional :pub_key, :string, 2 - optional :alias, :string, 3 - repeated :addresses, :message, 4, "lnrpc.NodeAddress" - optional :color, :string, 5 - map :features, :uint32, :message, 6, "lnrpc.Feature" - end - add_message "lnrpc.NodeAddress" do - optional :network, :string, 1 - optional :addr, :string, 2 - end - add_message "lnrpc.RoutingPolicy" do - optional :time_lock_delta, :uint32, 1 - optional :min_htlc, :int64, 2 - optional :fee_base_msat, :int64, 3 - optional :fee_rate_milli_msat, :int64, 4 - optional :disabled, :bool, 5 - optional :max_htlc_msat, :uint64, 6 - optional :last_update, :uint32, 7 - end - add_message "lnrpc.ChannelEdge" do - optional :channel_id, :uint64, 1 - optional :chan_point, :string, 2 - optional :last_update, :uint32, 3 - optional :node1_pub, :string, 4 - optional :node2_pub, :string, 5 - optional :capacity, :int64, 6 - optional :node1_policy, :message, 7, "lnrpc.RoutingPolicy" - optional :node2_policy, :message, 8, "lnrpc.RoutingPolicy" - end - add_message "lnrpc.ChannelGraphRequest" do - optional :include_unannounced, :bool, 1 - end - add_message "lnrpc.ChannelGraph" do - repeated :nodes, :message, 1, "lnrpc.LightningNode" - repeated :edges, :message, 2, "lnrpc.ChannelEdge" - end - add_message "lnrpc.NodeMetricsRequest" do - repeated :types, :enum, 1, "lnrpc.NodeMetricType" - end - add_message "lnrpc.NodeMetricsResponse" do - map :betweenness_centrality, :string, :message, 1, "lnrpc.FloatMetric" - end - add_message "lnrpc.FloatMetric" do - optional :value, :double, 1 - optional :normalized_value, :double, 2 - end - add_message "lnrpc.ChanInfoRequest" do - optional :chan_id, :uint64, 1 - end - add_message "lnrpc.NetworkInfoRequest" do - end - add_message "lnrpc.NetworkInfo" do - optional :graph_diameter, :uint32, 1 - optional :avg_out_degree, :double, 2 - optional :max_out_degree, :uint32, 3 - optional :num_nodes, :uint32, 4 - optional :num_channels, :uint32, 5 - optional :total_network_capacity, :int64, 6 - optional :avg_channel_size, :double, 7 - optional :min_channel_size, :int64, 8 - optional :max_channel_size, :int64, 9 - optional :median_channel_size_sat, :int64, 10 - optional :num_zombie_chans, :uint64, 11 - end - add_message "lnrpc.StopRequest" do - end - add_message "lnrpc.StopResponse" do - end - add_message "lnrpc.GraphTopologySubscription" do - end - add_message "lnrpc.GraphTopologyUpdate" do - repeated :node_updates, :message, 1, "lnrpc.NodeUpdate" - repeated :channel_updates, :message, 2, "lnrpc.ChannelEdgeUpdate" - repeated :closed_chans, :message, 3, "lnrpc.ClosedChannelUpdate" - end - add_message "lnrpc.NodeUpdate" do - repeated :addresses, :string, 1 - optional :identity_key, :string, 2 - optional :global_features, :bytes, 3 - optional :alias, :string, 4 - optional :color, :string, 5 - end - add_message "lnrpc.ChannelEdgeUpdate" do - optional :chan_id, :uint64, 1 - optional :chan_point, :message, 2, "lnrpc.ChannelPoint" - optional :capacity, :int64, 3 - optional :routing_policy, :message, 4, "lnrpc.RoutingPolicy" - optional :advertising_node, :string, 5 - optional :connecting_node, :string, 6 - end - add_message "lnrpc.ClosedChannelUpdate" do - optional :chan_id, :uint64, 1 - optional :capacity, :int64, 2 - optional :closed_height, :uint32, 3 - optional :chan_point, :message, 4, "lnrpc.ChannelPoint" - end - add_message "lnrpc.HopHint" do - optional :node_id, :string, 1 - optional :chan_id, :uint64, 2 - optional :fee_base_msat, :uint32, 3 - optional :fee_proportional_millionths, :uint32, 4 - optional :cltv_expiry_delta, :uint32, 5 - end - add_message "lnrpc.RouteHint" do - repeated :hop_hints, :message, 1, "lnrpc.HopHint" - end - add_message "lnrpc.Invoice" do - optional :memo, :string, 1 - optional :r_preimage, :bytes, 3 - optional :r_hash, :bytes, 4 - optional :value, :int64, 5 - optional :value_msat, :int64, 23 - optional :settled, :bool, 6 - optional :creation_date, :int64, 7 - optional :settle_date, :int64, 8 - optional :payment_request, :string, 9 - optional :description_hash, :bytes, 10 - optional :expiry, :int64, 11 - optional :fallback_addr, :string, 12 - optional :cltv_expiry, :uint64, 13 - repeated :route_hints, :message, 14, "lnrpc.RouteHint" - optional :private, :bool, 15 - optional :add_index, :uint64, 16 - optional :settle_index, :uint64, 17 - optional :amt_paid, :int64, 18 - optional :amt_paid_sat, :int64, 19 - optional :amt_paid_msat, :int64, 20 - optional :state, :enum, 21, "lnrpc.Invoice.InvoiceState" - repeated :htlcs, :message, 22, "lnrpc.InvoiceHTLC" - map :features, :uint32, :message, 24, "lnrpc.Feature" - optional :is_keysend, :bool, 25 - end - add_enum "lnrpc.Invoice.InvoiceState" do - value :OPEN, 0 - value :SETTLED, 1 - value :CANCELED, 2 - value :ACCEPTED, 3 - end - add_message "lnrpc.InvoiceHTLC" do - optional :chan_id, :uint64, 1 - optional :htlc_index, :uint64, 2 - optional :amt_msat, :uint64, 3 - optional :accept_height, :int32, 4 - optional :accept_time, :int64, 5 - optional :resolve_time, :int64, 6 - optional :expiry_height, :int32, 7 - optional :state, :enum, 8, "lnrpc.InvoiceHTLCState" - map :custom_records, :uint64, :bytes, 9 - optional :mpp_total_amt_msat, :uint64, 10 - end - add_message "lnrpc.AddInvoiceResponse" do - optional :r_hash, :bytes, 1 - optional :payment_request, :string, 2 - optional :add_index, :uint64, 16 - end - add_message "lnrpc.PaymentHash" do - optional :r_hash_str, :string, 1 - optional :r_hash, :bytes, 2 - end - add_message "lnrpc.ListInvoiceRequest" do - optional :pending_only, :bool, 1 - optional :index_offset, :uint64, 4 - optional :num_max_invoices, :uint64, 5 - optional :reversed, :bool, 6 - end - add_message "lnrpc.ListInvoiceResponse" do - repeated :invoices, :message, 1, "lnrpc.Invoice" - optional :last_index_offset, :uint64, 2 - optional :first_index_offset, :uint64, 3 - end - add_message "lnrpc.InvoiceSubscription" do - optional :add_index, :uint64, 1 - optional :settle_index, :uint64, 2 - end - add_message "lnrpc.Payment" do - optional :payment_hash, :string, 1 - optional :value, :int64, 2 - optional :creation_date, :int64, 3 - optional :fee, :int64, 5 - optional :payment_preimage, :string, 6 - optional :value_sat, :int64, 7 - optional :value_msat, :int64, 8 - optional :payment_request, :string, 9 - optional :status, :enum, 10, "lnrpc.Payment.PaymentStatus" - optional :fee_sat, :int64, 11 - optional :fee_msat, :int64, 12 - optional :creation_time_ns, :int64, 13 - repeated :htlcs, :message, 14, "lnrpc.HTLCAttempt" - optional :payment_index, :uint64, 15 - optional :failure_reason, :enum, 16, "lnrpc.PaymentFailureReason" - end - add_enum "lnrpc.Payment.PaymentStatus" do - value :UNKNOWN, 0 - value :IN_FLIGHT, 1 - value :SUCCEEDED, 2 - value :FAILED, 3 - end - add_message "lnrpc.HTLCAttempt" do - optional :status, :enum, 1, "lnrpc.HTLCAttempt.HTLCStatus" - optional :route, :message, 2, "lnrpc.Route" - optional :attempt_time_ns, :int64, 3 - optional :resolve_time_ns, :int64, 4 - optional :failure, :message, 5, "lnrpc.Failure" - end - add_enum "lnrpc.HTLCAttempt.HTLCStatus" do - value :IN_FLIGHT, 0 - value :SUCCEEDED, 1 - value :FAILED, 2 - end - add_message "lnrpc.ListPaymentsRequest" do - optional :include_incomplete, :bool, 1 - optional :index_offset, :uint64, 2 - optional :max_payments, :uint64, 3 - optional :reversed, :bool, 4 - end - add_message "lnrpc.ListPaymentsResponse" do - repeated :payments, :message, 1, "lnrpc.Payment" - optional :first_index_offset, :uint64, 2 - optional :last_index_offset, :uint64, 3 - end - add_message "lnrpc.DeleteAllPaymentsRequest" do - end - add_message "lnrpc.DeleteAllPaymentsResponse" do - end - add_message "lnrpc.AbandonChannelRequest" do - optional :channel_point, :message, 1, "lnrpc.ChannelPoint" - end - add_message "lnrpc.AbandonChannelResponse" do - end - add_message "lnrpc.DebugLevelRequest" do - optional :show, :bool, 1 - optional :level_spec, :string, 2 - end - add_message "lnrpc.DebugLevelResponse" do - optional :sub_systems, :string, 1 - end - add_message "lnrpc.PayReqString" do - optional :pay_req, :string, 1 - end - add_message "lnrpc.PayReq" do - optional :destination, :string, 1 - optional :payment_hash, :string, 2 - optional :num_satoshis, :int64, 3 - optional :timestamp, :int64, 4 - optional :expiry, :int64, 5 - optional :description, :string, 6 - optional :description_hash, :string, 7 - optional :fallback_addr, :string, 8 - optional :cltv_expiry, :int64, 9 - repeated :route_hints, :message, 10, "lnrpc.RouteHint" - optional :payment_addr, :bytes, 11 - optional :num_msat, :int64, 12 - map :features, :uint32, :message, 13, "lnrpc.Feature" - end - add_message "lnrpc.Feature" do - optional :name, :string, 2 - optional :is_required, :bool, 3 - optional :is_known, :bool, 4 - end - add_message "lnrpc.FeeReportRequest" do - end - add_message "lnrpc.ChannelFeeReport" do - optional :chan_id, :uint64, 5 - optional :channel_point, :string, 1 - optional :base_fee_msat, :int64, 2 - optional :fee_per_mil, :int64, 3 - optional :fee_rate, :double, 4 - end - add_message "lnrpc.FeeReportResponse" do - repeated :channel_fees, :message, 1, "lnrpc.ChannelFeeReport" - optional :day_fee_sum, :uint64, 2 - optional :week_fee_sum, :uint64, 3 - optional :month_fee_sum, :uint64, 4 - end - add_message "lnrpc.PolicyUpdateRequest" do - optional :base_fee_msat, :int64, 3 - optional :fee_rate, :double, 4 - optional :time_lock_delta, :uint32, 5 - optional :max_htlc_msat, :uint64, 6 - optional :min_htlc_msat, :uint64, 7 - optional :min_htlc_msat_specified, :bool, 8 - oneof :scope do - optional :global, :bool, 1 - optional :chan_point, :message, 2, "lnrpc.ChannelPoint" - end - end - add_message "lnrpc.PolicyUpdateResponse" do - end - add_message "lnrpc.ForwardingHistoryRequest" do - optional :start_time, :uint64, 1 - optional :end_time, :uint64, 2 - optional :index_offset, :uint32, 3 - optional :num_max_events, :uint32, 4 - end - add_message "lnrpc.ForwardingEvent" do - optional :timestamp, :uint64, 1 - optional :chan_id_in, :uint64, 2 - optional :chan_id_out, :uint64, 4 - optional :amt_in, :uint64, 5 - optional :amt_out, :uint64, 6 - optional :fee, :uint64, 7 - optional :fee_msat, :uint64, 8 - optional :amt_in_msat, :uint64, 9 - optional :amt_out_msat, :uint64, 10 - end - add_message "lnrpc.ForwardingHistoryResponse" do - repeated :forwarding_events, :message, 1, "lnrpc.ForwardingEvent" - optional :last_offset_index, :uint32, 2 - end - add_message "lnrpc.ExportChannelBackupRequest" do - optional :chan_point, :message, 1, "lnrpc.ChannelPoint" - end - add_message "lnrpc.ChannelBackup" do - optional :chan_point, :message, 1, "lnrpc.ChannelPoint" - optional :chan_backup, :bytes, 2 - end - add_message "lnrpc.MultiChanBackup" do - repeated :chan_points, :message, 1, "lnrpc.ChannelPoint" - optional :multi_chan_backup, :bytes, 2 - end - add_message "lnrpc.ChanBackupExportRequest" do - end - add_message "lnrpc.ChanBackupSnapshot" do - optional :single_chan_backups, :message, 1, "lnrpc.ChannelBackups" - optional :multi_chan_backup, :message, 2, "lnrpc.MultiChanBackup" - end - add_message "lnrpc.ChannelBackups" do - repeated :chan_backups, :message, 1, "lnrpc.ChannelBackup" - end - add_message "lnrpc.RestoreChanBackupRequest" do - oneof :backup do - optional :chan_backups, :message, 1, "lnrpc.ChannelBackups" - optional :multi_chan_backup, :bytes, 2 - end - end - add_message "lnrpc.RestoreBackupResponse" do - end - add_message "lnrpc.ChannelBackupSubscription" do - end - add_message "lnrpc.VerifyChanBackupResponse" do - end - add_message "lnrpc.MacaroonPermission" do - optional :entity, :string, 1 - optional :action, :string, 2 - end - add_message "lnrpc.BakeMacaroonRequest" do - repeated :permissions, :message, 1, "lnrpc.MacaroonPermission" - end - add_message "lnrpc.BakeMacaroonResponse" do - optional :macaroon, :string, 1 - end - add_message "lnrpc.Failure" do - optional :code, :enum, 1, "lnrpc.Failure.FailureCode" - optional :channel_update, :message, 3, "lnrpc.ChannelUpdate" - optional :htlc_msat, :uint64, 4 - optional :onion_sha_256, :bytes, 5 - optional :cltv_expiry, :uint32, 6 - optional :flags, :uint32, 7 - optional :failure_source_index, :uint32, 8 - optional :height, :uint32, 9 - end - add_enum "lnrpc.Failure.FailureCode" do - value :RESERVED, 0 - value :INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS, 1 - value :INCORRECT_PAYMENT_AMOUNT, 2 - value :FINAL_INCORRECT_CLTV_EXPIRY, 3 - value :FINAL_INCORRECT_HTLC_AMOUNT, 4 - value :FINAL_EXPIRY_TOO_SOON, 5 - value :INVALID_REALM, 6 - value :EXPIRY_TOO_SOON, 7 - value :INVALID_ONION_VERSION, 8 - value :INVALID_ONION_HMAC, 9 - value :INVALID_ONION_KEY, 10 - value :AMOUNT_BELOW_MINIMUM, 11 - value :FEE_INSUFFICIENT, 12 - value :INCORRECT_CLTV_EXPIRY, 13 - value :CHANNEL_DISABLED, 14 - value :TEMPORARY_CHANNEL_FAILURE, 15 - value :REQUIRED_NODE_FEATURE_MISSING, 16 - value :REQUIRED_CHANNEL_FEATURE_MISSING, 17 - value :UNKNOWN_NEXT_PEER, 18 - value :TEMPORARY_NODE_FAILURE, 19 - value :PERMANENT_NODE_FAILURE, 20 - value :PERMANENT_CHANNEL_FAILURE, 21 - value :EXPIRY_TOO_FAR, 22 - value :MPP_TIMEOUT, 23 - value :INTERNAL_FAILURE, 997 - value :UNKNOWN_FAILURE, 998 - value :UNREADABLE_FAILURE, 999 - end - add_message "lnrpc.ChannelUpdate" do - optional :signature, :bytes, 1 - optional :chain_hash, :bytes, 2 - optional :chan_id, :uint64, 3 - optional :timestamp, :uint32, 4 - optional :message_flags, :uint32, 10 - optional :channel_flags, :uint32, 5 - optional :time_lock_delta, :uint32, 6 - optional :htlc_minimum_msat, :uint64, 7 - optional :base_fee, :uint32, 8 - optional :fee_rate, :uint32, 9 - optional :htlc_maximum_msat, :uint64, 11 - optional :extra_opaque_data, :bytes, 12 - end - add_enum "lnrpc.AddressType" do - value :WITNESS_PUBKEY_HASH, 0 - value :NESTED_PUBKEY_HASH, 1 - value :UNUSED_WITNESS_PUBKEY_HASH, 2 - value :UNUSED_NESTED_PUBKEY_HASH, 3 - end - add_enum "lnrpc.CommitmentType" do - value :LEGACY, 0 - value :STATIC_REMOTE_KEY, 1 - value :ANCHORS, 2 - value :UNKNOWN_COMMITMENT_TYPE, 999 - end - add_enum "lnrpc.Initiator" do - value :INITIATOR_UNKNOWN, 0 - value :INITIATOR_LOCAL, 1 - value :INITIATOR_REMOTE, 2 - value :INITIATOR_BOTH, 3 - end - add_enum "lnrpc.NodeMetricType" do - value :UNKNOWN, 0 - value :BETWEENNESS_CENTRALITY, 1 - end - add_enum "lnrpc.InvoiceHTLCState" do - value :ACCEPTED, 0 - value :SETTLED, 1 - value :CANCELED, 2 - end - add_enum "lnrpc.PaymentFailureReason" do - value :FAILURE_REASON_NONE, 0 - value :FAILURE_REASON_TIMEOUT, 1 - value :FAILURE_REASON_NO_ROUTE, 2 - value :FAILURE_REASON_ERROR, 3 - value :FAILURE_REASON_INCORRECT_PAYMENT_DETAILS, 4 - value :FAILURE_REASON_INSUFFICIENT_BALANCE, 5 - end - add_enum "lnrpc.FeatureBit" do - value :DATALOSS_PROTECT_REQ, 0 - value :DATALOSS_PROTECT_OPT, 1 - value :INITIAL_ROUING_SYNC, 3 - value :UPFRONT_SHUTDOWN_SCRIPT_REQ, 4 - value :UPFRONT_SHUTDOWN_SCRIPT_OPT, 5 - value :GOSSIP_QUERIES_REQ, 6 - value :GOSSIP_QUERIES_OPT, 7 - value :TLV_ONION_REQ, 8 - value :TLV_ONION_OPT, 9 - value :EXT_GOSSIP_QUERIES_REQ, 10 - value :EXT_GOSSIP_QUERIES_OPT, 11 - value :STATIC_REMOTE_KEY_REQ, 12 - value :STATIC_REMOTE_KEY_OPT, 13 - value :PAYMENT_ADDR_REQ, 14 - value :PAYMENT_ADDR_OPT, 15 - value :MPP_REQ, 16 - value :MPP_OPT, 17 - end -end - -module Lnrpc - GenSeedRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GenSeedRequest").msgclass - GenSeedResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GenSeedResponse").msgclass - InitWalletRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.InitWalletRequest").msgclass - InitWalletResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.InitWalletResponse").msgclass - UnlockWalletRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.UnlockWalletRequest").msgclass - UnlockWalletResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.UnlockWalletResponse").msgclass - ChangePasswordRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChangePasswordRequest").msgclass - ChangePasswordResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChangePasswordResponse").msgclass - Utxo = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Utxo").msgclass - Transaction = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Transaction").msgclass - GetTransactionsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GetTransactionsRequest").msgclass - TransactionDetails = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.TransactionDetails").msgclass - FeeLimit = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FeeLimit").msgclass - SendRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendRequest").msgclass - SendResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendResponse").msgclass - SendToRouteRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendToRouteRequest").msgclass - ChannelAcceptRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelAcceptRequest").msgclass - ChannelAcceptResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelAcceptResponse").msgclass - ChannelPoint = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelPoint").msgclass - OutPoint = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.OutPoint").msgclass - LightningAddress = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.LightningAddress").msgclass - EstimateFeeRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.EstimateFeeRequest").msgclass - EstimateFeeResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.EstimateFeeResponse").msgclass - SendManyRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendManyRequest").msgclass - SendManyResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendManyResponse").msgclass - SendCoinsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendCoinsRequest").msgclass - SendCoinsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SendCoinsResponse").msgclass - ListUnspentRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListUnspentRequest").msgclass - ListUnspentResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListUnspentResponse").msgclass - NewAddressRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NewAddressRequest").msgclass - NewAddressResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NewAddressResponse").msgclass - SignMessageRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SignMessageRequest").msgclass - SignMessageResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.SignMessageResponse").msgclass - VerifyMessageRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.VerifyMessageRequest").msgclass - VerifyMessageResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.VerifyMessageResponse").msgclass - ConnectPeerRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ConnectPeerRequest").msgclass - ConnectPeerResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ConnectPeerResponse").msgclass - DisconnectPeerRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DisconnectPeerRequest").msgclass - DisconnectPeerResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DisconnectPeerResponse").msgclass - HTLC = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.HTLC").msgclass - Channel = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Channel").msgclass - ListChannelsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListChannelsRequest").msgclass - ListChannelsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListChannelsResponse").msgclass - ChannelCloseSummary = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelCloseSummary").msgclass - ChannelCloseSummary::ClosureType = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelCloseSummary.ClosureType").enummodule - ClosedChannelsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ClosedChannelsRequest").msgclass - ClosedChannelsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ClosedChannelsResponse").msgclass - Peer = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Peer").msgclass - Peer::SyncType = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Peer.SyncType").enummodule - TimestampedError = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.TimestampedError").msgclass - ListPeersRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListPeersRequest").msgclass - ListPeersResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListPeersResponse").msgclass - PeerEventSubscription = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PeerEventSubscription").msgclass - PeerEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PeerEvent").msgclass - PeerEvent::EventType = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PeerEvent.EventType").enummodule - GetInfoRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GetInfoRequest").msgclass - GetInfoResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GetInfoResponse").msgclass - Chain = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Chain").msgclass - ConfirmationUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ConfirmationUpdate").msgclass - ChannelOpenUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelOpenUpdate").msgclass - ChannelCloseUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelCloseUpdate").msgclass - CloseChannelRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.CloseChannelRequest").msgclass - CloseStatusUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.CloseStatusUpdate").msgclass - PendingUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingUpdate").msgclass - ReadyForPsbtFunding = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ReadyForPsbtFunding").msgclass - OpenChannelRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.OpenChannelRequest").msgclass - OpenStatusUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.OpenStatusUpdate").msgclass - KeyLocator = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.KeyLocator").msgclass - KeyDescriptor = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.KeyDescriptor").msgclass - ChanPointShim = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChanPointShim").msgclass - PsbtShim = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PsbtShim").msgclass - FundingShim = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingShim").msgclass - FundingShimCancel = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingShimCancel").msgclass - FundingPsbtVerify = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingPsbtVerify").msgclass - FundingPsbtFinalize = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingPsbtFinalize").msgclass - FundingTransitionMsg = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingTransitionMsg").msgclass - FundingStateStepResp = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FundingStateStepResp").msgclass - PendingHTLC = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingHTLC").msgclass - PendingChannelsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsRequest").msgclass - PendingChannelsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse").msgclass - PendingChannelsResponse::PendingChannel = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.PendingChannel").msgclass - PendingChannelsResponse::PendingOpenChannel = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.PendingOpenChannel").msgclass - PendingChannelsResponse::WaitingCloseChannel = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.WaitingCloseChannel").msgclass - PendingChannelsResponse::Commitments = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.Commitments").msgclass - PendingChannelsResponse::ClosedChannel = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.ClosedChannel").msgclass - PendingChannelsResponse::ForceClosedChannel = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.ForceClosedChannel").msgclass - PendingChannelsResponse::ForceClosedChannel::AnchorState = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PendingChannelsResponse.ForceClosedChannel.AnchorState").enummodule - ChannelEventSubscription = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelEventSubscription").msgclass - ChannelEventUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelEventUpdate").msgclass - ChannelEventUpdate::UpdateType = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelEventUpdate.UpdateType").enummodule - WalletBalanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.WalletBalanceRequest").msgclass - WalletBalanceResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.WalletBalanceResponse").msgclass - ChannelBalanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelBalanceRequest").msgclass - ChannelBalanceResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelBalanceResponse").msgclass - QueryRoutesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.QueryRoutesRequest").msgclass - NodePair = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodePair").msgclass - EdgeLocator = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.EdgeLocator").msgclass - QueryRoutesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.QueryRoutesResponse").msgclass - Hop = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Hop").msgclass - MPPRecord = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.MPPRecord").msgclass - Route = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Route").msgclass - NodeInfoRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeInfoRequest").msgclass - NodeInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeInfo").msgclass - LightningNode = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.LightningNode").msgclass - NodeAddress = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeAddress").msgclass - RoutingPolicy = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.RoutingPolicy").msgclass - ChannelEdge = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelEdge").msgclass - ChannelGraphRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelGraphRequest").msgclass - ChannelGraph = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelGraph").msgclass - NodeMetricsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeMetricsRequest").msgclass - NodeMetricsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeMetricsResponse").msgclass - FloatMetric = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FloatMetric").msgclass - ChanInfoRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChanInfoRequest").msgclass - NetworkInfoRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NetworkInfoRequest").msgclass - NetworkInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NetworkInfo").msgclass - StopRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.StopRequest").msgclass - StopResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.StopResponse").msgclass - GraphTopologySubscription = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GraphTopologySubscription").msgclass - GraphTopologyUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.GraphTopologyUpdate").msgclass - NodeUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeUpdate").msgclass - ChannelEdgeUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelEdgeUpdate").msgclass - ClosedChannelUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ClosedChannelUpdate").msgclass - HopHint = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.HopHint").msgclass - RouteHint = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.RouteHint").msgclass - Invoice = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Invoice").msgclass - Invoice::InvoiceState = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Invoice.InvoiceState").enummodule - InvoiceHTLC = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.InvoiceHTLC").msgclass - AddInvoiceResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.AddInvoiceResponse").msgclass - PaymentHash = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PaymentHash").msgclass - ListInvoiceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListInvoiceRequest").msgclass - ListInvoiceResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListInvoiceResponse").msgclass - InvoiceSubscription = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.InvoiceSubscription").msgclass - Payment = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Payment").msgclass - Payment::PaymentStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Payment.PaymentStatus").enummodule - HTLCAttempt = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.HTLCAttempt").msgclass - HTLCAttempt::HTLCStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.HTLCAttempt.HTLCStatus").enummodule - ListPaymentsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListPaymentsRequest").msgclass - ListPaymentsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListPaymentsResponse").msgclass - DeleteAllPaymentsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DeleteAllPaymentsRequest").msgclass - DeleteAllPaymentsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DeleteAllPaymentsResponse").msgclass - AbandonChannelRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.AbandonChannelRequest").msgclass - AbandonChannelResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.AbandonChannelResponse").msgclass - DebugLevelRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DebugLevelRequest").msgclass - DebugLevelResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DebugLevelResponse").msgclass - PayReqString = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PayReqString").msgclass - PayReq = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PayReq").msgclass - Feature = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Feature").msgclass - FeeReportRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FeeReportRequest").msgclass - ChannelFeeReport = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelFeeReport").msgclass - FeeReportResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FeeReportResponse").msgclass - PolicyUpdateRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PolicyUpdateRequest").msgclass - PolicyUpdateResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PolicyUpdateResponse").msgclass - ForwardingHistoryRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ForwardingHistoryRequest").msgclass - ForwardingEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ForwardingEvent").msgclass - ForwardingHistoryResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ForwardingHistoryResponse").msgclass - ExportChannelBackupRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ExportChannelBackupRequest").msgclass - ChannelBackup = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelBackup").msgclass - MultiChanBackup = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.MultiChanBackup").msgclass - ChanBackupExportRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChanBackupExportRequest").msgclass - ChanBackupSnapshot = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChanBackupSnapshot").msgclass - ChannelBackups = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelBackups").msgclass - RestoreChanBackupRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.RestoreChanBackupRequest").msgclass - RestoreBackupResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.RestoreBackupResponse").msgclass - ChannelBackupSubscription = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelBackupSubscription").msgclass - VerifyChanBackupResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.VerifyChanBackupResponse").msgclass - MacaroonPermission = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.MacaroonPermission").msgclass - BakeMacaroonRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.BakeMacaroonRequest").msgclass - BakeMacaroonResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.BakeMacaroonResponse").msgclass - Failure = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Failure").msgclass - Failure::FailureCode = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Failure.FailureCode").enummodule - ChannelUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ChannelUpdate").msgclass - AddressType = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.AddressType").enummodule - CommitmentType = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.CommitmentType").enummodule - Initiator = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Initiator").enummodule - NodeMetricType = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.NodeMetricType").enummodule - InvoiceHTLCState = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.InvoiceHTLCState").enummodule - PaymentFailureReason = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.PaymentFailureReason").enummodule - FeatureBit = Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.FeatureBit").enummodule -end diff --git a/lnrpc.gemspec b/lnrpc.gemspec index f39698f..89ab503 100644 --- a/lnrpc.gemspec +++ b/lnrpc.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |spec| end spec.bindir = "exe" spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } - spec.require_paths = ["lib"] + spec.require_paths = ["lib", "lib/grpc_services"] spec.add_development_dependency "bundler", "~> 1.17" spec.add_development_dependency "rake", "~> 13.0"