1
0
mirror of https://github.com/bumi/lnrpc synced 2026-02-17 16:37:48 +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:
2020-08-28 14:09:57 +02:00
parent 579fc423ea
commit 404ed3b99e
31 changed files with 2758 additions and 5878 deletions

View File

@@ -0,0 +1,48 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: invoicesrpc/invoices.proto
require 'google/protobuf'
require 'rpc_pb'
Google::Protobuf::DescriptorPool.generated_pool.build do
add_file("invoicesrpc/invoices.proto", :syntax => :proto3) do
add_message "invoicesrpc.CancelInvoiceMsg" do
optional :payment_hash, :bytes, 1
end
add_message "invoicesrpc.CancelInvoiceResp" do
end
add_message "invoicesrpc.AddHoldInvoiceRequest" do
optional :memo, :string, 1
optional :hash, :bytes, 2
optional :value, :int64, 3
optional :value_msat, :int64, 10
optional :description_hash, :bytes, 4
optional :expiry, :int64, 5
optional :fallback_addr, :string, 6
optional :cltv_expiry, :uint64, 7
repeated :route_hints, :message, 8, "lnrpc.RouteHint"
optional :private, :bool, 9
end
add_message "invoicesrpc.AddHoldInvoiceResp" do
optional :payment_request, :string, 1
end
add_message "invoicesrpc.SettleInvoiceMsg" do
optional :preimage, :bytes, 1
end
add_message "invoicesrpc.SettleInvoiceResp" do
end
add_message "invoicesrpc.SubscribeSingleInvoiceRequest" do
optional :r_hash, :bytes, 2
end
end
end
module Invoicesrpc
CancelInvoiceMsg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.CancelInvoiceMsg").msgclass
CancelInvoiceResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.CancelInvoiceResp").msgclass
AddHoldInvoiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.AddHoldInvoiceRequest").msgclass
AddHoldInvoiceResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.AddHoldInvoiceResp").msgclass
SettleInvoiceMsg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.SettleInvoiceMsg").msgclass
SettleInvoiceResp = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.SettleInvoiceResp").msgclass
SubscribeSingleInvoiceRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("invoicesrpc.SubscribeSingleInvoiceRequest").msgclass
end

View File

@@ -0,0 +1,41 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# Source: invoicesrpc/invoices.proto for package 'invoicesrpc'
require 'grpc'
require 'invoicesrpc/invoices_pb'
module Invoicesrpc
module Invoices
# Invoices is a service that can be used to create, accept, settle and cancel
# invoices.
class Service
include GRPC::GenericService
self.marshal_class_method = :encode
self.unmarshal_class_method = :decode
self.service_name = 'invoicesrpc.Invoices'
#
# SubscribeSingleInvoice returns a uni-directional stream (server -> client)
# to notify the client of state transitions of the specified invoice.
# Initially the current invoice state is always sent out.
rpc :SubscribeSingleInvoice, SubscribeSingleInvoiceRequest, stream(Lnrpc::Invoice)
#
# CancelInvoice cancels a currently open invoice. If the invoice is already
# canceled, this call will succeed. If the invoice is already settled, it will
# fail.
rpc :CancelInvoice, CancelInvoiceMsg, CancelInvoiceResp
#
# AddHoldInvoice creates a hold invoice. It ties the invoice to the hash
# supplied in the request.
rpc :AddHoldInvoice, AddHoldInvoiceRequest, AddHoldInvoiceResp
#
# SettleInvoice settles an accepted invoice. If the invoice is already
# settled, this call will succeed.
rpc :SettleInvoice, SettleInvoiceMsg, SettleInvoiceResp
end
Stub = Service.rpc_stub_class
end
end