1
0
mirror of https://github.com/bumi/lnrpc synced 2026-02-20 09:27:50 +00:00

1 Commits

Author SHA1 Message Date
9b1499616d Add PaymentResponse wrapper
This is an experimental wrapper around the send_payment shortcut calls.
The goal is to provide a simple interface to check if the payment was
successful.
2020-08-29 19:40:45 +02:00
25 changed files with 193 additions and 570 deletions

View File

@@ -1,43 +1,43 @@
PATH
remote: .
specs:
lnrpc (0.11.1)
google-protobuf (>= 3.12)
grpc (>= 1.28.0)
lnrpc (0.10.0)
google-protobuf (>= 3.7)
grpc (>= 1.19.0)
GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.4.4)
google-protobuf (3.17.3)
googleapis-common-protos-types (1.1.0)
google-protobuf (~> 3.14)
grpc (1.38.0)
google-protobuf (~> 3.15)
diff-lcs (1.3)
google-protobuf (3.9.2)
googleapis-common-protos-types (1.0.4)
google-protobuf (~> 3.0)
grpc (1.24.0)
google-protobuf (~> 3.8)
googleapis-common-protos-types (~> 1.0)
rake (13.0.6)
rspec (3.10.0)
rspec-core (~> 3.10.0)
rspec-expectations (~> 3.10.0)
rspec-mocks (~> 3.10.0)
rspec-core (3.10.1)
rspec-support (~> 3.10.0)
rspec-expectations (3.10.1)
rake (13.0.1)
rspec (3.9.0)
rspec-core (~> 3.9.0)
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-core (3.9.0)
rspec-support (~> 3.9.0)
rspec-expectations (3.9.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-mocks (3.10.2)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.10.0)
rspec-support (3.10.2)
rspec-support (~> 3.9.0)
rspec-support (3.9.0)
PLATFORMS
ruby
DEPENDENCIES
bundler (> 2.0)
bundler (~> 1.17)
lnrpc!
rake (~> 13.0)
rspec (~> 3.0)
BUNDLED WITH
2.1.4
1.17.3

View File

