lib/bitcoin/grpc/server.rb in bitcoinrb-grpc-0.1.7 vs lib/bitcoin/grpc/server.rb in bitcoinrb-grpc-0.1.8
- old
+ new
@@ -94,9 +94,33 @@
EventsResponseEnum.new(events).each
rescue => e
logger.error("events: #{e.message}")
logger.error("events: #{e.backtrace}")
end
+
+ def list_unspent(request, _call)
+ logger.info("list_unspent: #{request}")
+ Bitcoin::Grpc::Api::ListUnspent.new(spv).execute(request)
+ rescue => e
+ logger.error("list_unspent: #{e.message}")
+ logger.error("list_unspent: #{e.backtrace}")
+ end
+
+ def list_colored_unspent(request, _call)
+ logger.info("list_colored_unspent: #{request}")
+ Bitcoin::Grpc::Api::ListColoredUnspent.new(spv).execute(request)
+ rescue => e
+ logger.error("list_colored_unspent: #{e.message}")
+ logger.error("list_colored_unspent: #{e.backtrace}")
+ end
+
+ def list_uncolored_unspent(request, _call)
+ logger.info("list_uncolored_unspent: #{request}")
+ Bitcoin::Grpc::Api::ListUncoloredUnspent.new(spv).execute(request)
+ rescue => e
+ logger.error("list_uncolored_unspent: #{e.message}")
+ logger.error("list_uncolored_unspent: #{e.backtrace}")
+ end
end
class EventsReceiver < Concurrent::Actor::Context
attr_reader :events, :logger, :publisher