Module: BSV::Wallet::ChainProvider
- Included in:
- NullChainProvider, WhatsOnChainProvider
- Defined in:
- lib/bsv/wallet_interface/chain_provider.rb
Overview
Duck-typed interface for blockchain data providers.
Include this module in chain provider adapters and override all methods. The default implementations raise NotImplementedError.
Instance Method Summary collapse
-
#get_header(_height) ⇒ String
Returns the block header at the given height.
-
#get_height ⇒ Integer
Returns the current blockchain height.
-
#get_transaction(_txid) ⇒ String
Returns the raw transaction hex for the given txid.
-
#get_utxos(_address) ⇒ Array<Hash>
Returns unspent transaction outputs for the given address.
Instance Method Details
#get_header(_height) ⇒ String
Returns the block header at the given height.
32 33 34 |
# File 'lib/bsv/wallet_interface/chain_provider.rb', line 32 def get_header(_height) raise NotImplementedError, "#{self.class}#get_header not implemented" end |
#get_height ⇒ Integer
Returns the current blockchain height.
25 26 27 |
# File 'lib/bsv/wallet_interface/chain_provider.rb', line 25 def get_height raise NotImplementedError, "#{self.class}#get_height not implemented" end |
#get_transaction(_txid) ⇒ String
Returns the raw transaction hex for the given txid.
46 47 48 |
# File 'lib/bsv/wallet_interface/chain_provider.rb', line 46 def get_transaction(_txid) raise NotImplementedError, "#{self.class}#get_transaction not implemented" end |
#get_utxos(_address) ⇒ Array<Hash>
Returns unspent transaction outputs for the given address.
39 40 41 |
# File 'lib/bsv/wallet_interface/chain_provider.rb', line 39 def get_utxos(_address) raise NotImplementedError, "#{self.class}#get_utxos not implemented" end |