mirror of
https://github.com/bumi/lnrpc
synced 2026-02-14 15:27:50 +00:00
Add support for v0.11 GRPC services
This also refactors the client GRPC wrapper to dynamically load the request objects. All GRPC generated client files now live under lib/grpc_services
This commit is contained in:
229
lib/grpc_services/routerrpc/router_pb.rb
Normal file
229
lib/grpc_services/routerrpc/router_pb.rb
Normal file
@@ -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
|
||||
86
lib/grpc_services/routerrpc/router_services_pb.rb
Normal file
86
lib/grpc_services/routerrpc/router_services_pb.rb
Normal file
@@ -0,0 +1,86 @@
|
||||
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
# Source: routerrpc/router.proto for package 'routerrpc'
|
||||
|
||||
require 'grpc'
|
||||
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
|
||||
|
||||
self.marshal_class_method = :encode
|
||||
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
|
||||
#
|
||||
# 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
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user