Module: BSV::Wallet::Client::Network
- Included in:
- BSV::Wallet::Client
- Defined in:
- lib/bsv/wallet/client/brc100/network.rb
Overview
Blockchain and network data methods for BSV::Wallet::Client.
Instance Method Summary collapse
-
#get_header_for_height(args, originator: nil) ⇒ Hash
Returns the block header at the given height.
-
#get_height(args = {}, originator: nil) ⇒ Hash
Returns the current blockchain height.
-
#get_network(args = {}, originator: nil) ⇒ Hash
Returns the network this wallet is configured for.
-
#get_version(args = {}, originator: nil) ⇒ Hash
Returns the wallet version string.
Instance Method Details
#get_header_for_height(args, originator: nil) ⇒ Hash
Returns the block header at the given height.
Requires a substrate — raises UnsupportedActionError locally.
26 27 28 29 30 |
# File 'lib/bsv/wallet/client/brc100/network.rb', line 26 def get_header_for_height(args, originator: nil) return @substrate.get_header_for_height(args, originator: originator) if @substrate raise UnsupportedActionError, 'get_header_for_height requires a remote substrate' end |
#get_height(args = {}, originator: nil) ⇒ Hash
Returns the current blockchain height.
Requires a substrate — raises UnsupportedActionError locally.
13 14 15 16 17 |
# File 'lib/bsv/wallet/client/brc100/network.rb', line 13 def get_height(args = {}, originator: nil) return @substrate.get_height(args, originator: originator) if @substrate raise UnsupportedActionError, 'get_height requires a remote substrate' end |
#get_network(args = {}, originator: nil) ⇒ Hash
Returns the network this wallet is configured for.
35 36 37 38 39 |
# File 'lib/bsv/wallet/client/brc100/network.rb', line 35 def get_network(args = {}, originator: nil) return @substrate.get_network(args, originator: originator) if @substrate { network: @network } end |
#get_version(args = {}, originator: nil) ⇒ Hash
Returns the wallet version string.
44 45 46 47 48 |
# File 'lib/bsv/wallet/client/brc100/network.rb', line 44 def get_version(args = {}, originator: nil) return @substrate.get_version(args, originator: originator) if @substrate { version: "bsv-wallet-#{BSV::Wallet::VERSION}" } end |