Class: BSV::Wallet::Postgres::ArcAdapter
- Inherits:
-
Object
- Object
- BSV::Wallet::Postgres::ArcAdapter
- Defined in:
- lib/bsv/wallet/postgres/arc_adapter.rb
Overview
Bridges the BroadcastQueue’s arc_client interface (which passes raw_tx binary) with the SDK’s ARC protocol (which expects Transaction objects).
Instance Method Summary collapse
- #call(method, *args, **kwargs) ⇒ Object
-
#initialize(provider) ⇒ ArcAdapter
constructor
A new instance of ArcAdapter.
Constructor Details
#initialize(provider) ⇒ ArcAdapter
Returns a new instance of ArcAdapter.
14 15 16 |
# File 'lib/bsv/wallet/postgres/arc_adapter.rb', line 14 def initialize(provider) @provider = provider end |
Instance Method Details
#call(method, *args, **kwargs) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/bsv/wallet/postgres/arc_adapter.rb', line 18 def call(method, *args, **kwargs) case method when :broadcast tx = BSV::Transaction::Transaction.from_binary(args.first) @provider.call(:broadcast, tx) when :get_tx_status @provider.call(:get_tx_status, **kwargs) else @provider.call(method, *args, **kwargs) end end |