class Straight::Blockchain::Adapter
A base class, providing guidance for the interfaces of all blockchain adapters as well as supplying some useful methods.
Constants
- MAX_TRIES
How much times try to connect to servers if ReadTimeout error appears
Public Instance Methods
fetch_balance_for(address)
click to toggle source
# File lib/straight/blockchain_adapter.rb, line 30 def fetch_balance_for(address) raise "Please implement #fetch_balance_for in #{self.to_s}" end
fetch_transaction(tid)
click to toggle source
# File lib/straight/blockchain_adapter.rb, line 22 def fetch_transaction(tid) raise "Please implement #fetch_transaction in #{self.to_s}" end
fetch_transactions_for(address)
click to toggle source
# File lib/straight/blockchain_adapter.rb, line 26 def fetch_transactions_for(address) raise "Please implement #fetch_transactions_for in #{self.to_s}" end
Private Instance Methods
straighten_transaction(transaction)
click to toggle source
Converts transaction info received from the source into the unified format expected by users of BlockchainAdapter instances.
# File lib/straight/blockchain_adapter.rb, line 38 def straighten_transaction(transaction) raise "Please implement #straighten_transaction in #{self.to_s}" end