@@ -5,13 +5,13 @@ a [gRPC](https://grpc.io/) client for [LND, the Lightning Network Daemon](https:
## Installation
Note: there is still an GRPC/protobuf [issue with Ruby 2.7](https://github.com/protocolbuffers/protobuf/issues/7070).
Note: there is still an GRPC/protobuf [issue with Ruby 2.7](https://github.com/protocolbuffers/protobuf/issues/7070).
So lnrpc requires Ruby < 2.7.
Add this line to your application's Gemfile:
```ruby
gem 'lnrpc', '~> 0.11.0'
gem 'lnrpc', '~> 0.10.0'
```
lnrpc follows the lnd versioning, thus it is recommended to specify the exact version you need for your lnd node as dependency (see [#Versioning](#Versioning)).
@@ -164,8 +164,6 @@ The files will be stored in `lib/grpc_services`
$ ./generate-grpc-service-files.sh
+ Make sure you have the [grpc-tools](https://rubygems.org/gems/grpc-tools) installed
+ Make sure you have the lnd source in your $GOPATH/src folder
## Other resources

View File

@@ -8,19 +8,12 @@ puts get_info_res.alias
puts lnd.lightning.wallet_balance.total_balance
pay_request = "lntb50u1pw9mmndpp5nvnff958pxc9eqknwntyxapjw7l5grt5e2y70cmmnu0lljfa0sdqdpsgfkx7cmtwd68yetpd5s9xct5v4kxc6t5v5s8yatz0ysxwetdcqzysxqyz5vqjkhlyn40z76gyn7dx32p9j58dftve9xrlvnqqazht7w2fdauukhyhr9y4k3ngjn8s6srglj8swk7tm70ng54wdkq47ahytpwffvaeusp500csz"
lnd.pay(payment_request: pay_request) # or:
lnd.pay(pay_request) # or:
lnd.router.send_payment_v2(payment_request: pay_request)
dest = Lnrpc.to_byte_array('038474ec195f497cf4036e5994bd820dd365bb0aaa7fb42bd9b536913a1a2dcc9e')
lnd.keysend(dest: dest, amt: 1000)
invoice_res = lnd.lightning.add_invoice(value: 1000, memo: 'I :heart: ruby')
puts invoice_res.payment_request
puts lnd.versioner.get_version
puts lnd.wallet_kit.estimate_fee(conf_target: 10)
puts lnd.wallet_kit.next_addr
lnd.lightning.subscribe_invoices(settle_index: 1).each do |invoice|
puts invoice.payment_request
end

View File

@@ -11,7 +11,7 @@ module Autopilotrpc
# that can be used when deciding where to open channels.
class Service
include ::GRPC::GenericService
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
@@ -19,20 +19,20 @@ module Autopilotrpc
#
# Status returns whether the daemon's autopilot agent is active.
rpc :Status, ::Autopilotrpc::StatusRequest, ::Autopilotrpc::StatusResponse
rpc :Status, StatusRequest, StatusResponse
#
# ModifyStatus is used to modify the status of the autopilot agent, like
# enabling or disabling it.
rpc :ModifyStatus, ::Autopilotrpc::ModifyStatusRequest, ::Autopilotrpc::ModifyStatusResponse
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, ::Autopilotrpc::QueryScoresRequest, ::Autopilotrpc::QueryScoresResponse
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, ::Autopilotrpc::SetScoresRequest, ::Autopilotrpc::SetScoresResponse
rpc :SetScores, SetScoresRequest, SetScoresResponse
end
Stub = Service.rpc_stub_class

View File

@@ -10,7 +10,7 @@ module Chainrpc
# chain backend by registering notifiers for chain events.
class Service
include ::GRPC::GenericService
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
@@ -24,7 +24,7 @@ module Chainrpc
# 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, ::Chainrpc::ConfRequest, stream(::Chainrpc::ConfEvent)
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
@@ -32,7 +32,7 @@ module Chainrpc
#
# 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, ::Chainrpc::SpendRequest, stream(::Chainrpc::SpendEvent)
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
@@ -43,7 +43,7 @@ module Chainrpc
# 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, ::Chainrpc::BlockEpoch, stream(::Chainrpc::BlockEpoch)
rpc :RegisterBlockEpochNtfn, BlockEpoch, stream(BlockEpoch)
end
Stub = Service.rpc_stub_class

View File

@@ -10,7 +10,7 @@ module Invoicesrpc
# invoices.
class Service
include ::GRPC::GenericService
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
@@ -20,20 +20,20 @@ module Invoicesrpc
# 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, ::Invoicesrpc::SubscribeSingleInvoiceRequest, stream(::Lnrpc::Invoice)
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, ::Invoicesrpc::CancelInvoiceMsg, ::Invoicesrpc::CancelInvoiceResp
rpc :CancelInvoice, CancelInvoiceMsg, CancelInvoiceResp
#
# AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
# supplied in the request.
rpc :AddHoldInvoice, ::Invoicesrpc::AddHoldInvoiceRequest, ::Invoicesrpc::AddHoldInvoiceResp
rpc :AddHoldInvoice, AddHoldInvoiceRequest, AddHoldInvoiceResp
#
# SettleInvoice settles an accepted invoice. If the invoice is already
# settled, this call will succeed.
rpc :SettleInvoice, ::Invoicesrpc::SettleInvoiceMsg, ::Invoicesrpc::SettleInvoiceResp
rpc :SettleInvoice, SettleInvoiceMsg, SettleInvoiceResp
end
Stub = Service.rpc_stub_class

View File

@@ -12,7 +12,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :amt_msat, :int64, 12
optional :payment_hash, :bytes, 3
optional :final_cltv_delta, :int32, 4
optional :payment_addr, :bytes, 20
optional :payment_request, :string, 5
optional :timeout_seconds, :int32, 6
optional :fee_limit_sat, :int64, 7
@@ -27,8 +26,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
repeated :dest_features, :enum, 16, "lnrpc.FeatureBit"
optional :max_parts, :uint32, 17
optional :no_inflight_updates, :bool, 18
optional :max_shard_size_msat, :uint64, 21
optional :amp, :bool, 22
end
add_message "routerrpc.TrackPaymentRequest" do
optional :payment_hash, :bytes, 1
@@ -59,11 +56,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "routerrpc.QueryMissionControlResponse" do
repeated :pairs, :message, 2, "routerrpc.PairHistory"
end
add_message "routerrpc.XImportMissionControlRequest" do
repeated :pairs, :message, 1, "routerrpc.PairHistory"
end
add_message "routerrpc.XImportMissionControlResponse" do
end
add_message "routerrpc.PairHistory" do
optional :node_from, :bytes, 1
optional :node_to, :bytes, 2
@@ -77,23 +69,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :success_amt_sat, :int64, 6
optional :success_amt_msat, :int64, 7
end
add_message "routerrpc.GetMissionControlConfigRequest" do
end
add_message "routerrpc.GetMissionControlConfigResponse" do
optional :config, :message, 1, "routerrpc.MissionControlConfig"
end
add_message "routerrpc.SetMissionControlConfigRequest" do
optional :config, :message, 1, "routerrpc.MissionControlConfig"
end
add_message "routerrpc.SetMissionControlConfigResponse" do
end
add_message "routerrpc.MissionControlConfig" do
optional :half_life_seconds, :uint64, 1
optional :hop_probability, :float, 2
optional :weight, :float, 3
optional :maximum_payment_results, :uint32, 4
optional :minimum_failure_relax_interval, :uint64, 5
end
add_message "routerrpc.QueryProbabilityRequest" do
optional :from_node, :bytes, 1
optional :to_node, :bytes, 2
@@ -108,7 +83,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :final_cltv_delta, :int32, 2
optional :outgoing_chan_id, :uint64, 3
repeated :hop_pubkeys, :bytes, 4
optional :payment_addr, :bytes, 5
end
add_message "routerrpc.BuildRouteResponse" do
optional :route, :message, 1, "lnrpc.Route"
@@ -172,19 +146,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :outgoing_amount_msat, :uint64, 3
optional :outgoing_expiry, :uint32, 4
map :custom_records, :uint64, :bytes, 8
optional :onion_blob, :bytes, 9
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_message "routerrpc.UpdateChanStatusRequest" do
optional :chan_point, :message, 1, "lnrpc.ChannelPoint"
optional :action, :enum, 2, "routerrpc.ChanStatusAction"
end
add_message "routerrpc.UpdateChanStatusResponse" do
end
add_enum "routerrpc.FailureDetail" do
value :UNKNOWN, 0
value :NO_DETAIL, 1
@@ -224,11 +191,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
value :FAIL, 1
value :RESUME, 2
end
add_enum "routerrpc.ChanStatusAction" do
value :ENABLE, 0
value :DISABLE, 1
value :AUTO, 2
end
end
end
@@ -243,15 +205,8 @@ module Routerrpc
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
XImportMissionControlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.XImportMissionControlRequest").msgclass
XImportMissionControlResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.XImportMissionControlResponse").msgclass
PairHistory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PairHistory").msgclass
PairData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.PairData").msgclass
GetMissionControlConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.GetMissionControlConfigRequest").msgclass
GetMissionControlConfigResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.GetMissionControlConfigResponse").msgclass
SetMissionControlConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SetMissionControlConfigRequest").msgclass
SetMissionControlConfigResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.SetMissionControlConfigResponse").msgclass
MissionControlConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.MissionControlConfig").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
@@ -268,10 +223,7 @@ module Routerrpc
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
UpdateChanStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.UpdateChanStatusRequest").msgclass
UpdateChanStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.UpdateChanStatusResponse").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
ChanStatusAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("routerrpc.ChanStatusAction").enummodule
end

View File

@@ -10,7 +10,7 @@ module Routerrpc
# subsystem of the daemon.
class Service
include ::GRPC::GenericService
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
@@ -20,84 +20,65 @@ module Routerrpc
# 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, ::Routerrpc::SendPaymentRequest, stream(::Lnrpc::Payment)
rpc :SendPaymentV2, SendPaymentRequest, stream(Lnrpc::Payment)
#
# TrackPaymentV2 returns an update stream for the payment identified by the
# payment hash.
rpc :TrackPaymentV2, ::Routerrpc::TrackPaymentRequest, stream(::Lnrpc::Payment)
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, ::Routerrpc::RouteFeeRequest, ::Routerrpc::RouteFeeResponse
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, ::Routerrpc::SendToRouteRequest, ::Routerrpc::SendToRouteResponse
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, ::Routerrpc::SendToRouteRequest, ::Lnrpc::HTLCAttempt
rpc :SendToRouteV2, SendToRouteRequest, Lnrpc::HTLCAttempt
#
# ResetMissionControl clears all mission control state and starts with a clean
# slate.
rpc :ResetMissionControl, ::Routerrpc::ResetMissionControlRequest, ::Routerrpc::ResetMissionControlResponse
rpc :ResetMissionControl, ResetMissionControlRequest, ResetMissionControlResponse
#
# QueryMissionControl exposes the internal mission control state to callers.
# It is a development feature.
rpc :QueryMissionControl, ::Routerrpc::QueryMissionControlRequest, ::Routerrpc::QueryMissionControlResponse
#
# XImportMissionControl is an experimental API that imports the state provided
# to the internal mission control's state, using all results which are more
# recent than our existing values. These values will only be imported
# in-memory, and will not be persisted across restarts.
rpc :XImportMissionControl, ::Routerrpc::XImportMissionControlRequest, ::Routerrpc::XImportMissionControlResponse
#
# GetMissionControlConfig returns mission control's current config.
rpc :GetMissionControlConfig, ::Routerrpc::GetMissionControlConfigRequest, ::Routerrpc::GetMissionControlConfigResponse
#
# SetMissionControlConfig will set mission control's config, if the config
# provided is valid.
rpc :SetMissionControlConfig, ::Routerrpc::SetMissionControlConfigRequest, ::Routerrpc::SetMissionControlConfigResponse
rpc :QueryMissionControl, QueryMissionControlRequest, QueryMissionControlResponse
#
# QueryProbability returns the current success probability estimate for a
# given node pair and amount.
rpc :QueryProbability, ::Routerrpc::QueryProbabilityRequest, ::Routerrpc::QueryProbabilityResponse
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, ::Routerrpc::BuildRouteRequest, ::Routerrpc::BuildRouteResponse
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, ::Routerrpc::SubscribeHtlcEventsRequest, stream(::Routerrpc::HtlcEvent)
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, ::Routerrpc::SendPaymentRequest, stream(::Routerrpc::PaymentStatus)
rpc :SendPayment, SendPaymentRequest, stream(PaymentStatus)
#
# Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
# the payment identified by the payment hash.
rpc :TrackPayment, ::Routerrpc::TrackPaymentRequest, stream(::Routerrpc::PaymentStatus)
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(::Routerrpc::ForwardHtlcInterceptResponse), stream(::Routerrpc::ForwardHtlcInterceptRequest)
#
# UpdateChanStatus attempts to manually set the state of a channel
# (enabled, disabled, or auto). A manual "disable" request will cause the
# channel to stay disabled until a subsequent manual request of either
# "enable" or "auto".
rpc :UpdateChanStatus, ::Routerrpc::UpdateChanStatusRequest, ::Routerrpc::UpdateChanStatusResponse
rpc :HtlcInterceptor, stream(ForwardHtlcInterceptResponse), stream(ForwardHtlcInterceptRequest)
end
Stub = Service.rpc_stub_class

View File

@@ -28,7 +28,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "lnrpc.GetTransactionsRequest" do
optional :start_height, :int32, 1
optional :end_height, :int32, 2
optional :account, :string, 3
end
add_message "lnrpc.TransactionDetails" do
repeated :transactions, :message, 1, "lnrpc.Transaction"
@@ -56,7 +55,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
map :dest_custom_records, :uint64, :bytes, 11
optional :allow_self_payment, :bool, 14
repeated :dest_features, :enum, 15, "lnrpc.FeatureBit"
optional :payment_addr, :bytes, 16
end
add_message "lnrpc.SendResponse" do
optional :payment_error, :string, 1
@@ -87,14 +85,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "lnrpc.ChannelAcceptResponse" do
optional :accept, :bool, 1
optional :pending_chan_id, :bytes, 2
optional :error, :string, 3
optional :upfront_shutdown, :string, 4
optional :csv_delay, :uint32, 5
optional :reserve_sat, :uint64, 6
optional :in_flight_max_msat, :uint64, 7
optional :max_htlc_count, :uint32, 8
optional :min_htlc_in, :uint64, 9
optional :min_accept_depth, :uint32, 10
end
add_message "lnrpc.ChannelPoint" do
optional :output_index, :uint32, 3
@@ -115,22 +105,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "lnrpc.EstimateFeeRequest" do
map :AddrToAmount, :string, :int64, 1
optional :target_conf, :int32, 2
optional :min_confs, :int32, 3
optional :spend_unconfirmed, :bool, 4
end
add_message "lnrpc.EstimateFeeResponse" do
optional :fee_sat, :int64, 1
optional :feerate_sat_per_byte, :int64, 2
optional :sat_per_vbyte, :uint64, 3
end
add_message "lnrpc.SendManyRequest" do
map :AddrToAmount, :string, :int64, 1
optional :target_conf, :int32, 3
optional :sat_per_vbyte, :uint64, 4
optional :sat_per_byte, :int64, 5
optional :label, :string, 6
optional :min_confs, :int32, 7
optional :spend_unconfirmed, :bool, 8
end
add_message "lnrpc.SendManyResponse" do
optional :txid, :string, 1
@@ -139,12 +123,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :addr, :string, 1
optional :amount, :int64, 2
optional :target_conf, :int32, 3
optional :sat_per_vbyte, :uint64, 4
optional :sat_per_byte, :int64, 5
optional :send_all, :bool, 6
optional :label, :string, 7
optional :min_confs, :int32, 8
optional :spend_unconfirmed, :bool, 9
end
add_message "lnrpc.SendCoinsResponse" do
optional :txid, :string, 1
@@ -152,14 +133,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "lnrpc.ListUnspentRequest" do
optional :min_confs, :int32, 1
optional :max_confs, :int32, 2
optional :account, :string, 3
end
add_message "lnrpc.ListUnspentResponse" do
repeated :utxos, :message, 1, "lnrpc.Utxo"
end
add_message "lnrpc.NewAddressRequest" do
optional :type, :enum, 1, "lnrpc.AddressType"
optional :account, :string, 2
end
add_message "lnrpc.NewAddressResponse" do
optional :address, :string, 1
@@ -181,7 +160,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "lnrpc.ConnectPeerRequest" do
optional :addr, :message, 1, "lnrpc.LightningAddress"
optional :perm, :bool, 2
optional :timeout, :uint64, 3
end
add_message "lnrpc.ConnectPeerResponse" do
end
@@ -195,9 +173,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :amount, :int64, 2
optional :hash_lock, :bytes, 3
optional :expiration_height, :uint32, 4
optional :htlc_index, :uint64, 5
optional :forwarding_channel, :uint64, 6
optional :forwarding_htlc_index, :uint64, 7
end
add_message "lnrpc.ChannelConstraints" do
optional :csv_delay, :uint32, 1
@@ -302,14 +277,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :sync_type, :enum, 10, "lnrpc.Peer.SyncType"
map :features, :uint32, :message, 11, "lnrpc.Feature"
repeated :errors, :message, 12, "lnrpc.TimestampedError"
optional :flap_count, :int32, 13
optional :last_flap_ns, :int64, 14
end
add_enum "lnrpc.Peer.SyncType" do
value :UNKNOWN_SYNC, 0
value :ACTIVE_SYNC, 1
value :PASSIVE_SYNC, 2
value :PINNED_SYNC, 3
end
add_message "lnrpc.TimestampedError" do
optional :timestamp, :uint64, 1
@@ -382,7 +354,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :target_conf, :int32, 3
optional :sat_per_byte, :int64, 4
optional :delivery_address, :string, 5
optional :sat_per_vbyte, :uint64, 6
end
add_message "lnrpc.CloseStatusUpdate" do
oneof :update do
@@ -400,7 +371,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :psbt, :bytes, 3
end
add_message "lnrpc.OpenChannelRequest" do
optional :sat_per_vbyte, :uint64, 1
optional :node_pubkey, :bytes, 2
optional :node_pubkey_string, :string, 3
optional :local_funding_amount, :int64, 4
@@ -415,8 +385,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :close_address, :string, 13
optional :funding_shim, :message, 14, "lnrpc.FundingShim"
optional :remote_max_value_in_flight_msat, :uint64, 15
optional :remote_max_htlcs, :uint32, 16
optional :max_local_csv, :uint32, 17
end
add_message "lnrpc.OpenStatusUpdate" do
optional :pending_chan_id, :bytes, 4
@@ -463,7 +431,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "lnrpc.FundingPsbtFinalize" do
optional :signed_psbt, :bytes, 1
optional :pending_chan_id, :bytes, 2
optional :final_raw_tx, :bytes, 3
end
add_message "lnrpc.FundingTransitionMsg" do
oneof :trigger do
@@ -561,33 +528,18 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
value :INACTIVE_CHANNEL, 3
value :PENDING_OPEN_CHANNEL, 4
end
add_message "lnrpc.WalletAccountBalance" do
optional :confirmed_balance, :int64, 1
optional :unconfirmed_balance, :int64, 2
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
map :account_balance, :string, :message, 4, "lnrpc.WalletAccountBalance"
end
add_message "lnrpc.Amount" do
optional :sat, :uint64, 1
optional :msat, :uint64, 2
end
add_message "lnrpc.ChannelBalanceRequest" do
end
add_message "lnrpc.ChannelBalanceResponse" do
optional :balance, :int64, 1
optional :pending_open_balance, :int64, 2
optional :local_balance, :message, 3, "lnrpc.Amount"
optional :remote_balance, :message, 4, "lnrpc.Amount"
optional :unsettled_local_balance, :message, 5, "lnrpc.Amount"
optional :unsettled_remote_balance, :message, 6, "lnrpc.Amount"
optional :pending_open_local_balance, :message, 7, "lnrpc.Amount"
optional :pending_open_remote_balance, :message, 8, "lnrpc.Amount"
end
add_message "lnrpc.QueryRoutesRequest" do
optional :pub_key, :string, 1
@@ -630,18 +582,12 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :pub_key, :string, 8
optional :tlv_payload, :bool, 9
optional :mpp_record, :message, 10, "lnrpc.MPPRecord"
optional :amp_record, :message, 12, "lnrpc.AMPRecord"
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.AMPRecord" do
optional :root_share, :bytes, 1
optional :set_id, :bytes, 2
optional :child_index, :uint32, 3
end
add_message "lnrpc.Route" do
optional :total_time_lock, :uint32, 1
optional :total_fees, :int64, 2
@@ -743,8 +689,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :global_features, :bytes, 3
optional :alias, :string, 4
optional :color, :string, 5
repeated :node_addresses, :message, 7, "lnrpc.NodeAddress"
map :features, :uint32, :message, 6, "lnrpc.Feature"
end
add_message "lnrpc.ChannelEdgeUpdate" do
optional :chan_id, :uint64, 1
@@ -795,8 +739,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
repeated :htlcs, :message, 22, "lnrpc.InvoiceHTLC"
map :features, :uint32, :message, 24, "lnrpc.Feature"
optional :is_keysend, :bool, 25
optional :payment_addr, :bytes, 26
optional :is_amp, :bool, 27
end
add_enum "lnrpc.Invoice.InvoiceState" do
value :OPEN, 0
@@ -815,20 +757,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :state, :enum, 8, "lnrpc.InvoiceHTLCState"
map :custom_records, :uint64, :bytes, 9
optional :mpp_total_amt_msat, :uint64, 10
optional :amp, :message, 11, "lnrpc.AMP"
end
add_message "lnrpc.AMP" do
optional :root_share, :bytes, 1
optional :set_id, :bytes, 2
optional :child_index, :uint32, 3
optional :hash, :bytes, 4
optional :preimage, :bytes, 5
end
add_message "lnrpc.AddInvoiceResponse" do
optional :r_hash, :bytes, 1
optional :payment_request, :string, 2
optional :add_index, :uint64, 16
optional :payment_addr, :bytes, 17
end
add_message "lnrpc.PaymentHash" do
optional :r_hash_str, :string, 1
@@ -873,7 +806,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
value :FAILED, 3
end
add_message "lnrpc.HTLCAttempt" do
optional :attempt_id, :uint64, 7
optional :status, :enum, 1, "lnrpc.HTLCAttempt.HTLCStatus"
optional :route, :message, 2, "lnrpc.Route"
optional :attempt_time_ns, :int64, 3
@@ -898,14 +830,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :last_index_offset, :uint64, 3
end
add_message "lnrpc.DeleteAllPaymentsRequest" do
optional :failed_payments_only, :bool, 1
optional :failed_htlcs_only, :bool, 2
end
add_message "lnrpc.DeleteAllPaymentsResponse" do
end
add_message "lnrpc.AbandonChannelRequest" do
optional :channel_point, :message, 1, "lnrpc.ChannelPoint"
optional :pending_funding_shim_only, :bool, 2
end
add_message "lnrpc.AbandonChannelResponse" do
end
@@ -984,7 +913,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :fee_msat, :uint64, 8
optional :amt_in_msat, :uint64, 9
optional :amt_out_msat, :uint64, 10
optional :timestamp_ns, :uint64, 11
end
add_message "lnrpc.ForwardingHistoryResponse" do
repeated :forwarding_events, :message, 1, "lnrpc.ForwardingEvent"
@@ -1028,30 +956,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
end
add_message "lnrpc.BakeMacaroonRequest" do
repeated :permissions, :message, 1, "lnrpc.MacaroonPermission"
optional :root_key_id, :uint64, 2
end
add_message "lnrpc.BakeMacaroonResponse" do
optional :macaroon, :string, 1
end
add_message "lnrpc.ListMacaroonIDsRequest" do
end
add_message "lnrpc.ListMacaroonIDsResponse" do
repeated :root_key_ids, :uint64, 1
end
add_message "lnrpc.DeleteMacaroonIDRequest" do
optional :root_key_id, :uint64, 1
end
add_message "lnrpc.DeleteMacaroonIDResponse" do
optional :deleted, :bool, 1
end
add_message "lnrpc.MacaroonPermissionList" do
repeated :permissions, :message, 1, "lnrpc.MacaroonPermission"
end
add_message "lnrpc.ListPermissionsRequest" do
end
add_message "lnrpc.ListPermissionsResponse" do
map :method_permissions, :string, :message, 1, "lnrpc.MacaroonPermissionList"
end
add_message "lnrpc.Failure" do
optional :code, :enum, 1, "lnrpc.Failure.FailureCode"
optional :channel_update, :message, 3, "lnrpc.ChannelUpdate"
@@ -1087,7 +995,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
value :PERMANENT_CHANNEL_FAILURE, 21
value :EXPIRY_TOO_FAR, 22
value :MPP_TIMEOUT, 23
value :INVALID_ONION_PAYLOAD, 24
value :INTERNAL_FAILURE, 997
value :UNKNOWN_FAILURE, 998
value :UNREADABLE_FAILURE, 999
@@ -1106,15 +1013,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :htlc_maximum_msat, :uint64, 11
optional :extra_opaque_data, :bytes, 12
end
add_message "lnrpc.MacaroonId" do
optional :nonce, :bytes, 1
optional :storageId, :bytes, 2
repeated :ops, :message, 3, "lnrpc.Op"
end
add_message "lnrpc.Op" do
optional :entity, :string, 1
repeated :actions, :string, 2
end
add_enum "lnrpc.AddressType" do
value :WITNESS_PUBKEY_HASH, 0
value :NESTED_PUBKEY_HASH, 1
@@ -1183,14 +1081,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
value :PAYMENT_ADDR_OPT, 15
value :MPP_REQ, 16
value :MPP_OPT, 17
value :WUMBO_CHANNELS_REQ, 18
value :WUMBO_CHANNELS_OPT, 19
value :ANCHORS_REQ, 20
value :ANCHORS_OPT, 21
value :ANCHORS_ZERO_FEE_HTLC_REQ, 22
value :ANCHORS_ZERO_FEE_HTLC_OPT, 23
value :AMP_REQ, 30
value :AMP_OPT, 31
end
end
end
@@ -1282,10 +1172,8 @@ module Lnrpc
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
WalletAccountBalance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.WalletAccountBalance").msgclass
WalletBalanceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.WalletBalanceRequest").msgclass
WalletBalanceResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.WalletBalanceResponse").msgclass
Amount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Amount").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
@@ -1294,7 +1182,6 @@ module Lnrpc
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
AMPRecord = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.AMPRecord").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
@@ -1322,7 +1209,6 @@ module Lnrpc
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
AMP = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.AMP").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
@@ -1364,18 +1250,9 @@ module Lnrpc
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
ListMacaroonIDsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListMacaroonIDsRequest").msgclass
ListMacaroonIDsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListMacaroonIDsResponse").msgclass
DeleteMacaroonIDRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DeleteMacaroonIDRequest").msgclass
DeleteMacaroonIDResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.DeleteMacaroonIDResponse").msgclass
MacaroonPermissionList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.MacaroonPermissionList").msgclass
ListPermissionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListPermissionsRequest").msgclass
ListPermissionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.ListPermissionsResponse").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
MacaroonId = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.MacaroonId").msgclass
Op = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("lnrpc.Op").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

View File

@@ -26,7 +26,7 @@ module Lnrpc
# Lightning is the main RPC server of the daemon.
class Service
include ::GRPC::GenericService
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
@@ -36,16 +36,15 @@ module Lnrpc
# WalletBalance returns total unspent outputs(confirmed and unconfirmed), all
# confirmed unspent outputs and all unconfirmed unspent outputs under control
# of the wallet.
rpc :WalletBalance, ::Lnrpc::WalletBalanceRequest, ::Lnrpc::WalletBalanceResponse
rpc :WalletBalance, WalletBalanceRequest, WalletBalanceResponse
# lncli: `channelbalance`
# ChannelBalance returns a report on the total funds across all open channels,
# categorized in local/remote, pending local/remote and unsettled local/remote
# balances.
rpc :ChannelBalance, ::Lnrpc::ChannelBalanceRequest, ::Lnrpc::ChannelBalanceResponse
# ChannelBalance returns the total funds available across all open channels
# in satoshis.
rpc :ChannelBalance, ChannelBalanceRequest, ChannelBalanceResponse
# lncli: `listchaintxns`
# GetTransactions returns a list describing all the known transactions
# relevant to the wallet.
rpc :GetTransactions, ::Lnrpc::GetTransactionsRequest, ::Lnrpc::TransactionDetails
rpc :GetTransactions, GetTransactionsRequest, TransactionDetails
# lncli: `estimatefee`
# EstimateFee asks the chain backend to estimate the fee rate and total fees
# for a transaction that pays to multiple specified outputs.
@@ -54,73 +53,73 @@ module Lnrpc
# `&AddrToAmount[<address>]=<amount_to_send>` 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, ::Lnrpc::EstimateFeeRequest, ::Lnrpc::EstimateFeeResponse
rpc :EstimateFee, EstimateFeeRequest, EstimateFeeResponse
# 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_vbyte are set, then the internal wallet will
# 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, ::Lnrpc::SendCoinsRequest, ::Lnrpc::SendCoinsResponse
rpc :SendCoins, SendCoinsRequest, SendCoinsResponse
# 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, ::Lnrpc::ListUnspentRequest, ::Lnrpc::ListUnspentResponse
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, ::Lnrpc::GetTransactionsRequest, stream(::Lnrpc::Transaction)
rpc :SubscribeTransactions, GetTransactionsRequest, 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_vbyte are set, then
# 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, ::Lnrpc::SendManyRequest, ::Lnrpc::SendManyResponse
rpc :SendMany, SendManyRequest, SendManyResponse
# lncli: `newaddress`
# NewAddress creates a new address under control of the local wallet.
rpc :NewAddress, ::Lnrpc::NewAddressRequest, ::Lnrpc::NewAddressResponse
rpc :NewAddress, NewAddressRequest, NewAddressResponse
# 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, ::Lnrpc::SignMessageRequest, ::Lnrpc::SignMessageResponse
rpc :SignMessage, SignMessageRequest, SignMessageResponse
# 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, ::Lnrpc::VerifyMessageRequest, ::Lnrpc::VerifyMessageResponse
rpc :VerifyMessage, VerifyMessageRequest, VerifyMessageResponse
# 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, ::Lnrpc::ConnectPeerRequest, ::Lnrpc::ConnectPeerResponse
rpc :ConnectPeer, ConnectPeerRequest, ConnectPeerResponse
# 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, ::Lnrpc::DisconnectPeerRequest, ::Lnrpc::DisconnectPeerResponse
rpc :DisconnectPeer, DisconnectPeerRequest, DisconnectPeerResponse
# lncli: `listpeers`
# ListPeers returns a verbose listing of all currently active peers.
rpc :ListPeers, ::Lnrpc::ListPeersRequest, ::Lnrpc::ListPeersResponse
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, ::Lnrpc::PeerEventSubscription, stream(::Lnrpc::PeerEvent)
rpc :SubscribePeerEvents, PeerEventSubscription, 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, ::Lnrpc::GetInfoRequest, ::Lnrpc::GetInfoResponse
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, ::Lnrpc::GetRecoveryInfoRequest, ::Lnrpc::GetRecoveryInfoResponse
rpc :GetRecoveryInfo, GetRecoveryInfoRequest, GetRecoveryInfoResponse
# TODO(roasbeef): merge with below with bool?
#
# lncli: `pendingchannels`
@@ -128,27 +127,27 @@ module Lnrpc
# 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, ::Lnrpc::PendingChannelsRequest, ::Lnrpc::PendingChannelsResponse
rpc :PendingChannels, PendingChannelsRequest, PendingChannelsResponse
# lncli: `listchannels`
# ListChannels returns a description of all the open channels that this node
# is a participant in.
rpc :ListChannels, ::Lnrpc::ListChannelsRequest, ::Lnrpc::ListChannelsResponse
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, ::Lnrpc::ChannelEventSubscription, stream(::Lnrpc::ChannelEventUpdate)
rpc :SubscribeChannelEvents, ChannelEventSubscription, stream(ChannelEventUpdate)
# lncli: `closedchannels`
# ClosedChannels returns a description of all the closed channels that
# this node was a participant in.
rpc :ClosedChannels, ::Lnrpc::ClosedChannelsRequest, ::Lnrpc::ClosedChannelsResponse
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, ::Lnrpc::OpenChannelRequest, ::Lnrpc::ChannelPoint
rpc :OpenChannelSync, OpenChannelRequest, ChannelPoint
# 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
@@ -158,7 +157,7 @@ module Lnrpc
# 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, ::Lnrpc::OpenChannelRequest, stream(::Lnrpc::OpenStatusUpdate)
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
@@ -168,14 +167,14 @@ module Lnrpc
# 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, ::Lnrpc::FundingTransitionMsg, ::Lnrpc::FundingStateStepResp
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(::Lnrpc::ChannelAcceptResponse), stream(::Lnrpc::ChannelAcceptRequest)
rpc :ChannelAcceptor, stream(ChannelAcceptResponse), 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
@@ -184,44 +183,42 @@ module Lnrpc
# 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, ::Lnrpc::CloseChannelRequest, stream(::Lnrpc::CloseStatusUpdate)
rpc :CloseChannel, CloseChannelRequest, stream(CloseStatusUpdate)
# 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. This method can also be
# used to remove externally funded channels where the funding transaction was
# never broadcast. Only available for non-externally funded channels in dev
# build.
rpc :AbandonChannel, ::Lnrpc::AbandonChannelRequest, ::Lnrpc::AbandonChannelResponse
# 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.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(::Lnrpc::SendRequest), stream(::Lnrpc::SendResponse)
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, ::Lnrpc::SendRequest, ::Lnrpc::SendResponse
rpc :SendPaymentSync, SendRequest, SendResponse
# 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(::Lnrpc::SendToRouteRequest), stream(::Lnrpc::SendResponse)
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, ::Lnrpc::SendToRouteRequest, ::Lnrpc::SendResponse
rpc :SendToRouteSync, SendToRouteRequest, SendResponse
# 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, ::Lnrpc::Invoice, ::Lnrpc::AddInvoiceResponse
rpc :AddInvoice, Invoice, AddInvoiceResponse
# 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
@@ -230,12 +227,12 @@ module Lnrpc
# 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, ::Lnrpc::ListInvoiceRequest, ::Lnrpc::ListInvoiceResponse
rpc :ListInvoices, ListInvoiceRequest, ListInvoiceResponse
# 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, ::Lnrpc::PaymentHash, ::Lnrpc::Invoice
rpc :LookupInvoice, PaymentHash, Invoice
#
# SubscribeInvoices returns a uni-directional stream (server -> client) for
# notifying the client of newly added/settled invoices. The caller can
@@ -246,18 +243,18 @@ module Lnrpc
# 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, ::Lnrpc::InvoiceSubscription, stream(::Lnrpc::Invoice)
rpc :SubscribeInvoices, InvoiceSubscription, stream(Invoice)
# 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, ::Lnrpc::PayReqString, ::Lnrpc::PayReq
rpc :DecodePayReq, PayReqString, PayReq
# lncli: `listpayments`
# ListPayments returns a list of all outgoing payments.
rpc :ListPayments, ::Lnrpc::ListPaymentsRequest, ::Lnrpc::ListPaymentsResponse
rpc :ListPayments, ListPaymentsRequest, ListPaymentsResponse
#
# DeleteAllPayments deletes all outgoing payments from DB.
rpc :DeleteAllPayments, ::Lnrpc::DeleteAllPaymentsRequest, ::Lnrpc::DeleteAllPaymentsResponse
rpc :DeleteAllPayments, DeleteAllPaymentsRequest, DeleteAllPaymentsResponse
# 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
@@ -265,21 +262,21 @@ module Lnrpc
# 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, ::Lnrpc::ChannelGraphRequest, ::Lnrpc::ChannelGraph
rpc :DescribeGraph, ChannelGraphRequest, ChannelGraph
# lncli: `getnodemetrics`
# GetNodeMetrics returns node metrics calculated from the graph. Currently
# the only supported metric is betweenness centrality of individual nodes.
rpc :GetNodeMetrics, ::Lnrpc::NodeMetricsRequest, ::Lnrpc::NodeMetricsResponse
rpc :GetNodeMetrics, NodeMetricsRequest, NodeMetricsResponse
# 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, ::Lnrpc::ChanInfoRequest, ::Lnrpc::ChannelEdge
rpc :GetChanInfo, ChanInfoRequest, ChannelEdge
# lncli: `getnodeinfo`
# GetNodeInfo returns the latest advertised, aggregated, and authenticated
# channel information for the specified node identified by its public key.
rpc :GetNodeInfo, ::Lnrpc::NodeInfoRequest, ::Lnrpc::NodeInfo
rpc :GetNodeInfo, NodeInfoRequest, NodeInfo
# 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
@@ -291,15 +288,15 @@ module Lnrpc
# `&dest_custom_records[<record_number>]=<record_data_base64_url_encoded>`
# 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, ::Lnrpc::QueryRoutesRequest, ::Lnrpc::QueryRoutesResponse
rpc :QueryRoutes, QueryRoutesRequest, QueryRoutesResponse
# lncli: `getnetworkinfo`
# GetNetworkInfo returns some basic stats about the known channel graph from
# the point of view of the node.
rpc :GetNetworkInfo, ::Lnrpc::NetworkInfoRequest, ::Lnrpc::NetworkInfo
rpc :GetNetworkInfo, NetworkInfoRequest, NetworkInfo
# lncli: `stop`
# StopDaemon will send a shutdown request to the interrupt handler, triggering
# a graceful shutdown of the daemon.
rpc :StopDaemon, ::Lnrpc::StopRequest, ::Lnrpc::StopResponse
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
@@ -307,21 +304,21 @@ module Lnrpc
# 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, ::Lnrpc::GraphTopologySubscription, stream(::Lnrpc::GraphTopologyUpdate)
rpc :SubscribeChannelGraph, GraphTopologySubscription, 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, ::Lnrpc::DebugLevelRequest, ::Lnrpc::DebugLevelResponse
rpc :DebugLevel, DebugLevelRequest, 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, ::Lnrpc::FeeReportRequest, ::Lnrpc::FeeReportResponse
rpc :FeeReport, FeeReportRequest, FeeReportResponse
# lncli: `updatechanpolicy`
# UpdateChannelPolicy allows the caller to update the fee schedule and
# channel policies for all channels globally, or a particular channel.
rpc :UpdateChannelPolicy, ::Lnrpc::PolicyUpdateRequest, ::Lnrpc::PolicyUpdateResponse
rpc :UpdateChannelPolicy, PolicyUpdateRequest, PolicyUpdateResponse
# 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
@@ -333,7 +330,7 @@ module Lnrpc
# 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, ::Lnrpc::ForwardingHistoryRequest, ::Lnrpc::ForwardingHistoryResponse
rpc :ForwardingHistory, ForwardingHistoryRequest, ForwardingHistoryResponse
# lncli: `exportchanbackup`
# ExportChannelBackup attempts to return an encrypted static channel backup
# for the target channel identified by it channel point. The backup is
@@ -341,25 +338,25 @@ module Lnrpc
# 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, ::Lnrpc::ExportChannelBackupRequest, ::Lnrpc::ChannelBackup
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, ::Lnrpc::ChanBackupExportRequest, ::Lnrpc::ChanBackupSnapshot
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, ::Lnrpc::ChanBackupSnapshot, ::Lnrpc::VerifyChanBackupResponse
rpc :VerifyChanBackup, ChanBackupSnapshot, VerifyChanBackupResponse
# 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, ::Lnrpc::RestoreChanBackupRequest, ::Lnrpc::RestoreBackupResponse
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
@@ -368,23 +365,12 @@ module Lnrpc
# 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, ::Lnrpc::ChannelBackupSubscription, stream(::Lnrpc::ChanBackupSnapshot)
rpc :SubscribeChannelBackups, ChannelBackupSubscription, 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, ::Lnrpc::BakeMacaroonRequest, ::Lnrpc::BakeMacaroonResponse
# lncli: `listmacaroonids`
# ListMacaroonIDs returns all root key IDs that are in use.
rpc :ListMacaroonIDs, ::Lnrpc::ListMacaroonIDsRequest, ::Lnrpc::ListMacaroonIDsResponse
# lncli: `deletemacaroonid`
# DeleteMacaroonID deletes the specified macaroon ID and invalidates all
# macaroons derived from that ID.
rpc :DeleteMacaroonID, ::Lnrpc::DeleteMacaroonIDRequest, ::Lnrpc::DeleteMacaroonIDResponse
# lncli: `listpermissions`
# ListPermissions lists all RPC method URIs and their required macaroon
# permissions to access them.
rpc :ListPermissions, ::Lnrpc::ListPermissionsRequest, ::Lnrpc::ListPermissionsResponse
rpc :BakeMacaroon, BakeMacaroonRequest, BakeMacaroonResponse
end
Stub = Service.rpc_stub_class

View File

@@ -58,7 +58,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "signrpc.SharedKeyRequest" do
optional :ephemeral_pubkey, :bytes, 1
optional :key_loc, :message, 2, "signrpc.KeyLocator"
optional :key_desc, :message, 3, "signrpc.KeyDescriptor"
end
add_message "signrpc.SharedKeyResponse" do
optional :shared_key, :bytes, 1

View File

@@ -10,7 +10,7 @@ module Signrpc
# daemon's wallet.
class Service
include ::GRPC::GenericService
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
@@ -25,7 +25,7 @@ module Signrpc
#
# If we are unable to sign using the specified keys, then an error will be
# returned.
rpc :SignOutputRaw, ::Signrpc::SignReq, ::Signrpc::SignResp
rpc :SignOutputRaw, SignReq, SignResp
#
# ComputeInputScript generates a complete InputIndex for the passed
# transaction with the signature as defined within the passed SignDescriptor.
@@ -37,31 +37,30 @@ module Signrpc
# 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, ::Signrpc::SignReq, ::Signrpc::InputScriptResp
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, ::Signrpc::SignMessageReq, ::Signrpc::SignMessageResp
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, ::Signrpc::VerifyMessageReq, ::Signrpc::VerifyMessageResp
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_desc parameter. Either a key locator or a raw
# public key is expected in the key_desc, if neither is supplied, defaults to
# the node's identity private key:
# 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, ::Signrpc::SharedKeyRequest, ::Signrpc::SharedKeyResponse
rpc :DeriveSharedKey, SharedKeyRequest, SharedKeyResponse
end
Stub = Service.rpc_stub_class

View File

@@ -10,7 +10,7 @@ module Verrpc
# and build information of the running daemon.
class Service
include ::GRPC::GenericService
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
@@ -19,7 +19,7 @@ module Verrpc
# lncli: `version`
# GetVersion returns the current version and build information of the running
# daemon.
rpc :GetVersion, ::Verrpc::VersionRequest, ::Verrpc::Version
rpc :GetVersion, VersionRequest, Version
end
Stub = Service.rpc_stub_class

View File

@@ -10,7 +10,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "walletrpc.ListUnspentRequest" do
optional :min_confs, :int32, 1
optional :max_confs, :int32, 2
optional :account, :string, 3
end
add_message "walletrpc.ListUnspentResponse" do
repeated :utxos, :message, 1, "lnrpc.Utxo"
@@ -18,7 +17,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
add_message "walletrpc.LeaseOutputRequest" do
optional :id, :bytes, 1
optional :outpoint, :message, 2, "lnrpc.OutPoint"
optional :expiration_seconds, :uint64, 3
end
add_message "walletrpc.LeaseOutputResponse" do
optional :expiration, :uint64, 1
@@ -34,46 +32,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :key_family, :int32, 2
end
add_message "walletrpc.AddrRequest" do
optional :account, :string, 1
end
add_message "walletrpc.AddrResponse" do
optional :addr, :string, 1
end
add_message "walletrpc.Account" do
optional :name, :string, 1
optional :address_type, :enum, 2, "walletrpc.AddressType"
optional :extended_public_key, :string, 3
optional :master_key_fingerprint, :bytes, 4
optional :derivation_path, :string, 5
optional :external_key_count, :uint32, 6
optional :internal_key_count, :uint32, 7
optional :watch_only, :bool, 8
end
add_message "walletrpc.ListAccountsRequest" do
optional :name, :string, 1
optional :address_type, :enum, 2, "walletrpc.AddressType"
end
add_message "walletrpc.ListAccountsResponse" do
repeated :accounts, :message, 1, "walletrpc.Account"
end
add_message "walletrpc.ImportAccountRequest" do
optional :name, :string, 1
optional :extended_public_key, :string, 2
optional :master_key_fingerprint, :bytes, 3
optional :address_type, :enum, 4, "walletrpc.AddressType"
optional :dry_run, :bool, 5
end
add_message "walletrpc.ImportAccountResponse" do
optional :account, :message, 1, "walletrpc.Account"
repeated :dry_run_external_addrs, :string, 2
repeated :dry_run_internal_addrs, :string, 3
end
add_message "walletrpc.ImportPublicKeyRequest" do
optional :public_key, :bytes, 1
optional :address_type, :enum, 2, "walletrpc.AddressType"
end
add_message "walletrpc.ImportPublicKeyResponse" do
end
add_message "walletrpc.Transaction" do
optional :tx_hex, :bytes, 1
optional :label, :string, 2
@@ -85,8 +47,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :sat_per_kw, :int64, 1
repeated :outputs, :message, 2, "signrpc.TxOut"
optional :label, :string, 3
optional :min_confs, :int32, 4
optional :spend_unconfirmed, :bool, 5
end
add_message "walletrpc.SendOutputsResponse" do
optional :raw_tx, :bytes, 1
@@ -106,8 +66,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :next_broadcast_height, :uint32, 6
optional :requested_conf_target, :uint32, 8
optional :requested_sat_per_byte, :uint32, 9
optional :sat_per_vbyte, :uint64, 10
optional :requested_sat_per_vbyte, :uint64, 11
optional :force, :bool, 7
end
add_message "walletrpc.PendingSweepsRequest" do
@@ -120,7 +78,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :target_conf, :uint32, 2
optional :sat_per_byte, :uint32, 3
optional :force, :bool, 4
optional :sat_per_vbyte, :uint64, 5
end
add_message "walletrpc.BumpFeeResponse" do
end
@@ -143,52 +100,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
end
add_message "walletrpc.LabelTransactionResponse" do
end
add_message "walletrpc.FundPsbtRequest" do
optional :account, :string, 5
optional :min_confs, :int32, 6
optional :spend_unconfirmed, :bool, 7
oneof :template do
optional :psbt, :bytes, 1
optional :raw, :message, 2, "walletrpc.TxTemplate"
end
oneof :fees do
optional :target_conf, :uint32, 3
optional :sat_per_vbyte, :uint64, 4
end
end
add_message "walletrpc.FundPsbtResponse" do
optional :funded_psbt, :bytes, 1
optional :change_output_index, :int32, 2
repeated :locked_utxos, :message, 3, "walletrpc.UtxoLease"
end
add_message "walletrpc.TxTemplate" do
repeated :inputs, :message, 1, "lnrpc.OutPoint"
map :outputs, :string, :uint64, 2
end
add_message "walletrpc.UtxoLease" do
optional :id, :bytes, 1
optional :outpoint, :message, 2, "lnrpc.OutPoint"
optional :expiration, :uint64, 3
end
add_message "walletrpc.FinalizePsbtRequest" do
optional :funded_psbt, :bytes, 1
optional :account, :string, 5
end
add_message "walletrpc.FinalizePsbtResponse" do
optional :signed_psbt, :bytes, 1
optional :raw_final_tx, :bytes, 2
end
add_message "walletrpc.ListLeasesRequest" do
end
add_message "walletrpc.ListLeasesResponse" do
repeated :locked_utxos, :message, 1, "walletrpc.UtxoLease"
end
add_enum "walletrpc.AddressType" do
value :UNKNOWN, 0
value :WITNESS_PUBKEY_HASH, 1
value :NESTED_WITNESS_PUBKEY_HASH, 2
value :HYBRID_NESTED_WITNESS_PUBKEY_HASH, 3
end
add_enum "walletrpc.WitnessType" do
value :UNKNOWN_WITNESS, 0
value :COMMITMENT_TIME_LOCK, 1
@@ -218,13 +129,6 @@ module Walletrpc
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
Account = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.Account").msgclass
ListAccountsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ListAccountsRequest").msgclass
ListAccountsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ListAccountsResponse").msgclass
ImportAccountRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ImportAccountRequest").msgclass
ImportAccountResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ImportAccountResponse").msgclass
ImportPublicKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ImportPublicKeyRequest").msgclass
ImportPublicKeyResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ImportPublicKeyResponse").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
@@ -241,14 +145,5 @@ module Walletrpc
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
FundPsbtRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.FundPsbtRequest").msgclass
FundPsbtResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.FundPsbtResponse").msgclass
TxTemplate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.TxTemplate").msgclass
UtxoLease = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.UtxoLease").msgclass
FinalizePsbtRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.FinalizePsbtRequest").msgclass
FinalizePsbtResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.FinalizePsbtResponse").msgclass
ListLeasesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ListLeasesRequest").msgclass
ListLeasesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.ListLeasesResponse").msgclass
AddressType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.AddressType").enummodule
WitnessType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("walletrpc.WitnessType").enummodule
end

View File

@@ -10,7 +10,7 @@ module Walletrpc
# daemon's wallet.
class Service
include ::GRPC::GenericService
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
@@ -19,87 +19,47 @@ module Walletrpc
#
# ListUnspent returns a list of all utxos spendable by the wallet with a
# number of confirmations between the specified minimum and maximum.
rpc :ListUnspent, ::Walletrpc::ListUnspentRequest, ::Walletrpc::ListUnspentResponse
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, ::Walletrpc::LeaseOutputRequest, ::Walletrpc::LeaseOutputResponse
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, ::Walletrpc::ReleaseOutputRequest, ::Walletrpc::ReleaseOutputResponse
#
# ListLeases lists all currently locked utxos.
rpc :ListLeases, ::Walletrpc::ListLeasesRequest, ::Walletrpc::ListLeasesResponse
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, ::Walletrpc::KeyReq, ::Signrpc::KeyDescriptor
rpc :DeriveNextKey, KeyReq, Signrpc::KeyDescriptor
#
# DeriveKey attempts to derive an arbitrary key specified by the passed
# KeyLocator.
rpc :DeriveKey, ::Signrpc::KeyLocator, ::Signrpc::KeyDescriptor
rpc :DeriveKey, Signrpc::KeyLocator, Signrpc::KeyDescriptor
#
# NextAddr returns the next unused address within the wallet.
rpc :NextAddr, ::Walletrpc::AddrRequest, ::Walletrpc::AddrResponse
#
# ListAccounts retrieves all accounts belonging to the wallet by default. A
# name and key scope filter can be provided to filter through all of the
# wallet accounts and return only those matching.
rpc :ListAccounts, ::Walletrpc::ListAccountsRequest, ::Walletrpc::ListAccountsResponse
#
# ImportAccount imports an account backed by an account extended public key.
# The master key fingerprint denotes the fingerprint of the root key
# corresponding to the account public key (also known as the key with
# derivation path m/). This may be required by some hardware wallets for
# proper identification and signing.
#
# The address type can usually be inferred from the key's version, but may be
# required for certain keys to map them into the proper scope.
#
# For BIP-0044 keys, an address type must be specified as we intend to not
# support importing BIP-0044 keys into the wallet using the legacy
# pay-to-pubkey-hash (P2PKH) scheme. A nested witness address type will force
# the standard BIP-0049 derivation scheme, while a witness address type will
# force the standard BIP-0084 derivation scheme.
#
# For BIP-0049 keys, an address type must also be specified to make a
# distinction between the standard BIP-0049 address schema (nested witness
# pubkeys everywhere) and our own BIP-0049Plus address schema (nested pubkeys
# externally, witness pubkeys internally).
#
# NOTE: Events (deposits/spends) for keys derived from an account will only be
# detected by lnd if they happen after the import. Rescans to detect past
# events will be supported later on.
rpc :ImportAccount, ::Walletrpc::ImportAccountRequest, ::Walletrpc::ImportAccountResponse
#
# ImportPublicKey imports a public key as watch-only into the wallet.
#
# NOTE: Events (deposits/spends) for a key will only be detected by lnd if
# they happen after the import. Rescans to detect past events will be
# supported later on.
rpc :ImportPublicKey, ::Walletrpc::ImportPublicKeyRequest, ::Walletrpc::ImportPublicKeyResponse
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, ::Walletrpc::Transaction, ::Walletrpc::PublishResponse
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, ::Walletrpc::SendOutputsRequest, ::Walletrpc::SendOutputsResponse
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, ::Walletrpc::EstimateFeeRequest, ::Walletrpc::EstimateFeeResponse
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
@@ -109,7 +69,7 @@ module Walletrpc
# 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, ::Walletrpc::PendingSweepsRequest, ::Walletrpc::PendingSweepsResponse
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
@@ -136,51 +96,18 @@ module Walletrpc
# 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, ::Walletrpc::BumpFeeRequest, ::Walletrpc::BumpFeeResponse
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, ::Walletrpc::ListSweepsRequest, ::Walletrpc::ListSweepsResponse
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, ::Walletrpc::LabelTransactionRequest, ::Walletrpc::LabelTransactionResponse
#
# FundPsbt creates a fully populated PSBT that contains enough inputs to fund
# the outputs specified in the template. There are two ways of specifying a
# template: Either by passing in a PSBT with at least one output declared or
# by passing in a raw TxTemplate message.
#
# If there are no inputs specified in the template, coin selection is
# performed automatically. If the template does contain any inputs, it is
# assumed that full coin selection happened externally and no additional
# inputs are added. If the specified inputs aren't enough to fund the outputs
# with the given fee rate, an error is returned.
#
# After either selecting or verifying the inputs, all input UTXOs are locked
# with an internal app ID.
#
# NOTE: If this method returns without an error, it is the caller's
# responsibility to either spend the locked UTXOs (by finalizing and then
# publishing the transaction) or to unlock/release the locked UTXOs in case of
# an error on the caller's side.
rpc :FundPsbt, ::Walletrpc::FundPsbtRequest, ::Walletrpc::FundPsbtResponse
#
# FinalizePsbt expects a partial transaction with all inputs and outputs fully
# declared and tries to sign all inputs that belong to the wallet. Lnd must be
# the last signer of the transaction. That means, if there are any unsigned
# non-witness inputs or inputs without UTXO information attached or inputs
# without witness data that do not belong to lnd's wallet, this method will
# fail. If no error is returned, the PSBT is ready to be extracted and the
# final TX within to be broadcast.
#
# NOTE: This method does NOT publish the transaction once finalized. It is the
# caller's responsibility to either publish the transaction on success or
# unlock/release any locked UTXOs in case of an error in this method.
rpc :FinalizePsbt, ::Walletrpc::FinalizePsbtRequest, ::Walletrpc::FinalizePsbtResponse
rpc :LabelTransaction, LabelTransactionRequest, LabelTransactionResponse
end
Stub = Service.rpc_stub_class

View File

@@ -20,27 +20,21 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :aezeed_passphrase, :bytes, 3
optional :recovery_window, :int32, 4
optional :channel_backups, :message, 5, "lnrpc.ChanBackupSnapshot"
optional :stateless_init, :bool, 6
end
add_message "lnrpc.InitWalletResponse" do
optional :admin_macaroon, :bytes, 1
end
add_message "lnrpc.UnlockWalletRequest" do
optional :wallet_password, :bytes, 1
optional :recovery_window, :int32, 2
optional :channel_backups, :message, 3, "lnrpc.ChanBackupSnapshot"
optional :stateless_init, :bool, 4
end
add_message "lnrpc.UnlockWalletResponse" do
end
add_message "lnrpc.ChangePasswordRequest" do
optional :current_password, :bytes, 1
optional :new_password, :bytes, 2
optional :stateless_init, :bool, 3
optional :new_macaroon_root_key, :bool, 4
end
add_message "lnrpc.ChangePasswordResponse" do
optional :admin_macaroon, :bytes, 1
end
end
end

View File

@@ -27,7 +27,7 @@ module Lnrpc
# lnd at first startup, and unlock a previously set up wallet.
class Service
include ::GRPC::GenericService
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
@@ -42,7 +42,7 @@ module Lnrpc
# 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, ::Lnrpc::GenSeedRequest, ::Lnrpc::GenSeedResponse
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
@@ -56,15 +56,15 @@ module Lnrpc
# 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, ::Lnrpc::InitWalletRequest, ::Lnrpc::InitWalletResponse
rpc :InitWallet, InitWalletRequest, InitWalletResponse
# lncli: `unlock`
# UnlockWallet is used at startup of lnd to provide a password to unlock
# the wallet database.
rpc :UnlockWallet, ::Lnrpc::UnlockWalletRequest, ::Lnrpc::UnlockWalletResponse
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, ::Lnrpc::ChangePasswordRequest, ::Lnrpc::ChangePasswordResponse
rpc :ChangePassword, ChangePasswordRequest, ChangePasswordResponse
end
Stub = Service.rpc_stub_class

View File

@@ -10,7 +10,7 @@ module Watchtowerrpc
# functionality of the daemon.
class Service
include ::GRPC::GenericService
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
@@ -20,7 +20,7 @@ module Watchtowerrpc
# GetInfo returns general information concerning the companion watchtower
# including its public key and URIs where the server is currently
# listening for clients.
rpc :GetInfo, ::Watchtowerrpc::GetInfoRequest, ::Watchtowerrpc::GetInfoResponse
rpc :GetInfo, GetInfoRequest, GetInfoResponse
end
Stub = Service.rpc_stub_class

View File

@@ -26,7 +26,6 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :num_pending_backups, :uint32, 2
optional :max_backups, :uint32, 3
optional :sweep_sat_per_byte, :uint32, 4
optional :sweep_sat_per_vbyte, :uint32, 5
end
add_message "wtclientrpc.Tower" do
optional :pubkey, :bytes, 1
@@ -51,16 +50,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
optional :num_sessions_exhausted, :uint32, 5
end
add_message "wtclientrpc.PolicyRequest" do
optional :policy_type, :enum, 1, "wtclientrpc.PolicyType"
end
add_message "wtclientrpc.PolicyResponse" do
optional :max_updates, :uint32, 1
optional :sweep_sat_per_byte, :uint32, 2
optional :sweep_sat_per_vbyte, :uint32, 3
end
add_enum "wtclientrpc.PolicyType" do
value :LEGACY, 0
value :ANCHOR, 1
end
end
end
@@ -79,5 +72,4 @@ module Wtclientrpc
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
PolicyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("wtclientrpc.PolicyType").enummodule
end

View File

@@ -10,7 +10,7 @@ module Wtclientrpc
# functionality of the daemon.
class Service
include ::GRPC::GenericService
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
@@ -21,21 +21,21 @@ module Wtclientrpc
# 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, ::Wtclientrpc::AddTowerRequest, ::Wtclientrpc::AddTowerResponse
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, ::Wtclientrpc::RemoveTowerRequest, ::Wtclientrpc::RemoveTowerResponse
rpc :RemoveTower, RemoveTowerRequest, RemoveTowerResponse
# ListTowers returns the list of watchtowers registered with the client.
rpc :ListTowers, ::Wtclientrpc::ListTowersRequest, ::Wtclientrpc::ListTowersResponse
rpc :ListTowers, ListTowersRequest, ListTowersResponse
# GetTowerInfo retrieves information for a registered watchtower.
rpc :GetTowerInfo, ::Wtclientrpc::GetTowerInfoRequest, ::Wtclientrpc::Tower
rpc :GetTowerInfo, GetTowerInfoRequest, Tower
# Stats returns the in-memory statistics of the client since startup.
rpc :Stats, ::Wtclientrpc::StatsRequest, ::Wtclientrpc::StatsResponse
rpc :Stats, StatsRequest, StatsResponse
# Policy returns the active watchtower client policy configuration.
rpc :Policy, ::Wtclientrpc::PolicyRequest, ::Wtclientrpc::PolicyResponse
rpc :Policy, PolicyRequest, PolicyResponse
end
Stub = Service.rpc_stub_class

View File

@@ -11,6 +11,7 @@ module Lnrpc
class Error < StandardError; end
autoload :Client, 'lnrpc/client'
autoload :GrpcWrapper, 'lnrpc/grpc_wrapper'
autoload :PaymentResponse, 'lnrpc/payment_response'
autoload :MacaroonInterceptor, 'lnrpc/macaroon_interceptor'
PREIMAGE_BYTE_LENGTH = 32

View File

@@ -13,8 +13,7 @@ module Lnrpc
self.address = options[:address] || DEFAULT_ADDRESS
if options.has_key?(:credentials)
# if there are non hex values prvided we assume it's the certificate file as string otherwise we assume it's the hex value
self.credentials = options[:credentials].match?(/\H/) ? options[:credentials] : [options[:credentials]].pack('H*')
self.credentials = options[:credentials]
elsif File.exists?(::File.expand_path(options[:credentials_path] || DEFAULT_CREDENTIALS_PATH))
self.credentials = ::File.read(::File.expand_path(options[:credentials_path] || DEFAULT_CREDENTIALS_PATH))
else
@@ -76,12 +75,12 @@ module Lnrpc
args[:dest_custom_records][Lnrpc::KEY_SEND_PREIMAGE_TYPE] ||= Lnrpc.create_preimage
args[:payment_hash] ||= Digest::SHA256.digest(args[:dest_custom_records][Lnrpc::KEY_SEND_PREIMAGE_TYPE])
args[:timeout_seconds] ||= 60
router.send_payment_v2(args)
PaymentResponse.new(router.send_payment_v2(args))
end
def pay(args)
args[:timeout_seconds] ||= 60
router.send_payment_v2(args)
PaymentResponse.new(router.send_payment_v2(args))
end
def inspect

View File

@@ -0,0 +1,30 @@
module Lnrpc
class PaymentResponse
attr_reader :grpc_response, :exception
def initialize(send_payment_response)
@grpc_response = send_payment_response
end
def states
@states ||= response_array.map(&:status)
end
def success?
return false if exception
@success ||= states.include?(:SUCCEEDED)
end
def fee
@fee ||= response_array.sum(&:fee)
end
def response_array
@response_array ||= @grpc_response.to_a
rescue GRPC::BadStatus => e
@exception = e
[]
end
end
end

View File

@@ -1,3 +1,3 @@
module Lnrpc
VERSION = "0.13.0"
VERSION = "0.11.0"
end

View File

@@ -25,10 +25,10 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib", "lib/grpc_services"]
spec.add_development_dependency "bundler", "> 2.0"
spec.add_development_dependency "bundler", "~> 1.17"
spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_dependency "grpc", ">= 1.28.0"
spec.add_dependency "google-protobuf", ">=3.12"
spec.add_dependency "grpc", ">= 1.19.0"
spec.add_dependency "google-protobuf", ">=3.7"
end